forked from gradle/gradle
/
build.gradle
48 lines (40 loc) · 922 Bytes
/
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
plugins {
id 'java-library'
id 'checkstyle'
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
version = '1.2.1'
ext {
currentBuildNumber = '1234'
}
// tag::repositories[]
repositories {
mavenCentral()
}
// end::repositories[]
// tag::compile-dependencies[]
dependencies {
implementation 'log4j:log4j:1.2.12' // <1>
}
// end::compile-dependencies[]
// tag::pom-dependencies[]
dependencies {
testImplementation 'org.codehaus.groovy:groovy-all:2.5.4'
}
// end::pom-dependencies[]
// tag::process-resources[]
processResources {
expand(version: version, buildNumber: currentBuildNumber)
}
// end::process-resources[]
// tag::checkstyle[]
checkstyle {
config = resources.text.fromFile('checkstyle.xml', 'UTF-8')
showViolations = true
ignoreFailures = false
}
// end::checkstyle[]
// tag::depends-on[]
test.mustRunAfter checkstyleMain, checkstyleTest
// end::depends-on[]