-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
170 lines (139 loc) · 5.1 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
plugins {
id "com.github.hierynomus.license" version "0.16.1" apply false
}
apply plugin: 'java-library-distribution'
allprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.github.hierynomus.license'
repositories {
mavenLocal()
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
group = "org.chorusbdd"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
version = '4.0.1'
test {
doFirst {
jvmArgs = [
//Required by selenium for some mocking
'--add-opens', 'java.base/java.lang=ALL-UNNAMED'
]
}
testLogging {
// Make sure output from
// standard out or error is shown
// in Gradle output.
showStandardStreams = true
events "failed"
exceptionFormat "short"
}
}
license {
include "**/*.java"
}
jar {
manifest {
attributes(
'Built-By' : System.properties['user.name'],
'Build-Timestamp' : new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Build-Revision' : version,
'Created-By' : "Gradle ${gradle.gradleVersion}",
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}",
'Automatic-Module-Name' : "org.chorusbdd." + project.name.replaceAll("chorus-", "chorus.")
)
}
}
java {
withJavadocJar()
withSourcesJar()
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Signing and Publication to Maven Central
configure([
project(':chorus'),
project(':chorus-selenium'),
project(':chorus-spring'),
project(':chorus-websockets'),
project(':chorus-sql')]) {
println "Configuring extension... $project.name"
// http://central.sonatype.org/pages/gradle.html#releasing-the-deployment-to-the-central-repository
// Apply the plugin to allow gradle to sign jars for Sonatype Maven central distribution
// All child projects will be independently signed and released
apply plugin: 'signing'
artifacts {
archives javadocJar, sourcesJar
}
publishing {
repositories {
maven {
name = "ossrh"
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
credentials {
username = findProperty('ossrhUsername')
password = findProperty('ossrhPassword')
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = description
packaging = 'jar'
// optionally artifactId can be defined here
description = mavenDescription
url = 'http://www.chorus-bdd.org'
scm {
connection = 'scm:git:https://github.com/Chorus-bdd/Chorus'
developerConnection = 'scm:git:https://github.com/Chorus-bdd/Chorus'
url = 'http://github.com/Chorus-bdd/Chorus'
}
licenses {
license {
name = 'MIT'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'nick'
name = 'Nick Ebbutt'
email = 'admin@chorus-bdd.org'
}
}
}
}
}
}
signing {
if (signArtifactsForPublication.toBoolean()) {
sign publishing.publications.mavenJava
}
}
}
apply from: 'dependencies.gradle'
///////////////////////////////////////////////////////////////////////////////////////
// Distribution
//The dependencies from this project determine which jars get included in the
//distribution
dependencies {
afterEvaluate {
implementation project('chorus')
implementation project('chorus-spring')
implementation project('chorus-selenium')
implementation project('chorus-websockets')
implementation project('chorus-sql')
}
}
distributions {
main{
distributionBaseName = 'chorus'
}
}