-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
219 lines (202 loc) · 9.32 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
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds
*/
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "org.grails.plugins:hibernate5:${grailsHibernate5}"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:${assetPipeline}"
classpath "com.bertramlabs.plugins:sass-asset-pipeline:${assetPipeline}"
classpath "com.bertramlabs.plugins:less-asset-pipeline:${assetPipeline}"
}
}
ext.releaseVersion = taackReleaseVersion
ext.isReleaseVersion = { -> !releaseVersion.endsWith('SNAPSHOT') }
version releaseVersion
group "org.taack"
ext."signing.keyId" = System.getenv("SIGNING_KEY") ?: project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : null
ext."signing.password" = System.getenv("SIGNING_PASSPHRASE") ?: project.hasProperty("signing.password") ? project.getProperty('signing.password') : null
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : null
if (isReleaseVersion()) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'
nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
nexusUrl = uri('https://s01.oss.sonatype.org/service/local/')
snapshotRepositoryUrl = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
transitionCheckOptions {
maxRetries.set(40)
delayBetween.set(java.time.Duration.ofMillis(2000))
}
}
}
subprojects {
ext.isTaackUi = { -> 'taack-ui' == project.name }
ext.isTaackUiCommand = { -> 'taack-ui-commands' == project.name }
ext.isTaackJdbcCommon = { -> 'taack-jdbc-common' == project.name }
if (isTaackJdbcCommon() || isTaackUiCommand() || isTaackUi()) {
version releaseVersion
group "org.taack"
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'java'
apply plugin: 'java-library'
repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
}
publishing {
publications {
maven(MavenPublication) {
from components.java
if (isTaackJdbcCommon()) {
afterEvaluate {
artifact source: sourcesJar, classifier: "sources"
artifact source: javadocJar, classifier: "javadoc"
}
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Taack JDBC Common'
description = 'Taack JDBC Common'
url = 'http://taack.org'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
url = 'scm:[email protected]:Taack/infra.git'
connection = 'scm:[email protected]:Taack/infra.git'
developerConnection = 'scm:[email protected]:Taack/infra.git'
}
developers {
developer {
id = 'Taack'
name = 'Adrien Guichard'
email = '[email protected]'
}
}
}
} else if (isTaackUiCommand()) {
afterEvaluate {
artifact source: sourcesJar, classifier: "sources"
artifact source: javadocJar, classifier: "javadoc"
}
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Taack UI Framework Commands'
description = 'Taack UI Framework Commands'
url = 'http://taack.org'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
url = 'scm:[email protected]:Taack/infra.git'
connection = 'scm:[email protected]:Taack/infra.git'
developerConnection = 'scm:[email protected]:Taack/infra.git'
}
developers {
developer {
id = 'Taack'
name = 'Adrien Guichard'
email = '[email protected]'
}
}
}
} else {
afterEvaluate {
artifact source: sourcesJar, classifier: "sources"
artifact source: javadocJar, classifier: "javadoc"
}
pom {
name = 'Taack UI Framework'
description = 'Taack UI Framework'
url = 'http://taack.org'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
url = 'scm:[email protected]:Taack/infra.git'
connection = 'scm:[email protected]:Taack/infra.git'
developerConnection = 'scm:[email protected]:Taack/infra.git'
}
developers {
developer {
id = 'Taack'
name = 'Adrien Guichard'
email = '[email protected]'
}
}
}
}
}
}
}
if (isTaackJdbcCommon() || isTaackUiCommand()) {
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
}
if (isReleaseVersion()) {
println "isReleaseVersion() ${isReleaseVersion()}"
println "isReleaseVersion ${isReleaseVersion}"
afterEvaluate {
artifacts {
archives javadocJar, sourcesJar
}
signing {
required { isReleaseVersion() && gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion() }
}
//do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}
}
}
}