-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
132 lines (105 loc) · 4.12 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
plugins {
id 'net.researchgate.release' version '2.4.0'
}
apply plugin: 'java'
apply plugin: 'maven'
def rtm_config_prop = System.getProperty('RTM_CONFIG')
String rtm_config_path = null
if (rtm_config_prop) {
rtm_config_path = file(rtm_config_prop).getCanonicalPath()
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
group = 'com.satori'
task sourceJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier 'javadoc'
from javadoc
}
artifacts {
archives javadocJar, sourceJar
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
javadoc {
options.memberLevel = JavadocMemberLevel.PUBLIC
options.JFlags = ["-Xmx512m", '-XX:MaxPermSize=256m']
options.header = docsHeader
}
tasks.withType(Test) {
testLogging.showStandardStreams = true
testLogging.exceptionFormat = 'full'
minHeapSize = "128m"
maxHeapSize = "512m"
maxParallelForks = 1
jvmArgs '-XX:MaxPermSize=256m'
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
systemProperties = [RTM_CONFIG: rtm_config_path]
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
url 'https://github.com/satori-com/satori-rtm-sdk-java'
packaging 'jar'
scm {
url 'https://github.com/satori-com/satori-rtm-sdk-java'
connection 'scm:git:git://github.com/satori-com/satori-rtm-sdk-java.git'
developerConnection 'scm:git:[email protected]:satori-com/satori-rtm-sdk-java.git'
}
licenses {
license {
name 'The BSD 3-Clause License (with patent grant)'
url 'https://raw.githubusercontent.com/satori-com/satori-rtm-sdk-java/master/LICENSE'
distribution 'repo'
}
}
developers {
developer {
id 'satorisdk'
organization = 'Satori Worldwide, Inc.'
organizationUrl 'https://www.satori.com'
roles { role 'developer' }
}
}
}
pom.whenConfigured { p ->
// Gradle could include satori-rtm-sdk-core' dependencies with 'compile' and
// 'test' scope to pom.xml. Remove one of them if we detect this case.
def numberOfCoreDeps = p.dependencies.findAll { dep ->
dep.artifactId == 'satori-rtm-sdk-core'
}
if (1 < numberOfCoreDeps.size()) {
p.dependencies.removeAll { dep ->
dep.artifactId == 'satori-rtm-sdk-core' && dep.scope == 'test'
}
}
}
}
}
}
}
release {
preTagCommitMessage = "Pre-tag commit: "
tagCommitMessage = "Creating tag: "
newVersionCommitMessage = "New version commit: "
tagTemplate = 'v${version}'
}
afterReleaseBuild.dependsOn subprojects.collect { it.tasks.findAll { it.name == 'uploadArchives' } }