-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
85 lines (67 loc) · 2.32 KB
/
build.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
74
75
76
77
78
79
80
81
82
83
84
85
plugins {
id 'java-library'
id 'idea'
id 'maven-publish'
id "net.ltgt.errorprone" version "latest.release"
}
repositories {
mavenLocal()
mavenCentral()
}
println "[INFO] ${project.group}:${project.name}:$version ⇒ ${tasks.jar.archiveFileName.get()} # JVM: ${System.getProperty("java.version")} Gradle: ${gradle.gradleVersion}"
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs.addAll(['-Xlint:all,-serial', '-parameters', '-g', '-Xmaxwarns', '999'])
options.release.set(8) // javac --release 8
options.deprecation = true
options.annotationProcessorPath = configurations.errorprone
options.errorprone {
enabled = true
disableWarningsInGeneratedCode = true
excludedPaths = ".*/build/gen.*/.*"
//disable("ParameterName") disable("UnusedVariable") errorproneArgs = ["--illegal-access=warn"]
}
}
dependencies {
errorprone "com.google.errorprone:error_prone_core:latest.release"
//works since 1.12, but XML escaping is better and XML is more compact since 1.14.2
//api vs implementation: jsoup is 100% already declared, if we are used
implementation 'org.jsoup:jsoup:1.+'
testImplementation("org.junit.jupiter:junit-jupiter:latest.release")
testImplementation("org.junit.vintage:junit-vintage-engine:latest.release")
testImplementation 'com.google.code.gson:gson:2.+'
}
test {
useJUnitPlatform()
maxHeapSize = '256M'
enableAssertions = true
testLogging.showStandardStreams = true // show standard out & err of the test JVM on the console
System.setProperty("slf4j.detectLoggerNameMismatch", "true")
System.setProperty("file.encoding", "UTF-8")
}
java { // https://docs.gradle.org/current/userguide/publishing_maven.html
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
release(MavenPublication) { // artifactId = folder name = 'json4jsoup'
from components.java
suppressPomMetadataWarningsFor('runtimeElements')
}
}
}
javadoc {
options.encoding = 'UTF-8'
options.addBooleanOption('html5', true)
}
idea { module { downloadJavadoc = true; downloadSources = true } }
jar {
from generatePomFileForReleasePublication {
rename('pom-default.xml', "META-INF/maven/${project.group}/${project.name}/pom.xml")
}
}
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}