-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
190 lines (168 loc) · 5.05 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
plugins {
id 'java'
id 'eclipse'
id 'maven'
id 'maven-publish'
id 'signing'
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
// 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()
}
group = 'com.cinchapi'
version = getVersion()
// Drop the build component from version number and use that for
// publishing
ext.mavenVersion = version.split('\\.')
ext.mavenVersion[3] = ext.mavenVersion[3].replaceAll("[0-9]+-", "-")
ext.mavenVersion[3] = ext.mavenVersion[3].replaceAll("[0-9]+", "").trim()
ext.mavenVersion = ext.mavenVersion.join(".").replace(".-", "-").replaceAll('\\.$', "")
jar {
manifest {
attributes("Specificiation-Title": "CCL", "Specificiation-Version": version, "Implementation-Version": version)
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
repositories {
maven {
name = 'cloudsmith'
def releasesRepoUrl = "https://api-g.cloudsmith.io/maven/cinchapi/open-source/"
def snapshotsRepoUrl = "https://api-g.cloudsmith.io/maven/cinchapi/open-source-snapshots/"
url = mavenVersion.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv('CLOUDSMITH_API_USER')
password = System.getenv('CLOUDSMITH_API_KEY')
}
}
}
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId group
artifactId project.name
version mavenVersion
}
}
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.version = mavenVersion
pom.project {
name project.name
packaging 'jar'
description 'The official specificiation and library for the Concourse Criteria Language'
url 'https://cinchapi.com'
scm {
url 'git@github.com:cinchapi/ccl.git'
connection 'git@github.com:cinchapi/ccl.git'
developerConnection 'git@github.com:cinchapi/ccl.git'
}
licenses {
license {
name 'The Apache License'
url 'http://opensource.org/licenses/Apache-2.0'
distribution 'repo'
}
}
developers {
developer {
id 'jnelson'
name 'Jeff Nelson'
}
}
}
def mavenUrl = pom.version.matches('^[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+){0,1}$') ? 'https://oss.sonatype.org/service/local/staging/deploy/maven2' : 'https://oss.sonatype.org/content/repositories/snapshots'
repository(url: mavenUrl) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
}
}
}
test {
testLogging {
showStandardStreams = true
}
}
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url "https://dl.cloudsmith.io/public/cinchapi/open-source/maven/"
}
maven {
url "https://dl.cloudsmith.io/public/cinchapi/open-source-snapshots/maven/"
}
maven {
url "https://dl.cloudsmith.io/public/cinchapi/platform/maven/"
}
maven {
url "https://dl.cloudsmith.io/public/cinchapi/platform-snapshots/maven/"
}
maven {
url "https://dl.cloudsmith.io/public/cinchapi/enterprise/maven/"
credentials {
username = System.getenv('CLOUDSMITH_API_USER')
password = System.getenv('CLOUDSMITH_API_KEY')
}
}
maven {
url "https://dl.cloudsmith.io/public/cinchapi/enterprise-snapshots/maven/"
credentials {
username = System.getenv('CLOUDSMITH_API_USER')
password = System.getenv('CLOUDSMITH_API_KEY')
}
}
}
ext.concourseVersion = '0.12.0-SNAPSHOT'
dependencies {
compile 'com.google.code.findbugs:jsr305:2.0.1'
compile 'com.google.guava:guava:25.1-jre'
compile 'com.joestelmach:natty:0.13'
compile (group: 'com.cinchapi', name: 'accent4j', version: '1.6.1', changing:true) {
exclude group: 'com.google.guava', module: 'guava'
}
compile 'joda-time:joda-time:2.2'
testCompile 'junit:junit:4.11'
testCompile (group: 'com.cinchapi', name: 'concourse-driver-java', version: concourseVersion) {
exclude group: 'com.cinchapi', module: 'ccl'
}
}
task generateJavaCCParser(type: Exec) {
commandLine './javacc-parser-generator.sh', 'generate', '--source', 'grammar/grammar.jjt', '--out', 'src/main/java/com/cinchapi/ccl/generated'
}
compileJava.dependsOn generateJavaCCParser
eclipseClasspath.dependsOn generateJavaCCParser