Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: jdk 8 is no longer supported #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 8, 11 ]
java: [ 11, 17 ]
name: Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v2
Expand All @@ -22,19 +22,6 @@ jobs:
with:
distribution: "temurin"
java-version: ${{ matrix.java }}
- name: Cache dependencies
uses: actions/cache@v2.1.6
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Cache wrapper
uses: actions/cache@v2.1.6
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
cache: "gradle"
- name: Build
run: ./gradlew build
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4.1.1
- uses: wagoid/commitlint-github-action@v4.1.4
with:
failOnWarnings: true
env:
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,8 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: 8
- name: Cache dependencies
uses: actions/cache@v2.1.6
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Cache wrapper
uses: actions/cache@v2.1.6
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
java-version: 11
cache: "gradle"
- name: Build
run: ./gradlew build
- name: Publish
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This plugin configures the following tasks for any Ekino Java project:

## Requirement

You need to have a JDK 8 at least.
You need to have a JDK 11 at least.

It requires Gradle 6.8 or later.

Expand Down Expand Up @@ -72,7 +72,7 @@ plugins {
You can override Java version using a dedicated configuration (default is 11):
```groovy
javaPlugin {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package com.ekino.oss.gradle.plugin
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.condition.DisabledOnJre
import org.junit.jupiter.api.condition.JRE.JAVA_17
import org.junit.jupiter.api.io.TempDir
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ValueSource
Expand All @@ -15,6 +17,7 @@ class GradleVersionsCompatibilityTest {
@TempDir
lateinit var tempDir: File

@DisabledOnJre(JAVA_17)
@ValueSource(strings = ["6.8.3", "6.9", "7.1.1", "7.2"])
@ParameterizedTest(name = "Gradle {0}")
@DisplayName("Should work in Gradle version")
Expand Down
9 changes: 5 additions & 4 deletions src/test/kotlin/com/ekino/oss/gradle/plugin/JavaPluginIT.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome.SUCCESS
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.condition.DisabledOnJre
import org.junit.jupiter.api.condition.JRE.JAVA_8
import org.junit.jupiter.api.condition.JRE.JAVA_11
import org.junit.jupiter.api.io.TempDir
import strikt.api.expectThat
import strikt.assertions.*
Expand All @@ -25,6 +25,7 @@ class JavaPluginIT {
lateinit var tempDir: Path

@Test
@DisabledOnJre(JAVA_11)
fun `Should build project with only unit tests`() {
val result = runTask("project_with_test")

Expand Down Expand Up @@ -62,7 +63,6 @@ class JavaPluginIT {
}

@Test
@DisabledOnJre(JAVA_8)
fun `Should build project with integration tests`() {
val result = runTask("project_with_test_and_integration_test")

Expand Down Expand Up @@ -91,6 +91,7 @@ class JavaPluginIT {
}

@Test
@DisabledOnJre(JAVA_11)
fun `Should display test report in output`() {
val result = runTask("project_with_test")

Expand All @@ -108,8 +109,8 @@ class JavaPluginIT {
val result = runTask("project_with_test", "properties")

expectThat(result.output) {
contains("sourceCompatibility: 1.8")
contains("targetCompatibility: 1.8")
contains("sourceCompatibility: 17")
contains("targetCompatibility: 17")
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/test/kotlin/com/ekino/oss/gradle/plugin/JavaPluginTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import org.gradle.api.JavaVersion
import org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestFramework
import org.gradle.testfixtures.ProjectBuilder
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.condition.DisabledOnJre
import org.junit.jupiter.api.condition.JRE.JAVA_8
import strikt.api.expect
import strikt.api.expectThat
import strikt.assertions.containsExactly
Expand Down Expand Up @@ -38,7 +36,6 @@ class JavaPluginTest {
}

@Test
@DisabledOnJre(JAVA_8)
fun shouldTargetJava11ByDefault() {
val project = ProjectBuilder.builder().build()

Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/project_with_test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ test {
}

javaPlugin {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}