forked from Ali-RS/jme-vehicles
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcommon.gradle
More file actions
61 lines (51 loc) · 2.07 KB
/
Copy pathcommon.gradle
File metadata and controls
61 lines (51 loc) · 2.07 KB
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
// Gradle settings and tasks common to all jme-vehicles 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_8
targetCompatibility = JavaVersion.VERSION_11
}
javadoc {
// Disable doclint to avoid "no comment" warnings:
options.addStringOption('Xdoclint:none', '-quiet')
}
checkstyle {
toolVersion = rootProject.libs.versions.checkstyle.get()
}
tasks.withType(JavaCompile).configureEach { // Java compile-time options:
options.compilerArgs << '-Xdiags:verbose'
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20)) {
// Suppress warnings that source value 8 is obsolete.
options.compilerArgs << '-Xlint:-options'
}
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true // to provide detailed deprecation warnings
options.encoding = 'UTF-8'
options.release = 11
}
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
Boolean isMacOS = DefaultNativePlatform.currentOperatingSystem.isMacOsX()
tasks.withType(JavaExec).configureEach { // Java runtime options:
if (isMacOS) {
args '--noDialog'
jvmArgs '-XstartOnFirstThread'
}
enableAssertions = true
jvmArgs '--enable-native-access=ALL-UNNAMED' // suppress System::load() warning
//jvmArgs '-verbose:gc'
jvmArgs '-Xms512m', '-Xmx512m' // to enlarge the Java heap
jvmArgs '-XX:MaxDirectMemorySize=1200m' // to limit memory consumption by direct buffers
//jvmArgs '-XX:+UseG1GC', '-XX:MaxGCPauseMillis=10'
}
// Register custom tasks for creating source/javadoc JARs:
tasks.register('javadocJar', Jar) {
archiveClassifier = 'javadoc'
dependsOn 'javadoc'
description = 'Creates a JAR of javadoc.'
from javadoc.destinationDir
}
tasks.register('sourcesJar', Jar) {
archiveClassifier = 'sources'
description = 'Creates a JAR of sourcecode.'
from sourceSets.main.allJava // default is ".allSource", which includes resources
}