Build system & pipeline changes (#2024)

* Build system & pipeline changes

- Updated Gradle to 7.1.1 & removed deprecations
- Added Google Maven repository & updated Dagger to 2.38
- Set new options.release parameter for submodules, allows producing Java 8 -compatible bytecode with Java 16 (also ensures that no APIs from a newer version are used)
- Updated workflows to use newer versions of checkout & setup-java
- Added a Gradle dependency cache task to workflows, allows for faster builds

* Cleanup cache after build
This commit is contained in:
Antti Koponen 2021-07-23 16:49:34 +03:00 committed by GitHub
parent 0ee1e40e4b
commit cdbe21fb6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 42 deletions

View File

@ -21,11 +21,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.11
uses: actions/setup-java@v1
- uses: actions/checkout@v2
- name: Set up JDK 1.16
uses: actions/setup-java@v2
with:
java-version: 1.11
distribution: 'adopt'
java-version: '16'
- name: Verify MariaDB connection
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
@ -33,6 +34,15 @@ jobs:
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
sleep 1
done
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
env:
MYSQL_DB: test
@ -42,3 +52,9 @@ jobs:
run: |
cd Plan
./gradlew build
- name: Cleanup Gradle cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties

View File

@ -21,11 +21,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.11
uses: actions/setup-java@v1
- uses: actions/checkout@v2
- name: Set up JDK 1.16
uses: actions/setup-java@v2
with:
java-version: 1.11
distribution: 'adopt'
java-version: '16'
- name: Verify MariaDB connection
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
@ -33,6 +34,15 @@ jobs:
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
sleep 1
done
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
env:
MYSQL_DB: test

View File

@ -12,8 +12,6 @@ plugins {
id "jacoco"
id "checkstyle"
id "org.sonarqube" version "3.3"
// id "net.ltgt.apt" version "0.21"
// id "net.ltgt.apt-idea" version "0.21"
}
apply plugin: 'nebula-aggregate-javadocs'
@ -30,7 +28,6 @@ def determineBuildVersion = {
def buildVersion = determineBuildVersion()
allprojects {
wrapper.gradleVersion = "7.0.2"
group "com.djrapitops"
version "5.4-SNAPSHOT"
@ -58,12 +55,13 @@ subprojects {
apply plugin: "checkstyle"
apply plugin: "jacoco"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava {
options.release = 8
}
ext {
daggerVersion = "2.37"
daggerCompilerVersion = "2.37"
daggerVersion = "2.38"
daggerCompilerVersion = "2.38"
palVersion = "5.0.0"
@ -92,6 +90,7 @@ subprojects {
repositories {
mavenCentral()
google()
maven { url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" } // Spigot
maven { url = "https://papermc.io/repo/repository/maven-public/" } // Paper
maven { url = "https://repo.spongepowered.org/repository/maven-public/" } // Sponge
@ -146,7 +145,7 @@ subprojects {
jacocoTestReport {
reports {
xml.enabled true
xml.required = true
// xml.destination file("${buildDir}/jacoco/report.xml")
}
}

Binary file not shown.

View File

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

2
Plan/gradlew vendored
View File

@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )