Updated gradle version

This commit is contained in:
nathan 2020-05-07 21:32:05 +02:00
parent ca77bc9960
commit c16f724c6e
5 changed files with 268 additions and 273 deletions

View File

@ -1,155 +1,155 @@
/* /*
* Copyright 2018 dorkbox, llc * Copyright 2018 dorkbox, llc
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.time.Instant import java.time.Instant
println("Gradle ${project.gradle.gradleVersion}") println("Gradle ${project.gradle.gradleVersion}")
plugins { plugins {
java java
`java-gradle-plugin` `java-gradle-plugin`
id("com.gradle.plugin-publish") version "0.11.0" id("com.gradle.plugin-publish") version "0.11.0"
id("com.dorkbox.Licensing") version "1.3" id("com.dorkbox.Licensing") version "1.3"
id("com.dorkbox.VersionUpdate") version "1.6.1" id("com.dorkbox.VersionUpdate") version "1.6.1"
id("com.dorkbox.GradleUtils") version "1.3" id("com.dorkbox.GradleUtils") version "1.4"
kotlin("jvm") version "1.3.72" kotlin("jvm") version "1.3.72"
} }
object Extras { object Extras {
// set for the project // set for the project
const val description = "Gradle Plugin to manage various Gradle tasks, such as updating gradle and dependencies" const val description = "Gradle Plugin to manage various Gradle tasks, such as updating gradle and dependencies"
const val group = "com.dorkbox" const val group = "com.dorkbox"
const val version = "1.4" const val version = "1.4"
// set as project.ext // set as project.ext
const val name = "Gradle Utils" const val name = "Gradle Utils"
const val id = "GradleUtils" const val id = "GradleUtils"
const val vendor = "Dorkbox LLC" const val vendor = "Dorkbox LLC"
const val url = "https://git.dorkbox.com/dorkbox/GradleUtils" const val url = "https://git.dorkbox.com/dorkbox/GradleUtils"
val tags = listOf("gradle", "update", "dependencies", "dependency management") val tags = listOf("gradle", "update", "dependencies", "dependency management")
val buildDate = Instant.now().toString() val buildDate = Instant.now().toString()
val JAVA_VERSION = JavaVersion.VERSION_1_8 val JAVA_VERSION = JavaVersion.VERSION_1_8
val KOTLIN_VERSION = JavaVersion.VERSION_1_8 val KOTLIN_VERSION = JavaVersion.VERSION_1_8
} }
/////////////////////////////// ///////////////////////////////
///// assign 'Extras' ///// assign 'Extras'
/////////////////////////////// ///////////////////////////////
GradleUtils.load("$projectDir/../../gradle.properties", Extras) GradleUtils.load("$projectDir/../../gradle.properties", Extras)
description = Extras.description description = Extras.description
group = Extras.group group = Extras.group
version = Extras.version version = Extras.version
licensing { licensing {
license(License.APACHE_2) { license(License.APACHE_2) {
author(Extras.vendor) author(Extras.vendor)
url(Extras.url) url(Extras.url)
note(Extras.description) note(Extras.description)
} }
} }
sourceSets { sourceSets {
main { main {
java { java {
setSrcDirs(listOf("src")) setSrcDirs(listOf("src"))
// want to include kotlin files for the source. 'setSrcDirs' resets includes... // want to include kotlin files for the source. 'setSrcDirs' resets includes...
include("**/*.kt") include("**/*.kt")
} }
} }
} }
repositories { repositories {
jcenter() jcenter()
} }
dependencies { dependencies {
// the kotlin version is taken from the plugin, so it is not necessary to set it here // the kotlin version is taken from the plugin, so it is not necessary to set it here
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin")
implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// setup checking for the latest version of a plugin or dependency // setup checking for the latest version of a plugin or dependency
implementation("com.github.ben-manes:gradle-versions-plugin:0.28.0") implementation("com.github.ben-manes:gradle-versions-plugin:0.28.0")
implementation("org.json:json:20180813") implementation("org.json:json:20180813")
} }
java { java {
sourceCompatibility = Extras.JAVA_VERSION sourceCompatibility = Extras.JAVA_VERSION
targetCompatibility = Extras.JAVA_VERSION targetCompatibility = Extras.JAVA_VERSION
} }
tasks.withType<JavaCompile> { tasks.withType<JavaCompile> {
options.encoding = "UTF-8" options.encoding = "UTF-8"
options.isIncremental = true options.isIncremental = true
} }
tasks.withType<KotlinCompile> { tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = Extras.KOTLIN_VERSION.toString() kotlinOptions.jvmTarget = Extras.KOTLIN_VERSION.toString()
} }
tasks.withType<Jar> { tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.FAIL duplicatesStrategy = DuplicatesStrategy.FAIL
} }
tasks.jar.get().apply { tasks.jar.get().apply {
manifest { manifest {
// https://docs.oracle.com/javase/tutorial/deployment/jar/packageman.html // https://docs.oracle.com/javase/tutorial/deployment/jar/packageman.html
attributes["Name"] = Extras.name attributes["Name"] = Extras.name
attributes["Specification-Title"] = Extras.name attributes["Specification-Title"] = Extras.name
attributes["Specification-Version"] = Extras.version attributes["Specification-Version"] = Extras.version
attributes["Specification-Vendor"] = Extras.vendor attributes["Specification-Vendor"] = Extras.vendor
attributes["Implementation-Title"] = "${Extras.group}.${Extras.id}" attributes["Implementation-Title"] = "${Extras.group}.${Extras.id}"
attributes["Implementation-Version"] = Extras.buildDate attributes["Implementation-Version"] = Extras.buildDate
attributes["Implementation-Vendor"] = Extras.vendor attributes["Implementation-Vendor"] = Extras.vendor
} }
} }
///////////////////////////////// /////////////////////////////////
//////// Plugin Publishing + Release //////// Plugin Publishing + Release
///////////////////////////////// /////////////////////////////////
gradlePlugin { gradlePlugin {
plugins { plugins {
create("GradleUtils") { create("GradleUtils") {
id = "${Extras.group}.${Extras.id}" id = "${Extras.group}.${Extras.id}"
implementationClass = "dorkbox.gradle.GradleUtils" implementationClass = "dorkbox.gradle.GradleUtils"
} }
} }
} }
pluginBundle { pluginBundle {
website = Extras.url website = Extras.url
vcsUrl = Extras.url vcsUrl = Extras.url
(plugins) { (plugins) {
"GradleUtils" { "GradleUtils" {
id = "${Extras.group}.${Extras.id}" id = "${Extras.group}.${Extras.id}"
displayName = Extras.name displayName = Extras.name
description = Extras.description description = Extras.description
tags = Extras.tags tags = Extras.tags
version = Extras.version version = Extras.version
} }
} }
} }

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

29
gradlew vendored
View File

@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else else
eval `echo args$i`="\"$arg\"" eval `echo args$i`="\"$arg\""
fi fi
i=$((i+1)) i=`expr $i + 1`
done done
case $i in case $i in
(0) set -- ;; 0) set -- ;;
(1) set -- "$args0" ;; 1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;; 2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;; 3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;; 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
@ -175,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " " echo " "
} }
APP_ARGS=$(save "$@") APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules # Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

200
gradlew.bat vendored
View File

@ -1,100 +1,100 @@
@rem @rem
@rem Copyright 2015 the original author or authors. @rem Copyright 2015 the original author or authors.
@rem @rem
@rem Licensed under the Apache License, Version 2.0 (the "License"); @rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License. @rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at @rem You may obtain a copy of the License at
@rem @rem
@rem https://www.apache.org/licenses/LICENSE-2.0 @rem https://www.apache.org/licenses/LICENSE-2.0
@rem @rem
@rem Unless required by applicable law or agreed to in writing, software @rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS, @rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%" == "" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem Gradle startup script for Windows
@rem @rem
@rem ########################################################################## @rem ##########################################################################
@rem Set local scope for the variables with windows NT shell @rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if "%ERRORLEVEL%" == "0" goto init
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo. echo.
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation. echo location of your Java installation.
goto fail goto fail
:findJavaFromJavaHome :findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto init
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo. echo.
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation. echo location of your Java installation.
goto fail goto fail
:init :init
@rem Get command-line arguments, handling Windows variants @rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args :win9xME_args
@rem Slurp the command line arguments. @rem Slurp the command line arguments.
set CMD_LINE_ARGS= set CMD_LINE_ARGS=
set _SKIP=2 set _SKIP=2
:win9xME_args_slurp :win9xME_args_slurp
if "x%~1" == "x" goto execute if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%* set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @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 %CMD_LINE_ARGS%
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if "%ERRORLEVEL%"=="0" goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1 exit /b 1
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal
:omega :omega