forked from vmware/burp-rest-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
118 lines (96 loc) · 2.93 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
113
114
115
116
117
118
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
final def extensionName = 'burp-rest-api'
version = '1.0.3'
def updateVersion() {
def configFile = new File('src/main/resources/application.yml')
println "Updating version to '${version}' in ${configFile}"
String configContent = configFile.getText('UTF-8')
configContent = configContent.replaceAll(/build\.version: .*/, "build.version: ${version}")
configFile.write(configContent, 'UTF-8')
}
allprojects {
//Display warning
println " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
println " !! Make sure that no other Burp instances are running !!"
println " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
//Update version in application file
updateVersion()
}
jar {
baseName = extensionName
manifest {
attributes 'Implementation-Title': 'Burp REST API',
'Implementation-Version': version
}
}
repositories {
mavenCentral()
flatDir {
dirs 'lib'
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
File schemaTargetDir = new File('build/generated-schema')
configurations {
jaxb
compile.exclude module: "spring-boot-starter-tomcat"
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile("org.springframework.boot:spring-boot-starter-jetty")
compile fileTree(dir: 'lib', include: '**/*.jar')
compile "io.springfox:springfox-swagger2:2.+"
compile "io.springfox:springfox-swagger-ui:2.+"
compile name: 'burpsuite_pro'
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('org.apache.httpcomponents:httpclient:4.5.2')
jaxb 'org.glassfish.jaxb:jaxb-jxc:2.+'
jaxb 'org.glassfish.jaxb:jaxb-xjc:2.+'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
}
task createschemaTargetDir () {
schemaTargetDir.mkdirs()
}
bootRun {
// support passing -Dsystem.property=value to bootRun task
systemProperties = System.properties
if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-Xdebug',
'-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'
}
}
task extractApi(type: Copy) {
from(zipTree('build/libs/' + extensionName + '-' + version + '.jar'))
into 'build/libs'
}
task schemagen () {
doLast {
ant.taskdef(name: 'schemagen', classname: 'com.sun.tools.jxc.SchemaGenTask', classpath: configurations.jaxb.asPath)
ant.schemagen(
srcdir:'src/main/java/com/vmware/burp/extension/domain',
destdir:schemaTargetDir,
includeAntRuntime:'false'
){
classpath {
fileset(dir: 'build/libs', includes: '**/*.jar')
}
}
}
}
compileJava.dependsOn createschemaTargetDir
schemagen.dependsOn extractApi