-
Notifications
You must be signed in to change notification settings - Fork 384
Expand file tree
/
Copy pathbuild.gradle
More file actions
189 lines (164 loc) · 6.29 KB
/
build.gradle
File metadata and controls
189 lines (164 loc) · 6.29 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
apply plugin: 'signing'
apply plugin: 'osgi'
apply plugin: 'maven-publish'
group = "org.hamcrest"
version = "2.3-SNAPSHOT"
subprojects {
apply plugin: 'checkstyle'
apply plugin: 'java-library'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
group = rootProject.group
version = rootProject.version
repositories {
mavenCentral()
}
checkstyle {
project.ext.checkstyleVersion = '6.18'
//works with a JDK 7 version which is supposed to be supported although
//deprecated, see https://github.com/hamcrest/JavaHamcrest/pull/211 for
//the discussion about the support
sourceSets = [ project.sourceSets.main, project.sourceSets.test ]
ignoreFailures = false
configFile = file("${project.rootDir}/checkstyle.xml")
configurations {
checkstyle
}
dependencies{
assert project.hasProperty("checkstyleVersion")
checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}"
}
}
test {
testLogging {
exceptionFormat = 'full'
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
}
def pomConfigurationFor(String pomName, String pomDescription) {
return {
name = pomName
description = pomDescription
url = 'http://hamcrest.org/JavaHamcrest/'
scm {
connection = 'scm:git:git://github.com:hamcrest/JavaHamcrest.git'
developerConnection = 'scm:git:ssh://github.com:hamcrest/JavaHamcrest.git'
url = 'https://github.com/hamcrest/JavaHamcrest'
}
licenses {
license {
name = 'BSD License 3'
url = 'http://opensource.org/licenses/BSD-3-Clause'
}
}
developers {
developer {
id = 'joewalnes'
name = 'Joe Walnes'
}
developer {
id = 'npryce'
name = 'Nat Pryce'
}
developer {
id = 'sf105'
name = 'Steve Freeman'
}
}
}
}
def publishToOssrh = project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')
publishing {
publications {
def hamcrestProject = project(':hamcrest')
hamcrest(MavenPublication) {
from hamcrestProject.components.java
artifactId hamcrestProject.name
artifact hamcrestProject.sourcesJar
artifact hamcrestProject.javadocJar
pom pomConfigurationFor(
'Hamcrest',
'Core API and libraries of hamcrest matcher framework.')
}
def hamcrestCoreProject = project(':hamcrest-core')
hamcrestCore(MavenPublication) {
from hamcrestCoreProject.components.java
artifactId hamcrestCoreProject.name
artifact hamcrestCoreProject.sourcesJar
artifact hamcrestCoreProject.javadocJar
pom pomConfigurationFor(
'Hamcrest Core',
'Core Hamcrest API - deprecated, please use "hamcrest" instead')
}
def hamcrestLibraryProject = project(':hamcrest-library')
hamcrestLibrary(MavenPublication) {
from hamcrestLibraryProject.components.java
artifactId hamcrestLibraryProject.name
artifact hamcrestLibraryProject.sourcesJar
artifact hamcrestLibraryProject.javadocJar
pom pomConfigurationFor(
'Hamcrest Library',
'A library of Hamcrest matchers - deprecated, please use "hamcrest" instead')
}
def hamcrestJUnit5TestsProject = project(':hamcrest-junit5-tests')
hamcrestJUnit5Tests(MavenPublication) {
from hamcrestJUnit5TestsProject.components.java
artifactId hamcrestJUnit5TestsProject.name
artifact hamcrestJUnit5TestsProject.sourcesJar
artifact hamcrestJUnit5TestsProject.javadocJar
pom pomConfigurationFor(
'Hamcrest JUnit 5 Tests',
'A test suite for Hamcrest assumptions using JUnit 5')
}
def hamcrestJUnit4TestsProject = project(':hamcrest-junit4-tests')
hamcrestJUnit4Tests(MavenPublication) {
from hamcrestJUnit4TestsProject.components.java
artifactId hamcrestJUnit4TestsProject.name
artifact hamcrestJUnit4TestsProject.sourcesJar
artifact hamcrestJUnit4TestsProject.javadocJar
pom pomConfigurationFor(
'Hamcrest JUnit4 Tests',
'A test suite for Hamcrest assumptions using JUnit 4')
}
def hamcrestJUnit4JUnit5TestsProject = project(':hamcrest-junit4-junit5-tests')
hamcrestJUnit4JUnit5Tests(MavenPublication) {
from hamcrestJUnit4JUnit5TestsProject.components.java
artifactId hamcrestJUnit4JUnit5TestsProject.name
artifact hamcrestJUnit4JUnit5TestsProject.sourcesJar
artifact hamcrestJUnit4JUnit5TestsProject.javadocJar
pom pomConfigurationFor(
'Hamcrest Hybrid JUnit 4/JUnit 5 Tests',
'A test suite for Hamcrest assumptions using hybrid JUnit 4/JUnit 5')
}
}
repositories {
if (publishToOssrh) {
maven {
def snapshotRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
def stagingRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
url = version.contains('SNAPSHOT') ? snapshotRepoUrl : stagingRepoUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
}
signing {
required { publishToOssrh }
sign publishing.publications.hamcrest
sign publishing.publications.hamcrestCore
sign publishing.publications.hamcrestLibrary
sign publishing.publications.hamcrestJUnit5Tests
sign publishing.publications.hamcrestJUnit4Tests
sign publishing.publications.hamcrestJUnit4JUnit5Tests
}