forked from zaproxy/zest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
175 lines (146 loc) · 4.87 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
167
168
169
170
171
172
173
174
175
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'application'
id "com.diffplug.gradle.spotless" version "3.13.0"
}
if (JavaVersion.current() <= JavaVersion.VERSION_1_10) {
// XXX Not yet supported on Java 11
// https://github.com/jacoco/jacoco/issues/663
apply plugin: 'jacoco'
}
wrapper {
gradleVersion = '4.8.1'
distributionType = Wrapper.DistributionType.ALL
}
repositories {
mavenLocal()
mavenCentral()
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group 'org.mozilla'
version '0.14.0-SNAPSHOT'
mainClassName = 'org.mozilla.zest.impl.CmdLine'
sourceSets.test.resources.srcDirs 'examples'
dependencies {
// XXX Change to implementation at some point, currently exposed through `ZestRequest.addCookie` and `getCookies()`.
api 'commons-httpclient:commons-httpclient:3.1'
implementation (
'com.google.code.gson:gson:2.8.5',
'com.opera:operadriver:1.5',
'com.codeborne:phantomjsdriver:1.4.3',
'org.seleniumhq.selenium:selenium-server:3.13.0',
'net.htmlparser.jericho:jericho-html:3.1')
implementation('com.machinepublishers:jbrowserdriver:1.0.0-RC1') {
exclude group: 'org.seleniumhq.selenium'
}
testImplementation('junit:junit:4.11',
'com.github.tomakehurst:wiremock-standalone:2.14.0',
'org.mockito:mockito-core:2.19.1')
testImplementation("org.assertj:assertj-core:3.11.0")
}
jar {
manifest {
attributes('Implementation-Version': version,
'Main-Class': mainClassName)
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs = [
// Enable all warnings,
'-Xlint:all',
// but allow to compile with newer Java versions.
'-Xlint:-options',
// Be strict, treat warnings as errors.
'-Werror'
]
}
tasks.withType(Javadoc) {
options {
links = [ 'https://docs.oracle.com/javase/8/docs/api/' ]
encoding = 'UTF-8'
}
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
spotless {
java {
licenseHeaderFile "$projectDir/gradle/spotless/license.java"
googleJavaFormat().style('AOSP')
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier "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 = 'Mozilla Zest'
packaging = 'jar'
description = 'Zest is an experimental scripting language developed by the Mozilla security team designed to be used in web oriented security tools.'
url = 'https://github.com/mozilla/zest'
organization {
name = 'Mozilla Foundation'
url = 'https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Zest'
}
mailingLists {
mailingList {
name = 'Mozilla Zest'
post = '[email protected]'
archive = 'https://groups.google.com/group/mozilla-zest'
}
}
scm {
url = 'https://github.com/mozilla/zest'
connection = 'scm:git:https://github.com/mozilla/zest.git'
developerConnection = 'scm:git:https://github.com/mozilla/zest.git'
}
licenses {
license {
name = 'Mozilla Public License Version 2.0'
url = 'http://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
}
}