-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
106 lines (93 loc) · 3.52 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
apply plugin: 'java'
apply plugin: 'application'
application {
mainClassName = 'spacetx.FOVTool'
applicationDefaultJvmArgs = ['-Xmx2G']
}
group = "spacetx"
version = "0.1.2-SNAPSHOT"
ext {
bfversion = "6.0.1"
}
repositories {
mavenLocal() // while building locally
mavenCentral()
maven {
name 'Unidata'
url 'https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases'
}
maven {
url 'https://artifacts.openmicroscopy.org/artifactory/maven/'
}
}
dependencies {
compile(group: 'ome', name: 'formats-api', version: bfversion){}
compile(group: 'ome', name: 'formats-bsd', version: bfversion){}
compile(group: 'ome', name: 'formats-gpl', version: bfversion){}
compile(group: 'ome', name: 'bio-formats-tools', version: bfversion){}
compile(group: 'args4j', name: 'args4j', version: '2.33'){}
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.6'
// https://github.com/junit-team/junit5-samples/blob/master/junit5-migration-gradle/build.gradle
def junit4Version = '4.12'
def junitVintageVersion = '5.2.0'
def junitJupiterVersion = '5.2.0'
def junitPlatformVersion = '1.2.0'
testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
testCompile("junit:junit:${junit4Version}")
testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}")
testRuntime("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}")
// https://stackoverflow.com/questions/45462987/junit5-with-intellij-and-gradle
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion"
}
test {
useJUnitPlatform {
includeEngines 'junit-jupiter', 'junit-vintage'
}
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED'
exceptionFormat 'FULL'
showStandardStreams = true
showStackTraces = true
showExceptions = true
showCauses = true
lifecycle.exceptionFormat 'FULL'
}
afterSuite { desc, result ->
if (!desc.parent) {
println "\nTest result: ${result.resultType}"
println "Test summary: ${result.testCount} tests, " +
"${result.successfulTestCount} succeeded, " +
"${result.failedTestCount} failed, " +
"${result.skippedTestCount} skipped"
}
}
}
// https://gist.github.com/matthiasbalke/3c9ecccbea1d460ee4c3fbc5843ede4a
task deps {
doLast {
project.rootProject.allprojects.each { subProject ->
subProject.buildscript.configurations.each { configuration ->
resolveConfiguration(configuration)
}
subProject.configurations.each { configuration ->
resolveConfiguration(configuration)
}
}
}
}
void resolveConfiguration(configuration) {
if (isResolveableConfiguration(configuration)) {
configuration.resolve()
}
}
boolean isResolveableConfiguration(configuration) {
def nonResolveableConfigurations = ['apiElements', 'implementation',
'runtimeElements', 'runtimeOnly',
'testImplementation', 'testRuntimeOnly',
'generatedImplementation', 'generatedRuntimeOnly']
if (nonResolveableConfigurations.contains(configuration.getName())) {
return false
}
return true
}