-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
266 lines (229 loc) · 5.95 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
//
// Copyright 2020 SenX S.A.S.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
//
plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'net.nemerosa.versioning' version '2.14.0'
id 'io.codearte.nexus-staging' version '0.22.0'
id 'java'
id 'java-library'
id 'idea'
id 'eclipse'
id 'maven-publish'
id 'signing'
id 'antlr'
}
project.group = 'io.warp10'
project.description = 'FLoWS WarpScript Extension'
// If the current tag is set, then it's a new release. Don't add build number
project.version = versioning.info.lastTag + ((versioning.info.tag != null) ? '' : '-' + versioning.info.build)
//
// Repositories for the project dependencies
//
repositories {
mavenCentral()
}
configurations {
provided
}
//
// Dependencies of the project
//
dependencies {
compileOnly 'io.warp10:warpscript:2.8.1'
//
// Insert your dependencies here
//
antlr 'org.antlr:antlr4:4.8'
testCompileOnly 'io.warp10:warpscript:2.8.1'
testImplementation 'junit:junit:4.12'
}
test {
useJUnit()
}
sourceSets {
main {
compileClasspath = compileClasspath + configurations.provided
}
}
eclipse.classpath.plusConfigurations += [configurations.provided] // Eclipse users only
// for IntelliJ users
idea {
module {
scopes.PROVIDED.plus += [configurations.provided]
}
}
java {
withJavadocJar()
withSourcesJar()
}
jar {
manifest {
attributes('WarpFleet-Description': project.description)
attributes('WarpFleet-Group': project.group)
attributes('WarpFleet-Artifact': project.name)
attributes('WarpFleet-Version': project.version)
}
from('src/main/warpscript') {
//
// Only consider macros which are in our namespace
//
include project.group + '/' + project.name + '/*.mc2'
include project.group + '/' + project.name + '/**/*.mc2'
}
from('.') {
include 'README.md'
include project.group + '-' + project.name + '.conf'
}
}
shadowJar {
classifier = ''
manifest {
attributes('WarpFleet-Description': project.description)
attributes('WarpFleet-Group': project.group)
attributes('WarpFleet-Artifact': project.name)
attributes('WarpFleet-Version': project.version)
}
from('src/main/warpscript') {
//
// Only consider macros which are in our namespace
//
include project.group + '/' + project.name + '/*.mc2'
include project.group + '/' + project.name + '/**/*.mc2'
}
from('.') {
include 'README.md'
include project.group + '-' + project.name + '.conf'
}
dependencies {
exclude(dependency('org.slf4j::'))
}
}
shadowJar.dependsOn(test)
//
// Maven related config
//
publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId project.name
version = project.version
from components.java
pom {
name = project.name
description = project.description
url = 'https://github.com/senx/' + project.name
scm {
connection = 'scm:git:git://github.com/senx/' + project.name
developerConnection = 'scm:git:ssh://github.com/senx/' + project.name
url = 'https://github.com/senx/' + project.name
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'senx'
name = 'SenX'
email = '[email protected]'
}
}
}
}
uberJar(MavenPublication) {
groupId project.group
artifactId project.name
artifact(shadowJar)
artifact(tasks['javadocJar'])
artifact(tasks['sourcesJar'])
version = project.version + '-uberjar'
pom {
name = project.name
description = project.description
url = 'https://github.com/senx/' + project.name
scm {
connection = 'scm:git:git://github.com/senx/' + project.name
developerConnection = 'scm:git:ssh://github.com/senx/' + project.name
url = 'https://github.com/senx/' + project.name
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'senx'
name = 'SenX'
email = '[email protected]'
}
}
}
}
}
repositories {
if (project.hasProperty('ossrhUsername')) {
maven {
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
if (project.hasProperty('nexusUsername')) {
maven {
name 'nexus'
allowInsecureProtocol true
url "$nexusHost/repository/maven-releases/"
credentials {
username nexusUsername
password nexusPassword
}
}
}
}
}
artifacts {
archives shadowJar, javadocJar, sourcesJar
}
if (project.hasProperty('ossrhUsername')) {
nexusStaging {
packageGroup = 'io.warp10'
username ossrhUsername
password ossrhPassword
}
}
//
// Artifact Signing
//
if (project.hasProperty('signing.gnupg.keyName')) {
signing {
useGpgCmd()
sign publishing.publications
}
}
generateGrammarSource {
arguments += [ '-package', 'io.warp10.ext.flows.antlr' ]
doLast {
copy {
from 'build/generated-src/antlr/main/'
include '*.*'
into 'build/generated-src/antlr/main/io/warp10/ext/flows/antlr'
}
project.delete fileTree('build/generated-src/antlr/main').include('*.*')
}
}