-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
61 lines (48 loc) · 1.16 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
apply plugin: 'java'
sourceSets {
main {
java {
srcDir 'src'
}
}
test {
java {
srcDir 'test'
}
}
}
configurations {
releaseJars
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.code.gson:gson:2.3.1'
testCompile 'junit:junit:4.11'
releaseJars 'com.google.code.gson:gson:2.3.1'
}
task init(dependsOn: [ 'cleanup']) {
mkdir "${buildDir}/jars"
mkdir stagingDir
}
task cleanup {
delete "${buildDir}"
delete stagingDir
}
task copyReleaseJars(type: Copy, dependsOn: 'init') {
into "${buildDir}/jars"
from configurations.releaseJars
}
jar.archiveName 'ScooterUserGenerator.jar'
jar.manifest {
attributes 'Main-Class' : 'Generator'
attributes 'Class-Path' : 'jars/gson-2.3.1.jar '
}
task scooterBuild(dependsOn: ['test', 'copyReleaseJars', 'jar']) << {
ant.zip(destfile: "${buildDir}/ScooterUserGenerator.zip") {
zipfileset(dir: "${buildDir}/jars", prefix: "jars")
zipfileset(file: "${buildDir}/libs/ScooterUserGenerator.jar")
}
ant.unzip(src: "${buildDir}/ScooterUserGenerator.zip", dest: project.stagingDir)
}