-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
101 lines (82 loc) · 2.62 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
archivesBaseName = "hamcrest-junit"
group = "org.hamcrest"
version = hasProperty("-version") ? property("-version") : "SNAPSHOT"
def junit = System.getenv("junit") ?: 'junit:junit:4.12'
def hamcrest = System.getenv("hamcrest") ?: 'org.hamcrest:java-hamcrest:2.0.0.0'
sourceCompatibility = "1.7"
repositories {
mavenCentral()
}
dependencies {
compile (junit) { transitive = false }
compile (hamcrest) { transitive = false }
}
test {
filter {
includeTestsMatching "*Test"
}
}
jar {
manifest {
attributes 'Implementation-Title': 'hamcrest-junit',
'Implementation-Vendor': 'hamcrest.org',
'Implementation-Version': version
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives jar, sourcesJar, javadocJar
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
String publishUsername = hasProperty("ossrhUsername") ? property("ossrhUsername") : ""
String publishPassword = hasProperty("ossrhPassword") ? property("ossrhPassword") : ""
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: publishUsername, password: publishPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: publishUsername, password: publishPassword)
}
pom.project {
name 'Hamcrest JUnit'
packaging 'jar'
description 'Classes to use Hamcrest matchers within JUnit tests'
url 'https://github.com/hamcrest/hamcrest-junit'
scm {
connection '[email protected]:hamcrest/hamcrest-junit.git'
url 'https://github.com/hamcrest/hamcrest-junit'
}
licenses {
license {
name 'Eclipse Public License - v 1.0'
url 'http://opensource.org/licenses/EPL-1.0'
}
}
developers {
developer {
id 'npryce'
name 'Nat Pryce'
}
developer {
id 'sf105'
name 'Steve Freeman'
}
}
}
}
}