Skip to content

Commit 3624010

Browse files
authored
Update build to Gradle 7.5.1 (#443)
1 parent e54f965 commit 3624010

File tree

7 files changed

+43
-72
lines changed

7 files changed

+43
-72
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ gradle-app.setting
2121

2222
# HTML files produced by the docs build
2323
html_docs
24+
25+
# Local Makefile
26+
Makefile

gradle/wrapper/gradle-wrapper.jar

293 Bytes
Binary file not shown.
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
1-
#
2-
# Licensed to Elasticsearch B.V. under one or more contributor
3-
# license agreements. See the NOTICE file distributed with
4-
# this work for additional information regarding copyright
5-
# ownership. Elasticsearch B.V. licenses this file to you under
6-
# the Apache License, Version 2.0 (the "License"); you may
7-
# not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing,
13-
# software distributed under the License is distributed on an
14-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
# KIND, either express or implied. See the License for the
16-
# specific language governing permissions and limitations
17-
# under the License.
18-
#
19-
201
distributionBase=GRADLE_USER_HOME
212
distributionPath=wrapper/dists
22-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
234
zipStoreBase=GRADLE_USER_HOME
245
zipStorePath=wrapper/dists

gradlew

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
#!/usr/bin/env sh
22

3-
#
4-
# Licensed to Elasticsearch B.V. under one or more contributor
5-
# license agreements. See the NOTICE file distributed with
6-
# this work for additional information regarding copyright
7-
# ownership. Elasticsearch B.V. licenses this file to you under
8-
# the Apache License, Version 2.0 (the "License"); you may
9-
# not use this file except in compliance with the License.
10-
# You may obtain a copy of the License at
11-
#
12-
# http://www.apache.org/licenses/LICENSE-2.0
13-
#
14-
# Unless required by applicable law or agreed to in writing,
15-
# software distributed under the License is distributed on an
16-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17-
# KIND, either express or implied. See the License for the
18-
# specific language governing permissions and limitations
19-
# under the License.
20-
#
21-
223
#
234
# Copyright 2015 the original author or authors.
245
#
@@ -149,7 +130,7 @@ fi
149130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
150131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
151132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
152-
133+
153134
JAVACMD=`cygpath --unix "$JAVACMD"`
154135

155136
# We build the pattern for arguments to be converted via cygpath

gradlew.bat

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
5454
set JAVA_HOME=%JAVA_HOME:"=%
5555
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5656

57-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5858

5959
echo.
6060
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,29 +64,14 @@ echo location of your Java installation.
6464

6565
goto fail
6666

67-
:init
68-
@rem Get command-line arguments, handling Windows variants
69-
70-
if not "%OS%" == "Windows_NT" goto win9xME_args
71-
72-
:win9xME_args
73-
@rem Slurp the command line arguments.
74-
set CMD_LINE_ARGS=
75-
set _SKIP=2
76-
77-
:win9xME_args_slurp
78-
if "x%~1" == "x" goto execute
79-
80-
set CMD_LINE_ARGS=%*
81-
8267
:execute
8368
@rem Setup the command line
8469

8570
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8671

8772

8873
@rem Execute Gradle
89-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
9075

9176
:end
9277
@rem End local scope for the variables with windows NT shell

java-client/build.gradle.kts

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919

2020
import com.github.jk1.license.ProjectData
2121
import com.github.jk1.license.render.ReportRenderer
22+
import com.github.jk1.license.render.LicenseDataCollector
2223
import java.io.FileWriter
2324

2425
plugins {
2526
java
2627
`java-library`
2728
checkstyle
2829
`maven-publish`
29-
id("com.github.jk1.dependency-license-report") version "1.19"
30-
id("de.thetaphi.forbiddenapis") version "3.3"
30+
id("com.github.jk1.dependency-license-report") version "2.1"
31+
id("de.thetaphi.forbiddenapis") version "3.4"
3132
}
3233

3334
java {
@@ -179,7 +180,7 @@ publishing {
179180
dependencies {
180181
// Compile and test with the last 7.x version to make sure transition scenarios where
181182
// the Java API client coexists with a 7.x HLRC work fine
182-
val elasticsearchVersion = "7.17.4"
183+
val elasticsearchVersion = "7.17.7"
183184
val jacksonVersion = "2.13.3"
184185

185186
// Apache 2.0
@@ -265,21 +266,31 @@ class SpdxReporter(val dest: File) : ReportRenderer {
265266
FileWriter(dest).use { out ->
266267
out.append("name,url,version,revision,license\n")
267268
data?.allDependencies?.forEach { dep ->
268-
val info = com.github.jk1.license.render.LicenseDataCollector.multiModuleLicenseInfo(dep)
269269

270270
val depVersion = dep.version
271271
val depName = dep.group + ":" + dep.name
272-
val depUrl = info.moduleUrls.first()
273272

274-
val licenseIds = info.licenses.mapNotNull { license ->
275-
license.name?.let {
276-
checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" }
277-
}
278-
}.toSet()
273+
//--------------
274+
// FIXME: restore section below once 2.2 is released
275+
// See https://github.com/jk1/Gradle-License-Report/issues/251
276+
val (depUrl, licenseId, licenseUrl) = LicenseDataCollector.singleModuleLicenseInfo(dep)
277+
checkNotNull(spdxIds[licenseId]) { "No SPDX identifier for $licenseId" }
278+
279+
//--------------
280+
// val info = LicenseDataCollector.multiModuleLicenseInfo(dep)
281+
// val depUrl = info.moduleUrls.first()
282+
//
283+
// val licenseIds = info.licenses.mapNotNull { license ->
284+
// license.name?.let {
285+
// checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" }
286+
// }
287+
// }.toSet()
288+
//
289+
// // Combine multiple licenses.
290+
// // See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions
291+
// val licenseId = licenseIds.joinToString(" OR ")
292+
//--------------
279293

280-
// Combine multiple licenses.
281-
// See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions
282-
val licenseId = licenseIds.joinToString(" OR ")
283294
out.append("${quote(depName)},${quote(depUrl)},${quote(depVersion)},,${quote(licenseId)}\n")
284295
}
285296
}

settings.gradle.kts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,14 @@
1818
*/
1919

2020
rootProject.name = "elasticsearch-java"
21-
include("java-client")
21+
22+
// Include as subprojects all subdirectories that have a "build.gradle.kts" and no ".gradle-standalone"
23+
(rootProject.projectDir.listFiles() ?: arrayOf<File>()).
24+
filter { File(it, "build.gradle.kts").exists() }.
25+
filter { !File(it, ".gradle-standalone").exists() }.
26+
filter { it.name != "buildSrc" }.
27+
toTypedArray().
28+
forEach { dir ->
29+
include(dir.name)
30+
project(":" + dir.name).projectDir = dir
31+
}

0 commit comments

Comments
 (0)