Skip to content

Commit

Permalink
Require JDK 17 for packaging (#3027)
Browse files Browse the repository at this point in the history
Previously Compose Multiplatform Gradle plugin required
JDK 15+ for distribution packaging. However, fixing #2867 required
always passing --mac-entitlements to jpackage, which is
only available with JDK 17+.
  • Loading branch information
AlexeyTsvetkov authored Apr 11, 2023
1 parent 7c0e8a7 commit 9540cdc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '16'
java-version: '17'
- name: Test Gradle plugin
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion gradle-plugins/compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ tasks.test {
* It is not desirable to depend on little known service for provisioning JDK distributions, even for tests.
* Thus, the only option is to download the necessary JDK distributions ourselves.
*/
val jdkVersionsForTests = listOf(11, 15, 18, 19)
val jdkVersionsForTests = listOf(11, 19)
val jdkForTestsRoot = project.gradle.gradleUserHomeDir.resolve("compose-jb-jdks")
val downloadJdksForTests = tasks.register("downloadJdksForTests") {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.jetbrains.compose.internal.utils.clearDirs
import java.io.File

// __COMPOSE_NATIVE_DISTRIBUTIONS_MIN_JAVA_VERSION__
internal const val MIN_JAVA_RUNTIME_VERSION = 15
internal const val MIN_JAVA_RUNTIME_VERSION = 17

@CacheableTask
abstract class AbstractCheckNativeDistributionRuntime : AbstractComposeDesktopTask() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,6 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
}

@Test
fun testJdk15() = with(customJdkProject(15)) {
testPackageJvmDistributions()
}
@Test
fun testJdk18() = with(customJdkProject(18)) {
testPackageJvmDistributions()
}

@Test
fun testJdk19() = with(customJdkProject(19)) {
testPackageJvmDistributions()
Expand Down
4 changes: 2 additions & 2 deletions gradle-plugins/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ org.gradle.parallel=true
kotlin.code.style=official

# Default version of Compose Libraries used by Gradle plugin
compose.version=1.3.1
compose.version=1.4.0-rc03
# The latest version of Compose Compiler used by Gradle plugin. Used only in tests/CI.
compose.tests.compiler.version=1.4.5-rc03
# The latest version of Kotlin compatible with compose.tests.compiler.version. Used only in tests/CI.
compose.tests.compiler.compatible.kotlin.version=1.8.20
# The latest version of Kotlin compatible with compose.tests.compiler.version for JS target. Used only on CI.
compose.tests.js.compiler.compatible.kotlin.version=1.8.20
# __SUPPORTED_GRADLE_VERSIONS__
compose.tests.gradle.versions=7.0.2, 8.0-rc-1
compose.tests.gradle.versions=7.3.3, 8.0.2

# A version of Gradle plugin, that will be published,
# unless overridden by COMPOSE_GRADLE_PLUGIN_VERSION env var.
Expand Down
4 changes: 2 additions & 2 deletions tutorials/Native_distributions_and_local_execution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ Versions must follow the rules:

## Customizing JDK version

The plugin uses `jpackage`, for which you should be using at least [JDK 15](https://openjdk.java.net/projects/jdk/15/).
The plugin uses `jpackage`, for which you should be using at least [JDK 17](https://openjdk.java.net/projects/jdk/17/).
Make sure you meet at least one of the following requirements:
* `JAVA_HOME` environment variable points to the compatible JDK version.
* `javaHome` is set via DSL:
``` kotlin
compose.desktop {
application {
javaHome = System.getenv("JDK_15")
javaHome = System.getenv("JDK_17")
}
}
```
Expand Down

0 comments on commit 9540cdc

Please sign in to comment.