This repository has been archived by the owner on Jan 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.gradle
198 lines (156 loc) · 5.05 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
plugins {
id 'net.researchgate.release' version '2.3.4'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.11'
}
allprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'eclipse'
apply plugin: 'idea'
// UTF-8 should be standard by now. So use it!
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceCompatibility = 1.7
targetCompatibility = 1.7
group = 'com.squarespace.jersey2-guice'
repositories {
mavenCentral()
mavenLocal()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
configurations {
provided
}
}
subprojects {
project.ext {
guiceVersion = '4.0'
jerseyVersion = '2.22.2'
hk2Version = '2.4.0-b34'
}
// Telling Eclipse about the provided scope
eclipse.classpath.plusConfigurations += [configurations.provided]
// Telling IDEA about the provided scope
idea {
module {
scopes.PROVIDED.plus += [configurations.provided]
}
}
sourceSets {
main {
compileClasspath += configurations.provided
}
test {
compileClasspath += configurations.provided
runtimeClasspath += configurations.provided
}
}
task integrationTest(type: Test) {
useTestNG()
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
include '**/*IT.*'
exclude '**/*Test.*'
// fork a new java process every 10 test classes
forkEvery = 10
}
test {
useTestNG()
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
exclude '**/*IT.*'
include '**/*Test.*'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
javadoc {
classpath += [configurations.provided]
options.links('http://docs.oracle.com/javase/7/docs/api/',
'http://docs.oracle.com/javaee/7/api/',
'http://google-guice.googlecode.com/git/javadoc/',
'https://hk2.java.net/2.4.0-b32/apidocs/')
}
signing {
required { gradle.taskGraph.hasTask('uploadArchives') }
sign configurations.archives
}
task uploadSquarespace(type: Upload) {
configuration = configurations.archives
repositories {
mavenDeployer {
if (project.hasProperty('RELEASE_REPOSITORY_URL')
&& project.hasProperty('SNAPSHOT_REPOSITORY_URL')) {
repository(url: RELEASE_REPOSITORY_URL)
snapshotRepository(url: SNAPSHOT_REPOSITORY_URL)
} else {
logger.error("RELEASE_REPOSITORY_URL and/or SNAPSHOT_REPOSITORY_URL missing.")
}
}
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// NOTE: The 'MAVEN_CENTRAL_USERNAME' and 'MAVEN_CENTRAL_PASSWORD' are
// stored in the ~/.gradle/gradle.properties file.
if (project.hasProperty('MAVEN_CENTRAL_USERNAME')
&& project.hasProperty('MAVEN_CENTRAL_PASSWORD')) {
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: MAVEN_CENTRAL_USERNAME, password: MAVEN_CENTRAL_PASSWORD)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: MAVEN_CENTRAL_USERNAME, password: MAVEN_CENTRAL_PASSWORD)
}
} else {
logger.error("MAVEN_CENTRAL_USERNAME and/or MAVEN_CENTRAL_PASSWORD missing.")
}
pom.project {
name 'Jersey 2.0 w/ Guice'
packaging 'jar'
description 'This library adds support for Jersey 2.0 w/ Guice'
url 'https://github.com/Squarespace/jersey2-guice'
scm {
connection 'scm:git:https://github.com/Squarespace/jersey2-guice.git'
developerConnection 'scm:git:https://github.com/Squarespace/jersey2-guice.git'
url 'https://github.com/Squarespace/jersey2-guice'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'Squarespace, Inc.'
url 'http://www.squarespace.com'
}
}
}
}
}
}
}
dependencies {
compile project(':jersey2-guice-spi')
compile project(':jersey2-guice-impl')
}
release {
failOnSnapshotDependencies = false
}
createReleaseTag.dependsOn ':jersey2-guice-spi:uploadArchives', ':jersey2-guice-spi:uploadSquarespace', ':jersey2-guice-impl:uploadArchives', ':jersey2-guice-impl:uploadSquarespace'