-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
build.gradle
166 lines (139 loc) · 4.66 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
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
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_11
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
group 'org.zaproxy'
version '0.23.0-SNAPSHOT'
application {
mainClass.set("org.zaproxy.zest.impl.CmdLine")
}
sourceSets.test.resources.srcDirs 'examples'
dependencies {
implementation (
'org.apache.httpcomponents:httpclient:4.5.8',
'com.google.code.gson:gson:2.8.5',
'org.seleniumhq.selenium:selenium-java:4.26.0',
'org.seleniumhq.selenium:htmlunit3-driver:4.26.0',
'net.htmlparser.jericho:jericho-html:3.1',
'com.fasterxml.jackson.core:jackson-core:2.15.2',
'com.fasterxml.jackson.core:jackson-databind:2.15.2',
'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.2')
testImplementation("org.wiremock:wiremock:3.6.0")
testImplementation('org.mockito:mockito-core:5.12.0')
testImplementation("org.assertj:assertj-core:3.26.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
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/javase/11/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("1.17.0").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://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/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 = '[email protected]'
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 = '[email protected]'
}
}
}
}
}
}
signing {
if (project.hasProperty('signing.keyId')) {
sign publishing.publications.zest
}
}