Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 729f5d2

Browse files
authored
Use Gradle toolchains (#59)
1 parent 0df5b81 commit 729f5d2

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
with:
1919
distribution: zulu
2020
java-version: 8
21+
- uses: actions/setup-java@v3
22+
with:
23+
distribution: zulu
24+
java-version: 17
2125
- shell: bash
2226
env:
2327
GRADLE_PLUGIN_PUBLISH_KEY: ${{ secrets.GRADLE_PLUGIN_PUBLISH_KEY }}

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## [Unreleased]
44

5-
## [3.0.0] 2023-02-28
5+
## [3.0.0] 2023-03-07
66

77
### Changed
88

99
- Project now uses Gradle's Kotlin based DSL. Users are still able to use Groovy in their projects. ([#55](https://github.com/heroku/heroku-gradle/pull/55))
1010
- Ported functional tests from Groovy to Java. ([#55](https://github.com/heroku/heroku-gradle/pull/55))
11-
- Updated `com.heroku.sdk:heroku-deploy` to version `3.0.6`. ([#55](https://github.com/heroku/heroku-gradle/pull/55))
11+
- Updated `com.heroku.sdk:heroku-deploy` to version `3.0.7`. ([#58](https://github.com/heroku/heroku-gradle/pull/58))
1212

1313
### Added
1414

plugin/build.gradle.kts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ plugins {
77
}
88

99
java {
10-
sourceCompatibility = JavaVersion.VERSION_1_8
11-
targetCompatibility = JavaVersion.VERSION_1_8
10+
toolchain {
11+
languageVersion.set(JavaLanguageVersion.of(8))
12+
}
1213
}
1314

1415
repositories {
@@ -41,17 +42,22 @@ gradlePlugin {
4142
val functionalTestSourceSet = sourceSets.create("functionalTest") {
4243
}
4344

45+
tasks.named<JavaCompile>(functionalTestSourceSet.getCompileTaskName("java")) {
46+
javaCompiler.set(javaToolchains.compilerFor {
47+
languageVersion.set(JavaLanguageVersion.of(17))
48+
})
49+
}
50+
4451
configurations["functionalTestImplementation"].extendsFrom(configurations["testImplementation"])
4552

4653
val functionalTest by tasks.registering(Test::class) {
4754
testClassesDirs = functionalTestSourceSet.output.classesDirs
4855
classpath = functionalTestSourceSet.runtimeClasspath
4956
useJUnitPlatform()
5057

51-
java {
52-
sourceCompatibility = JavaVersion.VERSION_17
53-
targetCompatibility = JavaVersion.VERSION_17
54-
}
58+
javaLauncher.set(javaToolchains.launcherFor {
59+
languageVersion.set(JavaLanguageVersion.of(17))
60+
})
5561
}
5662

5763
gradlePlugin.testSourceSets(functionalTestSourceSet)

0 commit comments

Comments
 (0)