-
Notifications
You must be signed in to change notification settings - Fork 23
/
common.gradle
73 lines (63 loc) · 2.51 KB
/
common.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Gradle settings and tasks common to all Minie subprojects
apply plugin: 'checkstyle' // to analyze Java sourcecode for style violations
apply plugin: 'java' // to compile and test Java projects
java {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_8
}
checkstyle {
toolVersion libs.versions.checkstyle.get()
}
tasks.withType(JavaCompile).configureEach { // Java compile-time options:
options.compilerArgs << '-Xdiags:verbose'
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_14)) {
// Suppress warnings that source value 7 is obsolete.
options.compilerArgs << '-Xlint:-options'
}
options.compilerArgs << '-Xlint:unchecked'
//options.deprecation = true // to provide detailed deprecation warnings
options.encoding = 'UTF-8'
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_1_10)) {
options.release = 8
}
}
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
Boolean isMacOS = DefaultNativePlatform.currentOperatingSystem.isMacOsX()
tasks.withType(JavaExec).configureEach { // Java runtime options:
if (isMacOS) {
jvmArgs '-XstartOnFirstThread'
} else {
args '--showSettingsDialog'
}
//args '--verbose' // to enable additional log output
classpath sourceSets.main.runtimeClasspath
enableAssertions true
//jvmArgs '-verbose:gc'
//jvmArgs '-Xcheck:jni'
jvmArgs '-Xms1024m', '-Xmx1024m' // to enlarge the Java heap
//jvmArgs '-XX:+UseG1GC', '-XX:MaxGCPauseMillis=10'
}
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' // to disable caching of snapshots
}
// Register cleanup tasks:
clean.dependsOn('cleanDLLs', 'cleanDyLibs', 'cleanLogs', 'cleanPDBs', \
'cleanSandbox', 'cleanSOs')
tasks.register('cleanDLLs', Delete) { // extracted Windows native libraries
delete fileTree(dir: '.', include: '*.dll')
}
tasks.register('cleanDyLibs', Delete) { // extracted macOS native libraries
delete fileTree(dir: '.', include: '*.dylib')
}
tasks.register('cleanLogs', Delete) { // JVM crash logs
delete fileTree(dir: '.', include: 'hs_err_pid*.log')
}
tasks.register('cleanPDBs', Delete) { // Windows program database files
delete fileTree(dir: '.', include: '*.pdb')
}
tasks.register('cleanSandbox', Delete) { // Acorus sandbox
delete 'Written Assets'
}
tasks.register('cleanSOs', Delete) { // extracted Linux and Android native libraries
delete fileTree(dir: '.', include: '*.so')
}