Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
192 lines (169 loc) · 4.79 KB
/
Copy pathbuild.gradle
File metadata and controls
192 lines (169 loc) · 4.79 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
190
191
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'java'
id 'maven-publish'
id 'eclipse'
}
ext.concourseVersion = '0.10.5'
dependencies {
implementation platform('com.cinchapi:cinchapi-bom:1.0.0')
implementation group: 'com.cinchapi', name: 'accent4j'
implementation group: 'com.cinchapi', name: 'concourse-driver-java', version: concourseVersion, changing:true // needed for util classes...
implementation group: 'com.google.code.findbugs', name: 'jsr305', version:'2.0.1'
implementation group: 'com.google.guava', name:'guava'
testImplementation 'junit:junit'
}
ext.generateSourcesJar = true
ext.generateTestJar = true
ext.generateJavadocJar = true
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url "https://packages.cinchapi.com/public/open-source/maven/"
}
maven {
url "https://packages.cinchapi.com/public/open-source-snapshots/maven/"
}
maven {
url "https://packages.cinchapi.com/public/platform/maven/"
}
maven {
url "https://packages.cinchapi.com/public/platform-snapshots/maven/"
}
maven {
url "https://packages.cinchapi.com/public/enterprise/maven/"
credentials {
username = System.getenv('CLOUDSMITH_API_USER')
password = System.getenv('CLOUDSMITH_API_KEY')
}
}
maven {
url "https://packages.cinchapi.com/public/enterprise-snapshots/maven/"
credentials {
username = System.getenv('CLOUDSMITH_API_USER')
password = System.getenv('CLOUDSMITH_API_KEY')
}
}
}
// Ensure that these transitive dependencies are excluded so we don't get version clashes
def exclusions = [[group : 'com.google.guava', module: 'guava']]
exclusions.each { exclusion ->
configurations.implementation.dependencies.all {
if ((name != exclusion.module || group != exclusion.group)
&& (name != 'cinchapi-bom' || group != 'com.cinchapi')) {
exclude group: exclusion.group, module: exclusion.module
}
}
}
group = 'com.cinchapi'
// The project version is controlled externally by the "version.sh" script.
def getVersion = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'bash', 'version.sh'
standardOutput = stdout
}
return stdout.toString().trim()
}
// The version that a build version publishes as, also from the "version.sh"
// script, which drops only the build number and keeps the branch's name whole.
def getPublishedVersion = { buildVersion ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'bash', 'version.sh', '--published', buildVersion
standardOutput = stdout
}
return stdout.toString().trim()
}
version = getVersion()
ext.mavenVersion = getPublishedVersion(version)
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
test {
useJUnit()
testLogging {
showStandardStreams = true
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
wrapper {
gradleVersion = '8.14.3'
distributionType = Wrapper.DistributionType.ALL
}
jar {
manifest {
attributes("Specificiation-Title": project.name, "Specificiation-Version": version, "Implementation-Version": version)
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
onlyIf { generateJavadocJar }
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
onlyIf { generateSourcesJar }
}
task testJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'tests'
from sourceSets.test.output
onlyIf { generateTestJar }
}
artifacts {
if (generateSourcesJar) {
archives sourcesJar
}
if (generateTestJar) {
archives testJar
}
if (generateJavadocJar) {
archives javadocJar
}
}
publishing {
repositories {
maven {
name = 'cloudsmith'
def releasesRepoUrl = "https://api-g.cloudsmith.io/maven/cinchapi/platform/"
def snapshotsRepoUrl = "https://api-g.cloudsmith.io/maven/cinchapi/platform-snapshots/"
// Only a master build publishes a plain X.Y.Z, so every other version,
// such as a release candidate or a feature build, is a snapshot.
url = (mavenVersion ==~ /\d+\.\d+\.\d+/) ? releasesRepoUrl : snapshotsRepoUrl
credentials {
username = System.getenv('CLOUDSMITH_API_USER')
password = System.getenv('CLOUDSMITH_API_KEY')
}
}
}
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifact testJar
groupId group
artifactId project.name
version mavenVersion
}
}
}