-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
225 lines (197 loc) · 5.46 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
/*
* Copyright 2024 Broadcom. All rights reserved.
*/
plugins {
id 'java-library'
id 'distribution'
id 'maven-publish'
id 'org.jreleaser' version '1.17.0'
}
// COMPILE THINGS ////////////////////////////////////////////
import groovy.xml.*
import org.gradle.util.VersionNumber
targetCompatibility = '1.8'
group 'dev.gemfire'
version '0.1.5'
ext {
gemfireVersion = '10.1.1'
}
repositories {
mavenCentral()
maven {
name = 'Broadcom Repository'
url = project.findProperty("commercialRepository") ?: "https://packages.broadcom.com/artifactory/gemfire"
credentials {
username = System.getenv("COMMERCIAL_MAVEN_USERNAME")
password = System.getenv("COMMERCIAL_MAVEN_PASSWORD")
}
}
}
java {
withSourcesJar()
withJavadocJar()
}
test {
useJUnit()
testLogging {
lifecycle {
events("passed", "skipped", "failed")
exceptionFormat = "full"
}
}
}
configurations {
distribution
implementation.extendsFrom(distribution)
}
dependencies {
api("com.vmware.gemfire:gemfire-core:${gemfireVersion}")
implementation("com.vmware.gemfire:gemfire-membership:${gemfireVersion}")
implementation("com.vmware.gemfire:gemfire-logging:${gemfireVersion}")
implementation("com.vmware.gemfire:gemfire-log4j:${gemfireVersion}")
distribution('org.apache.commons:commons-collections4:4.4')
testImplementation('org.assertj:assertj-core:3.24.2')
testImplementation("com.vmware.gemfire:gemfire-junit:${gemfireVersion}")
testImplementation("com.vmware.gemfire:gemfire-dunit:${gemfireVersion}")
}
final jbossModuleName = "${project.group}.${project.name}:${VersionNumber.parse(project.version).major}"
tasks.register("generateModuleXml") { task ->
final file = file(task.temporaryDir.toPath().resolve("module.xml"))
doLast {
file.withWriter { writer ->
def xml = new MarkupBuilder(new IndentPrinter(writer, " ", true))
xml.doubleQuotes = true
xml.mkp.xmlDeclaration(version: '1.0', encoding: 'utf-8')
xml.module(xmlns: 'urn:jboss:module:1.9', 'name': jbossModuleName) {
resources {
'resource-root'('path': tasks.named('jar').get().outputs.files.singleFile.name)
configurations.distribution.files.forEach() { dep ->
'resource-root'('path': dep.name)
}
}
delegate.dependencies {
module('name': 'java.se', 'export': 'false', 'optional': 'false', 'services': 'import')
module('name': 'gemfire', 'export': 'false', 'optional': 'false', 'services': 'import')
}
}
}
}
outputs.file(file)
}
// BUNDLING THINGS ////////////////////////////////
distributions {
extension {
distributionBaseName = distributionPrefix
contents {
with copySpec {
into(jbossModuleName.replaceAll('[.:]', '/'))
from(jar)
from(configurations.distribution)
from(generateModuleXml)
}
with copySpec {
from('src/main/dist')
}
}
}
}
// RELEASE THINGS ////////////////////////////////
jreleaser {
project {
description = 'GemFire Distributed Types'
copyright = 'Copyright 2024 Broadcom. All rights reserved.'
website = 'must not be blank'
docsUrl = 'must not be blank'
license = 'must not be blank'
authors = ['must not be blank']
}
signing {
active = 'ALWAYS'
armored = true
verify = false
mode = 'COMMAND'
}
deploy {
maven {
mavenCentral {
sonatype {
active = 'ALWAYS'
url = 'https://central.sonatype.com/api/v1/publisher'
stagingRepository('build/staging-deploy')
applyMavenCentralRules = true
stage = 'UPLOAD'
}
}
}
}
distributions {
extension {
distributionType = 'BINARY'
artifact {
path = "build/distributions/gemfire-distributed-types-{{projectVersion}}.gfm"
}
}
}
release {
github {
repoOwner = 'gemfire'
name = 'gemfire-distributed-types'
draft = true
skipTag = false
}
}
}
publishing {
publications {
maven(MavenPublication) {
pom {
name = "${project.group}:${project.name}"
description = 'A collection of distributed types for use wih GemFire'
url = 'https://github.com/gemfire/gemfire-distributed-typed'
developers {
developer {
name = 'Jens Deppe'
email = '[email protected]'
organization = 'Broadcom'
organizationUrl = 'https://broadcom.com'
}
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
url = 'https://github.com/gemfire/gemfire-distributed-types'
connection = 'scm:git:git://github.com/gemfire/gemfire-distributed-types.git'
developerConnection = 'scm:git:ssh://github.com:gemfire/gemfire-distributed-types.git'
}
}
from components.java
artifact tasks.named('extensionDistZip')
}
}
repositories {
maven {
url = layout.buildDirectory.dir('staging-deploy')
}
}
}
extensionDistZip {
eachFile { file ->
String path = file.relativePath
file.setPath(path.substring(path.indexOf("/")+1,path.length()))
}
archiveExtension.set("gfm")
}
javadoc {
configure( options ) {
tags(
'todo:X"',
'apiNote:a:API Note:',
'implSpec:a:Implementation Requirements:',
'implNote:a:Implementation Note:'
)
}
}