This repository has been archived by the owner on Nov 13, 2019. It is now read-only.
forked from frohoff/ysoserial
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
59 lines (50 loc) · 1.79 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
group 'ysoserial'
version '1.0-SNAPSHOT'
dependencies {
compile group: 'org.xeustechnologies', name: 'jcl-core', version: '2.7'
compile project(':ysoserial-core')
}
task copyLibs << {
//Regroup the jar need for each gadget in separated folders
rootProject.subprojects.each { subProject ->
if(subProject.name.startsWith("gadget-")) { //Export dependencies of gadget only
println("Copying libraries for the subproject "+subProject.name);
copy { //Dependencies minus the common ones
into "$buildDir/output/"+subProject.name
from subProject.configurations.compile - project(":ysoserial-cli").configurations.compile
}
copy { //Add the project itself (gadget code generation)
into "$buildDir/output/"+subProject.name
from subProject.jar.archivePath
}
}
}
//Common dependencies (unrelated to gadget code)
copy {
into "$buildDir/output/libs"
from configurations.compile
}
//JCL is merged in the final jar
copy {
from(zipTree("$buildDir/output/libs/jcl-core-2.7.jar"))
into("$buildDir/output/jcl-classes")
}
}
task createJar(dependsOn:[jar, copyLibs],type:Jar) {
manifest {
attributes(
"Implementation-Title": 'ysoserial',
"Implementation-Version": version,
"Main-Class": 'ysoserial.BootstrapMain'
)
}
classifier 'all'
destinationDir new File("$buildDir")
//Source code of the CLI
from sourceSets.main.output
//JCL library merged to the main jar
from "$buildDir/output/jcl-classes"
//Trigger the task createJar automatically when building ysoserial-cli
createJar.dependsOn assemble
build.dependsOn createJar
}