-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathbuild.gradle
More file actions
169 lines (142 loc) · 4.63 KB
/
Copy pathbuild.gradle
File metadata and controls
169 lines (142 loc) · 4.63 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'application'
id 'jacoco'
id "com.diffplug.spotless"
id "org.zaproxy.common"
}
apply from: "$rootDir/gradle/ci.gradle.kts"
java {
def javaVersion = JavaVersion.VERSION_17
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
group = 'org.zaproxy'
version = '0.37.0-SNAPSHOT'
application {
mainClass.set("org.zaproxy.zest.impl.CmdLine")
}
sourceSets.test.resources.srcDirs 'examples'
dependencies {
implementation libs.classgraph
implementation libs.httpcomponents
implementation platform(libs.jackson.bom)
implementation libs.jackson.annotations
implementation libs.jackson.core
implementation libs.jackson.databind
implementation libs.jackson.dataformat.yaml
implementation libs.jericho
implementation libs.selenium.htmlunit3Driver
implementation libs.selenium.java
testImplementation libs.assertj.core
testImplementation libs.mockito.core
testImplementation libs.nanohttpdWebserver
testImplementation libs.graalvm.js
testImplementation libs.graalvm.js.scriptengine
testImplementation libs.junit.jupiter
testRuntimeOnly libs.junit.platformLauncher
}
jar {
manifest {
attributes('Implementation-Version': archiveVersion.get(),
'Main-Class': application.mainClass.get())
}
}
test {
useJUnitPlatform()
}
tasks.withType(JavaCompile) {
if (JavaVersion.current().getMajorVersion() >= "21") {
options.compilerArgs = options.compilerArgs + "-Xlint:-this-escape"
}
}
tasks.withType(Javadoc) {
options {
links = [ "https://docs.oracle.com/en/java/javase/17/docs/api/" ]
encoding = 'UTF-8'
source = java.sourceCompatibility
}
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
spotless {
java {
clearSteps()
licenseHeaderFile "$projectDir/gradle/spotless/license.java"
googleJavaFormat(libs.versions.googleJavaFormat.get()).aosp()
}
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier.set("javadoc")
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier.set("sources")
}
publishing {
repositories {
maven {
def releasesRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
publications {
zest(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'ZAP Zest'
packaging = 'jar'
description = 'Zest is an experimental scripting language (initially) developed by the Mozilla security team designed to be used in web oriented security tools.'
url = 'https://github.com/zaproxy/zest'
organization {
name = 'ZAP'
url = 'https://www.zaproxy.org/'
}
mailingLists {
mailingList {
name = 'ZAP Zest Group'
post = 'zaproxy-zest@googlegroups.com'
archive = 'https://groups.google.com/group/zaproxy-zest'
}
}
scm {
url = 'https://github.com/zaproxy/zest'
connection = 'scm:git:https://github.com/zaproxy/zest.git'
developerConnection = 'scm:git:https://github.com/zaproxy/zest.git'
}
licenses {
license {
name = 'Mozilla Public License Version 2.0'
url = 'https://mozilla.org/MPL/2.0/'
distribution = 'repo'
}
}
developers {
developer {
id = 'psiinon'
name = 'Simon Bennetts'
email = 'psiinon@gmail.com'
}
}
}
}
}
}
signing {
if (project.hasProperty('signing.keyId')) {
sign publishing.publications.zest
}
}