forked from michelgrootjans/playing_with_projections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
81 lines (68 loc) · 2.18 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
apply plugin: 'java'
jar {
baseName = 'ddd-workshop'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
task wrapper(type: Wrapper) {
gradleVersion = '4.10.2'
}
ext.libs = "$projectDir/libs"
ext.compileLib = "${libs}/compile"
ext.runtimeLib = "${libs}/runtime"
ext.testCompileLib = "${libs}/testCompile"
ext.testRuntimeLib = "${libs}/testRuntime"
ext.providedCompileLib = "${libs}/providedCompile"
dependencies {
if (gradle.startParameter.isOffline()) {
println "--------------------"
println "Using local libs"
println "--------------------"
compile fileTree(dir: compileLib)
runtime fileTree(dir: runtimeLib)
testCompile fileTree(dir: testCompileLib)
testRuntime fileTree(dir: testRuntimeLib)
} else {
println "-------------------------------"
println "Using Maven central for libs"
println "-------------------------------"
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.7")
testCompile('junit:junit:4.12')
testCompile 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
testCompile 'org.junit.vintage:junit-vintage-engine:5.3.1'
testCompile 'org.junit.platform:junit-platform-launcher:1.3.1'
testCompile 'org.junit.platform:junit-platform-runner:1.3.1'
testCompile 'org.assertj:assertj-core:3.11.1'
testCompile 'org.mockito:mockito-all:1.10.19'
}
}
task deleteLibs(type: Delete) {
delete 'libs/compile'
delete 'libs/runtime'
delete 'libs/testCompile'
delete 'libs/testRuntime'
}
task copyToLibs(dependsOn: 'deleteLibs') << {
['compile', 'runtime', 'testCompile', 'testRuntime'].each {scope ->
copy {
from configurations.getByName(scope).files
into "${libs}/${scope}"
}
}
}
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Playing with projections',
'Implementation-Version': jar.version,
'Main-Class': 'be.playing.with.projections.Main'
}
baseName = jar.baseName + '-' + jar.version + '-all'
from {configurations.compile.collect {it.isDirectory() ? it : zipTree(it)}}
with jar
}
tasks.jar.dependsOn fatJar