1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-12 08:54:11 +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
uses: FranzDiebold/github-env-vars-action@v2
- name: Set up Java
uses: actions/setup-java@v2
- name: Set up java
uses: actions/setup-java@v2.5.0
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Cache Gradle packages
# 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-
distribution: temurin
cache: gradle
- name: Build with Gradle
run: ./gradlew build
run: gradle clean build -PjavacRelease=${{ matrix.java }}
- name: SHA256
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 {
id("fr.brouillard.oss.gradle.jgitver") version "0.9.1"
id("jacoco")
@@ -38,9 +43,12 @@ jgitver {
useGitCommitID = true
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
tasks.compileJava {
if (JavaVersion.current().isJava8) {
java.targetCompatibility = JavaVersion.VERSION_1_8
} else {
options.release.set(Integer.parseInt(javacRelease))
}
}
tasks.withType<Jar> {