Skip to content

Commit

Permalink
Update build to Gradle 7.5.1 (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Nov 7, 2022
1 parent e54f965 commit 3624010
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 72 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -21,3 +21,6 @@ gradle-app.setting

# HTML files produced by the docs build
html_docs

# Local Makefile
Makefile
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
21 changes: 1 addition & 20 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,24 +1,5 @@
#
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
21 changes: 1 addition & 20 deletions gradlew
@@ -1,24 +1,5 @@
#!/usr/bin/env sh

#
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

#
# Copyright 2015 the original author or authors.
#
Expand Down Expand Up @@ -149,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

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

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

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

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

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

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


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

:end
@rem End local scope for the variables with windows NT shell
Expand Down
37 changes: 24 additions & 13 deletions java-client/build.gradle.kts
Expand Up @@ -19,15 +19,16 @@

import com.github.jk1.license.ProjectData
import com.github.jk1.license.render.ReportRenderer
import com.github.jk1.license.render.LicenseDataCollector
import java.io.FileWriter

plugins {
java
`java-library`
checkstyle
`maven-publish`
id("com.github.jk1.dependency-license-report") version "1.19"
id("de.thetaphi.forbiddenapis") version "3.3"
id("com.github.jk1.dependency-license-report") version "2.1"
id("de.thetaphi.forbiddenapis") version "3.4"
}

java {
Expand Down Expand Up @@ -179,7 +180,7 @@ publishing {
dependencies {
// Compile and test with the last 7.x version to make sure transition scenarios where
// the Java API client coexists with a 7.x HLRC work fine
val elasticsearchVersion = "7.17.4"
val elasticsearchVersion = "7.17.7"
val jacksonVersion = "2.13.3"

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

val depVersion = dep.version
val depName = dep.group + ":" + dep.name
val depUrl = info.moduleUrls.first()

val licenseIds = info.licenses.mapNotNull { license ->
license.name?.let {
checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" }
}
}.toSet()
//--------------
// FIXME: restore section below once 2.2 is released
// See https://github.com/jk1/Gradle-License-Report/issues/251
val (depUrl, licenseId, licenseUrl) = LicenseDataCollector.singleModuleLicenseInfo(dep)
checkNotNull(spdxIds[licenseId]) { "No SPDX identifier for $licenseId" }

//--------------
// val info = LicenseDataCollector.multiModuleLicenseInfo(dep)
// val depUrl = info.moduleUrls.first()
//
// val licenseIds = info.licenses.mapNotNull { license ->
// license.name?.let {
// checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" }
// }
// }.toSet()
//
// // Combine multiple licenses.
// // See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions
// val licenseId = licenseIds.joinToString(" OR ")
//--------------

// Combine multiple licenses.
// See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions
val licenseId = licenseIds.joinToString(" OR ")
out.append("${quote(depName)},${quote(depUrl)},${quote(depVersion)},,${quote(licenseId)}\n")
}
}
Expand Down
12 changes: 11 additions & 1 deletion settings.gradle.kts
Expand Up @@ -18,4 +18,14 @@
*/

rootProject.name = "elasticsearch-java"
include("java-client")

// Include as subprojects all subdirectories that have a "build.gradle.kts" and no ".gradle-standalone"
(rootProject.projectDir.listFiles() ?: arrayOf<File>()).
filter { File(it, "build.gradle.kts").exists() }.
filter { !File(it, ".gradle-standalone").exists() }.
filter { it.name != "buildSrc" }.
toTypedArray().
forEach { dir ->
include(dir.name)
project(":" + dir.name).projectDir = dir
}

0 comments on commit 3624010

Please sign in to comment.