Skip to content

Commit 9ba2363

Browse files
committed
backporting gradle build
1 parent cfb8558 commit 9ba2363

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

.ci/configure_signing.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ signing.secretKeyRingFile=${keyring_file}
4949
ossrhUsername=${maven_username}
5050
ossrhPassword=${maven_password}
5151
EOF
52-

java-client/build.gradle.kts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ tasks.getByName<ProcessResources>("processResources") {
6464
if (name != "apis.json") {
6565
// Only process main source-set resources (test files are large)
6666
expand(
67-
"version" to version,
68-
"git_revision" to (if (rootProject.extra.has("gitHashFull")) rootProject.extra["gitHashFull"] else "unknown")
67+
"version" to version,
68+
"git_revision" to (if (rootProject.extra.has("gitHashFull")) rootProject.extra["gitHashFull"] else "unknown")
6969
)
7070
}
7171
}
@@ -140,8 +140,14 @@ publishing {
140140
name = "MavenCentralSnapshot"
141141
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
142142
credentials {
143-
username = providers.gradleProperty("ossrhUsername").get()
144-
password = providers.gradleProperty("ossrhPassword").get()
143+
run {
144+
if (gradle.startParameter.taskNames.find { it.contains("ToMavenCentralSnapshotRepository") } != null) {
145+
if (!providers.gradleProperty("ossrhUsername").isPresent) logger.error("ossrhUsername not set")
146+
if (!providers.gradleProperty("ossrhPassword").isPresent) logger.error("ossrhPassword not set")
147+
}
148+
}
149+
username = providers.gradleProperty("ossrhUsername").orNull
150+
password = providers.gradleProperty("ossrhPassword").orNull
145151
}
146152
}
147153
}
@@ -180,7 +186,7 @@ publishing {
180186
// are the same as the one used in the dependency section below.
181187
val xPathFactory = javax.xml.xpath.XPathFactory.newInstance()
182188
val depSelector = xPathFactory.newXPath()
183-
.compile("/project/dependencies/dependency[groupId/text() = 'org.elasticsearch.client']")
189+
.compile("/project/dependencies/dependency[groupId/text() = 'org.elasticsearch.client']")
184190
val versionSelector = xPathFactory.newXPath().compile("version")
185191

186192
var foundVersion = false;
@@ -289,15 +295,15 @@ licenseReport {
289295
class SpdxReporter(val dest: File) : ReportRenderer {
290296
// License names to their SPDX identifier
291297
val spdxIds = mapOf(
292-
"The Apache License, Version 2.0" to "Apache-2.0",
293-
"Apache License, Version 2.0" to "Apache-2.0",
294-
"The Apache Software License, Version 2.0" to "Apache-2.0",
295-
"BSD Zero Clause License" to "0BSD",
296-
"Eclipse Public License 2.0" to "EPL-2.0",
297-
"Eclipse Public License v. 2.0" to "EPL-2.0",
298-
"Eclipse Public License - v 2.0" to "EPL-2.0",
299-
"GNU General Public License, version 2 with the GNU Classpath Exception" to "GPL-2.0 WITH Classpath-exception-2.0",
300-
"COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0" to "CDDL-1.0"
298+
"The Apache License, Version 2.0" to "Apache-2.0",
299+
"Apache License, Version 2.0" to "Apache-2.0",
300+
"The Apache Software License, Version 2.0" to "Apache-2.0",
301+
"BSD Zero Clause License" to "0BSD",
302+
"Eclipse Public License 2.0" to "EPL-2.0",
303+
"Eclipse Public License v. 2.0" to "EPL-2.0",
304+
"Eclipse Public License - v 2.0" to "EPL-2.0",
305+
"GNU General Public License, version 2 with the GNU Classpath Exception" to "GPL-2.0 WITH Classpath-exception-2.0",
306+
"COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0" to "CDDL-1.0"
301307
)
302308

303309
private fun quote(str: String): String {

0 commit comments

Comments
 (0)