1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-14 01:44:12 +02:00

current way of gradle cache, use javac release flag

This commit is contained in:
soloturn
2022-02-12 10:36:28 +01:00
parent 061e18ea06
commit d4dc7a7fff
2 changed files with 16 additions and 18 deletions

View File

@@ -30,25 +30,15 @@ jobs:
id: ci-env id: ci-env
uses: FranzDiebold/github-env-vars-action@v2 uses: FranzDiebold/github-env-vars-action@v2
- name: Set up Java - name: Set up java
uses: actions/setup-java@v2 uses: actions/setup-java@v2.5.0
with: with:
distribution: 'temurin'
java-version: ${{ matrix.java }} java-version: ${{ matrix.java }}
distribution: temurin
- name: Cache Gradle packages cache: gradle
# speed up the build by caching dependencies, downloaded versions
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 - name: Build with Gradle
run: ./gradlew build run: gradle clean build -PjavacRelease=${{ matrix.java }}
- name: SHA256 - name: SHA256
if: matrix.upload if: matrix.upload

View File

@@ -1,3 +1,8 @@
// permits to start the build setting the javac release parameter, no parameter means build for java8:
// gradle clean build -PjavacRelease=8
// gradle clean build -PjavacRelease=17
val javacRelease = (project.findProperty("javacRelease") ?: "8") as String
plugins { plugins {
id("fr.brouillard.oss.gradle.jgitver") version "0.9.1" id("fr.brouillard.oss.gradle.jgitver") version "0.9.1"
id("jacoco") id("jacoco")
@@ -38,9 +43,12 @@ jgitver {
useGitCommitID = true useGitCommitID = true
} }
java { tasks.compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8 if (JavaVersion.current().isJava8) {
targetCompatibility = JavaVersion.VERSION_1_8 java.targetCompatibility = JavaVersion.VERSION_1_8
} else {
options.release.set(Integer.parseInt(javacRelease))
}
} }
tasks.withType<Jar> { tasks.withType<Jar> {