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 @@ -44,7 +44,7 @@ plugins {
kotlin("jvm") version "2.2.0"
id("maven-publish")
id("com.gradle.plugin-publish") version "1.3.1"
id("org.jlleitschuh.gradle.ktlint") version "12.3.0"
id("org.jlleitschuh.gradle.ktlint") version "13.0.0"
}

group = BuildSettings.GROUP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ import org.gradle.api.provider.Provider
* It provides options for specifying the JxBrowser version, repository location,
* and various JxBrowser dependencies based on your project's needs.
*/
public open class JxBrowserExtension(private val project: Project) {
public open class JxBrowserExtension(
private val project: Project,
) {
init {
project.afterEvaluate {
if (!version.isPresent) {
Expand Down Expand Up @@ -185,21 +187,21 @@ public open class JxBrowserExtension(private val project: Project) {
return platformMap.entries.firstOrNull { it.key() }?.value
?: project.providers.provider {
val currentPlatform = "${osName()} ${jvmArch()}"
val errorMessage = "The current $currentPlatform platform is not supported by JxBrowser ${version.get()}"
val errorMessage =
"The current $currentPlatform platform is not supported by JxBrowser ${version.get()}"
throw IllegalStateException(errorMessage)
}
}

private fun artifact(shortName: String): Provider<String> {
return version.map { versionValue ->
private fun artifact(shortName: String): Provider<String> =
version.map { versionValue ->
checkArtifactSupported(shortName, versionValue)
if (shortName == "core") {
"$GROUP:jxbrowser:$versionValue"
} else {
"$GROUP:jxbrowser-$shortName:$versionValue"
}
}
}

/**
* Checks if the artifact with [shortName] exists in JxBrowser [version].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ internal class JxBrowserPluginFunctionalTest {
)

val result =
GradleRunner.create()
GradleRunner
.create()
.withProjectDir(testProjectDir)
.withPluginClasspath()
.withArguments("build")
Expand Down Expand Up @@ -132,7 +133,8 @@ internal class JxBrowserPluginFunctionalTest {
)

val result =
GradleRunner.create()
GradleRunner
.create()
.withProjectDir(testProjectDir)
.withPluginClasspath()
.withArguments(taskName)
Expand Down Expand Up @@ -185,7 +187,8 @@ internal class JxBrowserPluginFunctionalTest {
)

val result =
GradleRunner.create()
GradleRunner
.create()
.withProjectDir(testProjectDir)
.withPluginClasspath()
.withArguments(taskName)
Expand Down Expand Up @@ -220,7 +223,8 @@ internal class JxBrowserPluginFunctionalTest {

val failure =
assertFails {
GradleRunner.create()
GradleRunner
.create()
.withProjectDir(testProjectDir)
.withPluginClasspath()
.withArguments("build")
Expand All @@ -247,7 +251,8 @@ internal class JxBrowserPluginFunctionalTest {

val failure =
assertFails {
GradleRunner.create()
GradleRunner
.create()
.withProjectDir(testProjectDir)
.withPluginClasspath()
.withArguments("check")
Expand Down