Skip to content
Merged
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
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
object BuildSettings {
const val GROUP = "com.teamdev.jxbrowser"
const val VERSION = "2.0.0"
const val JXBROWSER_VERSION = "8.18.3"
const val JXBROWSER_VERSION = "9.0.0"
val javaVersion = JavaVersion.VERSION_1_8
}

Expand Down
29 changes: 21 additions & 8 deletions src/main/kotlin/com/teamdev/jxbrowser/gradle/JxBrowserExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ public open class JxBrowserExtension(
* Returns a dependency notation for the `jxbrowser-kotlin`,
* an artifact with the Kotlin API of the library.
*
* Kotlin API is only supported in JxBrowser 8.x.x.
* Kotlin API is only supported in JxBrowser 8.x.x and newer.
*/
public val kotlin: Provider<String> = artifact("kotlin")

/**
* Returns a dependency notation for the `jxbrowser-compose`,
* an artifact with Compose integration.
*
* Compose is only supported in JxBrowser 8.x.x.
* Compose is only supported in JxBrowser 8.x.x and newer.
*/
public val compose: Provider<String> = artifact("compose")

Expand All @@ -117,6 +117,14 @@ public open class JxBrowserExtension(
*/
public val swt: Provider<String> = artifact("swt")

/**
* Returns a dependency notation for the `jxbrowser-native-image`,
* an artifact containing GraalVM Native Image reachability metadata.
*
* Native images are only supported in JxBrowser 9.x.x and newer.
*/
public val nativeImage: Provider<String> = artifact("native-image")

/**
* Returns a dependency notation for the `jxbrowser-win64`,
* an artifact with Chromium Windows 64-bit binaries.
Expand Down Expand Up @@ -210,12 +218,6 @@ public open class JxBrowserExtension(
shortName: String,
version: String,
) {
val artifactNameToReleaseVersion =
mapOf(
"compose" to "8.0.0",
"kotlin" to "8.0.0",
"win64-arm" to "8.0.0",
)
val artifactReleaseVersion = artifactNameToReleaseVersion[shortName]
if (artifactReleaseVersion != null) {
val releaseVersion = Semver(artifactReleaseVersion)
Expand All @@ -228,5 +230,16 @@ public open class JxBrowserExtension(

private companion object {
private const val GROUP = "com.teamdev.jxbrowser"

/**
* Maps an artifact short name to the first JxBrowser version that supports it.
*/
private val artifactNameToReleaseVersion =
mapOf(
"compose" to "9.0.0",
"kotlin" to "9.0.0",
"win64-arm" to "9.0.0",
"native-image" to "9.0.0",
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ internal class JxBrowserPluginFunctionalTest {
"jxbrowser-kotlin-$jxBrowserVersion.jar",
"jxbrowser-compose-$jxBrowserVersion.jar",
"jxbrowser-win64-arm-$jxBrowserVersion.jar",
"jxbrowser-native-image-$jxBrowserVersion.jar",
)
buildFile.writeText(
"""
Expand Down Expand Up @@ -129,6 +130,7 @@ internal class JxBrowserPluginFunctionalTest {
"toCopy"(jxbrowser.kotlin)
"toCopy"(jxbrowser.compose)
"toCopy"(jxbrowser.winArm)
"toCopy"(jxbrowser.nativeImage)
}

tasks.register<Copy>("$taskName") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ internal class JxBrowserPluginTest {
compose.get() shouldBe "$group:jxbrowser-compose:$jxBrowserVersion"
linux64.get() shouldBe "$group:jxbrowser-linux64:$jxBrowserVersion"
linuxArm.get() shouldBe "$group:jxbrowser-linux64-arm:$jxBrowserVersion"
nativeImage.get() shouldBe "$group:jxbrowser-native-image:$jxBrowserVersion"
crossPlatform.get() shouldBe "$group:jxbrowser-cross-platform:$jxBrowserVersion"
}
}
Expand Down