diff --git a/README.md b/README.md index c43e161..9e24189 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Concrete + Concrete is a Gradle plugin for Bukkit projects. Originally spawned out of the Gradle buildSrc written for a set of plugins named Foundation. ## Contributors -- [@kendfinger](https://github.com/kendfinger) + +- [@azenla](https://github.com/azenla) - [@lgorence](https://github.com/lgorence) diff --git a/build.gradle.kts b/build.gradle.kts index 0889c18..2e4a472 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "lgbt.mystic.foundation" -version = "0.4.0" +version = "0.5.0" repositories { mavenCentral() @@ -18,7 +18,7 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21") implementation("org.jetbrains.kotlin:kotlin-serialization:1.6.21") implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2") - implementation("com.google.code.gson:gson:2.9.0") + implementation("com.google.code.gson:gson:2.10") // Implementation of crypto used in smart downloader. implementation("org.bouncycastle:bcprov-jdk15on:1.70") @@ -49,20 +49,21 @@ gradlePlugin { } java { - val version = JavaVersion.toVersion("11") + val version = JavaVersion.toVersion("17") sourceCompatibility = version targetCompatibility = version } tasks.compileKotlin { kotlinOptions { - jvmTarget = "11" + jvmTarget = "17" } } publishing { repositories { mavenLocal() + maven { name = "github-packages" url = uri("https://maven.pkg.github.com/mysticlgbt/concrete") @@ -71,16 +72,23 @@ publishing { password = project.findProperty("github.token") as String? } } + maven { name = "gitlab" - url = uri("https://gitlab.com/api/v4/projects/37752100/packages/maven") + url = uri("https://gitlab.com/api/v4/projects/37752100/packages/maven") credentials(HttpHeaderCredentials::class.java) { name = "Private-Token" value = project.findProperty("gitlab.com.accessToken") as String? } + authentication { create("header") } } } } + +tasks.withType { + gradleVersion = "7.5.1" + distributionType = Wrapper.DistributionType.ALL +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927..249e583 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fc..8fad3f5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c787..a69d9cb 100755 --- a/gradlew +++ b/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd3..f127cfd 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -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 execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/mixed/bukkit-plugins/build.gradle.kts b/samples/mixed/bukkit-plugins/build.gradle.kts index 0bc25ac..a805738 100644 --- a/samples/mixed/bukkit-plugins/build.gradle.kts +++ b/samples/mixed/bukkit-plugins/build.gradle.kts @@ -5,6 +5,6 @@ plugins { concrete { minecraftServerPath.set("server") paperVersionGroup.set("1.19") - paperApiVersion.set("1.19-R0.1-SNAPSHOT") + paperApiVersion.set("1.19.2-R0.1-SNAPSHOT") acceptServerEula.set(true) } diff --git a/samples/mixed/gradle/wrapper/gradle-wrapper.jar b/samples/mixed/gradle/wrapper/gradle-wrapper.jar index 41d9927..249e583 100644 Binary files a/samples/mixed/gradle/wrapper/gradle-wrapper.jar and b/samples/mixed/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/mixed/gradle/wrapper/gradle-wrapper.properties b/samples/mixed/gradle/wrapper/gradle-wrapper.properties index aa991fc..ae04661 100644 --- a/samples/mixed/gradle/wrapper/gradle-wrapper.properties +++ b/samples/mixed/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/mixed/gradlew b/samples/mixed/gradlew index 1b6c787..a69d9cb 100755 --- a/samples/mixed/gradlew +++ b/samples/mixed/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/samples/mixed/gradlew.bat b/samples/mixed/gradlew.bat index 107acd3..f127cfd 100644 --- a/samples/mixed/gradlew.bat +++ b/samples/mixed/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -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 execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/shared/build.gradle.kts b/samples/shared/build.gradle.kts index 5da5b2e..92042b1 100644 --- a/samples/shared/build.gradle.kts +++ b/samples/shared/build.gradle.kts @@ -6,6 +6,6 @@ plugins { concrete { minecraftServerPath.set("server") paperVersionGroup.set("1.19") - paperApiVersion.set("1.19-R0.1-SNAPSHOT") + paperApiVersion.set("1.19.2-R0.1-SNAPSHOT") acceptServerEula.set(true) } diff --git a/samples/shared/gradle/wrapper/gradle-wrapper.jar b/samples/shared/gradle/wrapper/gradle-wrapper.jar index 41d9927..249e583 100644 Binary files a/samples/shared/gradle/wrapper/gradle-wrapper.jar and b/samples/shared/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/shared/gradle/wrapper/gradle-wrapper.properties b/samples/shared/gradle/wrapper/gradle-wrapper.properties index aa991fc..ae04661 100644 --- a/samples/shared/gradle/wrapper/gradle-wrapper.properties +++ b/samples/shared/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/shared/gradlew b/samples/shared/gradlew index 1b6c787..a69d9cb 100755 --- a/samples/shared/gradlew +++ b/samples/shared/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/samples/shared/gradlew.bat b/samples/shared/gradlew.bat index 107acd3..f127cfd 100644 --- a/samples/shared/gradlew.bat +++ b/samples/shared/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -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 execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/simple/build.gradle.kts b/samples/simple/build.gradle.kts index 0bc25ac..a805738 100644 --- a/samples/simple/build.gradle.kts +++ b/samples/simple/build.gradle.kts @@ -5,6 +5,6 @@ plugins { concrete { minecraftServerPath.set("server") paperVersionGroup.set("1.19") - paperApiVersion.set("1.19-R0.1-SNAPSHOT") + paperApiVersion.set("1.19.2-R0.1-SNAPSHOT") acceptServerEula.set(true) } diff --git a/samples/simple/gradle/wrapper/gradle-wrapper.jar b/samples/simple/gradle/wrapper/gradle-wrapper.jar index 41d9927..249e583 100644 Binary files a/samples/simple/gradle/wrapper/gradle-wrapper.jar and b/samples/simple/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/simple/gradle/wrapper/gradle-wrapper.properties b/samples/simple/gradle/wrapper/gradle-wrapper.properties index aa991fc..ae04661 100644 --- a/samples/simple/gradle/wrapper/gradle-wrapper.properties +++ b/samples/simple/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/simple/gradlew b/samples/simple/gradlew index 1b6c787..a69d9cb 100755 --- a/samples/simple/gradlew +++ b/samples/simple/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/samples/simple/gradlew.bat b/samples/simple/gradlew.bat index 107acd3..f127cfd 100644 --- a/samples/simple/gradlew.bat +++ b/samples/simple/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -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 execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/src/main/kotlin/lgbt/mystic/foundation/concrete/ConcreteBasePlugin.kt b/src/main/kotlin/lgbt/mystic/foundation/concrete/ConcreteBasePlugin.kt index a2949a4..ab32cdc 100644 --- a/src/main/kotlin/lgbt/mystic/foundation/concrete/ConcreteBasePlugin.kt +++ b/src/main/kotlin/lgbt/mystic/foundation/concrete/ConcreteBasePlugin.kt @@ -16,6 +16,10 @@ open class ConcreteBasePlugin : Plugin { "DEV" } + if (project.repositories.none { it.name == "MavenRepo" }) { + project.repositories.mavenCentral() + } + project.version = versionWithBuild project.plugins.apply("org.jetbrains.kotlin.jvm")