[ci-skip] Updated Gradle to 7.0 (#453)

* Gradle 7.0

* Build JDK 16

* [CI-SKIP] rebase

* Speed-Up build times

Makes kotlin tasks run in parallel and adds back configure on demand

* Updated to the final release of gradle 7.0

* Gradle Distribution SHA 256 Sum

* Validate Gradle Wrapper

* merged the two jobs

* better name for validation

* setup-java@v2

* fix?

* specify arch

* Setup JAVA_HOME and PATH

* revert

* Use the same jdk as @v1

* use setup-java@v1

too much errors

* require Gradle Wrapper Validation to run build

* setup-java@v2

* Regenerate cache

maybe fix some issues

* Auto set MC version of paperclip in GitHub Actions

* Added .gitattributes

Should fix issues with line endings

* Update .gitattributes

* Updated shadow jar plugin

* fix
This commit is contained in:
tofikarz 2021-04-27 16:45:57 +02:00 committed by Simon Gardling
parent 7cf4be9f2f
commit 9dd5b27488
7 changed files with 71 additions and 18 deletions

43
.gitattributes vendored Normal file
View File

@ -0,0 +1,43 @@
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto
#
# The above will automatically detect and convert (crlf => lf) for all text files NOT listed below
#
# These files are text and should be normalized (Convert crlf => lf)
*.java text eol=lf
*.json text eol=lf
*.properties text eol=lf
*.txt text eol=lf
*.xml text eol=lf
*.kts text eol=lf
*.gradle text eol=lf
gradlew text eol=lf
*.yml text eol=lf
*.toml text eol=lf
Jenkinsfile text eol=lf
# Preserve file endings
*.patch -text
# Markdown
*.md text diff=markdown
# Windows Files
*.bat text eol=crlf
*.cmd text eol=crlf
# Binary files
*.class binary
*.dll binary
*.ear binary
*.gif binary
*.ico binary
*.jar binary
*.jpg binary
*.jpeg binary
*.png binary
*.so binary
*.war binary
*.tiff binary
*.tif binary

View File

@ -15,19 +15,26 @@ on:
- 'Jenkinsfile' - 'Jenkinsfile'
jobs: jobs:
build: validation:
name: "Gradle Wrapper Validation"
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
java: [15, 11, 8]
fail-fast: false
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }} - uses: gradle/wrapper-validation-action@v1
uses: actions/setup-java@v1
build:
needs: validation
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11', '16' ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.Java }}
uses: actions/setup-java@v2
with: with:
distribution: 'adopt'
java-version: ${{ matrix.java }} java-version: ${{ matrix.java }}
- name: Pull Gradle Cache - name: Pull Gradle Cache
@ -35,7 +42,7 @@ jobs:
id: gradle-cache id: gradle-cache
with: with:
path: ~/.gradle path: ~/.gradle
key: ${{ runner.os }}-maven-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-java-${{ matrix.java }} key: ${{ runner.os }}-mavenCache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-openjdk-${{ matrix.java }}
- name: Setup Yatopia Project - name: Setup Yatopia Project
run: | run: |
@ -54,7 +61,7 @@ jobs:
id: decompile-cache id: decompile-cache
with: with:
path: Paper/work/Minecraft/${{ steps.mcver.outputs.mcver }} path: Paper/work/Minecraft/${{ steps.mcver.outputs.mcver }}
key: ${{ hashFiles('Paper/work/BuildData/mappings/bukkit-$STEPS_MCVER_OUTPUTS_MCVER-cl.csrg') }}-${{ steps.mcver.outputs.mcver }}-${{ runner.os }}-java-${{ matrix.java }}-minecraft-decomp key: ${{ hashFiles('Paper/work/BuildData/mappings/bukkit-$STEPS_MCVER_OUTPUTS_MCVER-cl.csrg') }}-${{ steps.mcver.outputs.mcver }}-${{ runner.os }}-openjdk-${{ matrix.java }}-minecraft-decomp
- name: Apply Patches - name: Apply Patches
run: | run: |
@ -66,7 +73,7 @@ jobs:
id: maven-cache id: maven-cache
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-mavenCache-${{ hashFiles('**/pom.xml') }}
- name: Build Yatopia - name: Build Yatopia
run: | run: |
@ -76,5 +83,5 @@ jobs:
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: Yatopia-${{ matrix.java }} name: Yatopia-${{ matrix.java }}
path: yatopia-1.16.5-paperclip.jar path: yatopia-${{ steps.mcver.outputs.mcver }}-paperclip.jar

View File

@ -1,5 +1,5 @@
val kotlinxDomVersion = "0.0.10" val kotlinxDomVersion = "0.0.10"
val shadowVersion = "6.1.0" val shadowVersion = "7.0.0"
val mustacheVersion = "0.9.6" val mustacheVersion = "0.9.6"
val javaxMailVersion = "1.4.4" val javaxMailVersion = "1.4.4"
@ -9,14 +9,13 @@ plugins {
repositories { repositories {
mavenCentral() mavenCentral()
jcenter()
maven("https://plugins.gradle.org/m2/") maven("https://plugins.gradle.org/m2/")
maven("https://jitpack.io/") maven("https://jitpack.io/")
} }
dependencies { dependencies {
implementation("org.jetbrains.kotlinx:kotlinx.dom:$kotlinxDomVersion") implementation("org.jetbrains.kotlinx:kotlinx.dom:$kotlinxDomVersion")
implementation("com.github.jengelman.gradle.plugins:shadow:$shadowVersion") implementation("com.github.johnrengelman:shadow:$shadowVersion")
implementation("com.github.spullara.mustache.java:compiler:$mustacheVersion") implementation("com.github.spullara.mustache.java:compiler:$mustacheVersion")
implementation("javax.mail:mail:$javaxMailVersion") implementation("javax.mail:mail:$javaxMailVersion")
implementation("com.github.ishlandbukkit:jbsdiff:deff66b794") implementation("com.github.ishlandbukkit:jbsdiff:deff66b794")

View File

@ -1,4 +1,6 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2G org.gradle.jvmargs=-Xms1G -Xmx3G
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.configureondemand=true kotlin.parallel.tasks.in.project=true
org.gradle.caching=true
org.gradle.configureondemand=true

View File

@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
# Check on https://gradle.org/release-checksums/
distributionSha256Sum=eb8b89184261025b0430f5b2233701ff1377f96da1ef5e278af6ae8bac5cc305
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

2
gradlew vendored
View File

@ -44,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"` APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx3G" "-Xms1G"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"

2
gradlew.bat vendored
View File

@ -33,7 +33,7 @@ set APP_HOME=%DIRNAME%
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@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="-Xmx3G" "-Xms1G"
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome