-
Notifications
You must be signed in to change notification settings - Fork 17
/
opencadc.gradle
78 lines (67 loc) · 2.13 KB
/
opencadc.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
configurations {
checkstyleDep
intTestCompile.extendsFrom testCompile
intTestRuntime.extendsFrom testRuntime
}
dependencies {
testCompile 'com.puppycrawl.tools:checkstyle:8.2'
checkstyleDep 'org.opencadc:cadc-quality:[1.0,)'
}
checkstyle {
ignoreFailures = false
config = resources.text.fromArchiveEntry(configurations.checkstyleDep, 'cadc_checkstyle.xml')
toolVersion = '8.2'
sourceSets = []
}
sourceSets {
test {
resources.srcDirs += 'src/test/resources'
}
intTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
resources.srcDir file('src/intTest/resources')
resources.srcDirs += new File(System.getenv('A') + '/test-certificates/')
}
}
// Temporary work around for issue https://github.com/gradle/gradle/issues/881 -
// gradle not displaying fail build status when warnings reported -->
tasks.withType(Checkstyle).each { checkstyleTask ->
checkstyleTask.doLast {
reports.all { report ->
def outputFile = report.destination
if (outputFile.exists() && outputFile.text.contains("<error ")) {
throw new GradleException("There were checkstyle warnings! For more info check $outputFile")
}
}
}
}
tasks.withType(Test) {
// reset the report destinations so that intTests go to their own page
//reports.html.destination = file("${reporting.baseDir}/${name}")
reports.html.destination = file(reporting.baseDir.getAbsolutePath() + '/' + name)
// Assign all Java system properties from
// the command line to the tests
systemProperties System.properties
}
task intTest(type: Test) {
// set the configuration context
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath
// run the tests always
outputs.upToDateWhen { false }
}
test {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// "STARTED",
}
}
intTest {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// "STARTED",
}
}