forked from zaproxy/community-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
85 lines (70 loc) · 1.97 KB
/
build.gradle.kts
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
plugins {
`java-library`
id("com.diffplug.gradle.spotless") version "3.14.0"
}
tasks {
"wrapper"(Wrapper::class) {
gradleVersion = "4.9"
distributionType = Wrapper.DistributionType.ALL
}
}
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.2.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.2.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.2.0")
testImplementation("org.assertj:assertj-core:3.11.0")
testImplementation("org.apache.commons:commons-lang3:3.8")
testRuntimeOnly("org.zaproxy:zap:2.7.0")
testImplementation("org.codehaus.groovy:groovy-all:2.4.14")
testImplementation("org.jruby:jruby-complete:1.7.4")
testImplementation("org.python:jython-standalone:2.7.1")
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.compilerArgs = listOf("-Xlint:all", "-Xlint:-options", "-Werror")
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
var scriptTypes = listOf(
"active",
"authentication",
"extender",
"httpfuzzerprocessor",
"httpsender",
"passive",
"payloadgenerator",
"payloadprocessor",
"proxy",
"sequence",
"standalone",
"targeted",
"variant",
"websocketfuzzerprocessor")
val scriptsDir = layout.buildDirectory.dir("scripts")
val syncScriptsDirTask by tasks.creating(Sync::class) {
into(scriptsDir.get().dir(project.name))
scriptTypes.forEach {
from(it) {
into(it)
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceSets {
"main" {
output.dir(mapOf("builtBy" to syncScriptsDirTask), scriptsDir)
}
}
}
spotless {
java {
licenseHeaderFile("$rootDir/gradle/spotless/license.java")
googleJavaFormat().aosp()
}
}