-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
112 lines (96 loc) · 2.32 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
107
108
109
110
111
112
apply plugin: 'java'
version = '0.1.0'
jar {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
baseName = 'JBasicX'
version = "${version}"
manifest {
attributes("Implementation-Title": "JBasicX",
"Implementation-Version": version)
}
}
sourceSets {
main {
java {
srcDir 'src'
exclude 'JTestsX/**'
}
resources {
srcDir 'src'
}
}
test {
java {
srcDir 'src'
}
resources {
srcDir 'src'
}
}
}
repositories {
mavenCentral()
}
dependencies {
test {
compile group: 'junit', name: 'junit', version: '4.11'
}
}
test {
testLogging {
events 'started', 'passed', 'failed'
}
afterTest {
copy {
from "${projectDir}/build/classes/test/Output"
into "${projectDir}/build/test-results/output-screen"
}
}
}
task cleanPreTest << {
delete fileTree(dir: "${projectDir}/build/classes/test/Output", include: "*.png")
delete fileTree(dir: "${projectDir}/test-results/output-screen", include: "*.png")
}
test.dependsOn(cleanPreTest)
task dist {
description "Generate the dist(s) into the dist folder."
}
task distSetup {
description "Generate the dist folder."
delete "${projectDir}/dist"
copy {
from "${buildDir}/libs"
into "${projectDir}/dist/main"
}
copy {
from "${projectDir}/build/classes/test/Output"
into "${projectDir}/dist/test"
}
}
task zipDist(type: Zip, dependsOn: distSetup) {
from "${projectDir}/dist/main"
from "${projectDir}/Readme.md"
destinationDir = file("${projectDir}/dist")
version = "${version}"
appendix = "Main"
doLast {
println "Created ${zipDist.archiveName}"
}
}
task zipTest(type: Zip, dependsOn: distSetup) {
from "${projectDir}/dist/test"
from "${projectDir}/Readme.md"
destinationDir = file("${projectDir}/dist")
version = "${version}"
appendix = "Test Output"
doLast{
println "Created ${zipTest.archiveName}"
}
}
distSetup.dependsOn(build)
dist.dependsOn(zipDist)
dist.dependsOn(zipTest)
task wrapper(type: Wrapper) {
description "Generates the Gradle wrapper for the project."
gradleVersion = '2.2.1'
}