Skip to content

Commit e6f1457

Browse files
committed
[jOOQ#393] Gradle build with Error-Prone and improved gitignores
1 parent 0359cb5 commit e6f1457

File tree

10 files changed

+469
-238
lines changed

10 files changed

+469
-238
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
target
33
*.iml
4+
.gradle
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

jOOL-java-8/.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,16 @@ target
33
*.iml
44
.classpath
55
.settings
6-
.project
6+
.project
7+
8+
build/
9+
**/build/
10+
!**/src/main/**/build/
11+
!**/src/test/**/build/
12+
out/
13+
**/out/
14+
!**/src/main/**/out/
15+
!**/src/test/**/out/
16+
17+
*.class
18+
.gradle

jOOL-java-8/build.gradle

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
plugins {
2+
id 'java-library'
3+
id 'idea'
4+
id 'maven-publish'
5+
//id 'net.ltgt.errorprone' version '+'
6+
//id "org.checkerframework" version '+'
7+
//id 'io.franzbecker.gradle-lombok' version '+'
8+
}
9+
10+
repositories {
11+
mavenLocal()
12+
mavenCentral()
13+
}
14+
15+
// sourceCompatibility = 1.8 → https://docs.gradle.org/current/userguide/toolchains.html
16+
java {
17+
toolchain {
18+
languageVersion = JavaLanguageVersion.of(8)
19+
}
20+
}
21+
22+
javadoc {
23+
options.encoding = 'UTF-8'
24+
}
25+
26+
gradle.projectsEvaluated {
27+
tasks.withType(JavaCompile).configureEach {
28+
options.encoding = 'UTF-8'
29+
options.compilerArgs.addAll(['-Xlint:all', '-parameters', '-g', '-Xmaxwarns', '999'])
30+
//options.release = 8 // javac --release 7..18+
31+
options.deprecation = true
32+
//options.annotationProcessorPath = configurations.errorprone
33+
34+
// options.errorprone {
35+
// enabled = true
36+
// disableWarningsInGeneratedCode = true
37+
// excludedPaths = ".*/build/gen.*/.*"
38+
// //disable("ParameterName") disable("UnusedVariable") errorproneArgs = ["--illegal-access=warn"]
39+
// errorproneArgs = ["-XepExcludedPaths:.*/test/.*"]
40+
// }
41+
}
42+
}
43+
44+
publishing {
45+
publications { // artifactId = folder name
46+
maven(MavenPublication) {
47+
from components.java
48+
}
49+
}
50+
}
51+
tasks.withType(GenerateModuleMetadata) {
52+
enabled = false // don't generate Gradle's json metadata
53+
}
54+
55+
// https://docs.gradle.org/current/userguide/publishing_maven.html
56+
java {
57+
withSourcesJar()
58+
withJavadocJar()
59+
}
60+
61+
dependencies {
62+
//errorprone "com.google.errorprone:error_prone_core:latest.release"
63+
//implementation 'org.checkerframework:checker-qual:3.+'
64+
65+
testImplementation 'junit:junit:4.+'
66+
//testImplementation 'org.mockito:mockito-inline:+'
67+
//testImplementation "com.google.truth:truth:+"
68+
//testImplementation "com.google.truth.extensions:truth-java8-extension:+"
69+
testRuntimeOnly 'org.slf4j:slf4j-api:2.+'
70+
testRuntimeOnly 'org.slf4j:slf4j-simple:2.+'
71+
testRuntimeOnly 'org.apache.logging.log4j:log4j-api:2.+'
72+
testRuntimeOnly 'org.apache.logging.log4j:log4j-core:2.+'
73+
}
74+
75+
idea {
76+
module {
77+
downloadJavadoc = true
78+
downloadSources = true
79+
}
80+
}
81+
82+
test {
83+
useJUnit()
84+
maxHeapSize = "500m"
85+
enableAssertions = true
86+
87+
testLogging.showStandardStreams = true // show standard out & err of the test JVM on the console
88+
89+
System.setProperty("slf4j.detectLoggerNameMismatch", "true")
90+
System.setProperty("file.encoding", "UTF-8")
91+
}
92+
93+
//lombok {
94+
// version = "1.+"
95+
// sha256 = "" // don't verify lombok.jar
96+
//}

jOOL-java-8/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
group=org.jooq
2+
3+
version=0.9.15

jOOL/.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,16 @@ target
33
*.iml
44
.classpath
55
.settings
6-
.project
6+
.project
7+
8+
build/
9+
**/build/
10+
!**/src/main/**/build/
11+
!**/src/test/**/build/
12+
out/
13+
**/out/
14+
!**/src/main/**/out/
15+
!**/src/test/**/out/
16+
17+
*.class
18+
.gradle

jOOL/build.gradle

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
plugins {
2+
id 'java-library'
3+
id 'idea'
4+
id 'maven-publish'
5+
id 'net.ltgt.errorprone' version '+'
6+
//id 'org.checkerframework' version '+'
7+
//id 'io.franzbecker.gradle-lombok' version '+'
8+
}
9+
10+
repositories {
11+
mavenLocal()
12+
mavenCentral()
13+
}
14+
15+
sourceCompatibility = 9
16+
17+
javadoc {
18+
options.encoding = 'UTF-8'
19+
if(JavaVersion.current().isJava9Compatible()) {
20+
options.addBooleanOption('html5', true)
21+
}
22+
}
23+
24+
gradle.projectsEvaluated {
25+
tasks.withType(JavaCompile).configureEach {
26+
options.encoding = 'UTF-8'
27+
options.compilerArgs.addAll(['-Xlint:all', '-parameters', '-g', '-Xmaxwarns', '999'])
28+
options.release.set(9) // javac --release 7..18+
29+
options.deprecation = true
30+
options.annotationProcessorPath = configurations.errorprone
31+
32+
options.errorprone {
33+
enabled = true
34+
disableWarningsInGeneratedCode = true
35+
excludedPaths = ".*/build/gen.*/.*"
36+
//disable("ParameterName") disable("UnusedVariable") errorproneArgs = ["--illegal-access=warn"]
37+
errorproneArgs = ["-XepExcludedPaths:.*/test/.*"]
38+
}
39+
}
40+
}
41+
42+
publishing {
43+
publications { // artifactId = folder name
44+
maven(MavenPublication) {
45+
from components.java
46+
}
47+
}
48+
}
49+
tasks.withType(GenerateModuleMetadata) {
50+
enabled = false // don't generate Gradle's json metadata
51+
}
52+
// https://docs.gradle.org/current/userguide/publishing_maven.html
53+
java {
54+
withSourcesJar()
55+
withJavadocJar()
56+
}
57+
58+
dependencies {
59+
errorprone "com.google.errorprone:error_prone_core:latest.release"
60+
61+
//implementation 'org.checkerframework:checker-qual:3.+'
62+
63+
testImplementation 'junit:junit:4.+'
64+
//testImplementation 'org.mockito:mockito-inline:+'
65+
//testImplementation "com.google.truth:truth:+"
66+
//testImplementation "com.google.truth.extensions:truth-java8-extension:+"
67+
testRuntimeOnly 'org.slf4j:slf4j-api:2.+'
68+
testRuntimeOnly 'org.slf4j:slf4j-simple:2.+'
69+
70+
testRuntimeOnly 'org.apache.logging.log4j:log4j-api:2.+'
71+
testRuntimeOnly 'org.apache.logging.log4j:log4j-core:2.+'
72+
}
73+
74+
idea {
75+
module {
76+
downloadJavadoc = true
77+
downloadSources = true
78+
}
79+
}
80+
81+
test {
82+
useJUnit()
83+
maxHeapSize = "500m"
84+
enableAssertions = true
85+
86+
testLogging.showStandardStreams = true // show standard out & err of the test JVM on the console
87+
88+
System.setProperty("slf4j.detectLoggerNameMismatch", "true")
89+
System.setProperty("file.encoding", "UTF-8")
90+
}
91+
92+
//lombok {
93+
// version = "1.+"
94+
// sha256 = "" // don't verify lombok.jar
95+
//}

jOOL/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
group=org.jooq
2+
3+
version=0.9.15

0 commit comments

Comments
 (0)