/
build.gradle
63 lines (44 loc) · 1.83 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
/*
* Gradle script for the Scent project
*/
plugins
{
id 'com.github.spotbugs' version '4.7.0'
id 'org.myire.quill.core' version '3.1'
id 'org.myire.quill.moduleinfo' version '3.1'
}
// Load project meta data and version from the files in the meta data directory, and set the
// group and version from the loaded values.
projectMetaData.from('meta/project-meta.json').applyGroupToProject()
semanticVersion.from('meta/version.json').applyLongVersionToProject()
// Load dependencies from the external file.
apply from: 'dependencies.gradle'
// Use Maven central to retrieve dependencies.
repositories.mavenCentral()
// The project must be compiled with at least Java 9 to create a modular jar file, but the regular
// Java classes should target Java 8.
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
// Configure all Jar tasks to add a build info section to the manifest.
tasks.withType(Jar)
{
manifest.addBuildInfoSection()
}
// Configure the main jar to to add a main-class attribute and a classpath attribute, and to add a
// package section to the manifest.
jar.manifest
{
addMainClassAttribute()
addClassPathAttribute sourceSets.main
addPackageSection()
}
// Specify the JavaDoc html version to avoid warnings when building with JDK 9 or 10.
javadoc.options.addBooleanOption('html5', true)
// Add static data from the pom template when the pom file is created.
createPom.from(file('meta/pom-template.xml'))
// Configure project specific exclusion/suppressions/filter files for the static analysis tasks.
spotbugs.excludeFilter = file('gradle/spotbugs_excludes.xml')
checkstyle.configProperties.put('suppressions.file', file('gradle/checkstyle_suppressions.xml'))
pmdMain.filter.file = 'gradle/pmd_filter.xml'
// Disable code quality analysis of the test sources.
[spotbugs, checkstyle, pmd]*.disableTestChecks()