From 02c81300ac43cf1d6dee59f3614a053c96fa8e28 Mon Sep 17 00:00:00 2001 From: Nikolay Rykunov Date: Tue, 10 Oct 2023 18:21:22 +0200 Subject: [PATCH] Change artifactId for platform specific part + use proper ide version in sample --- buildSrc/src/main/kotlin/jewel-publish.gradle.kts | 9 ++++++++- ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts | 1 + ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts | 1 + samples/ide-plugin/build.gradle.kts | 8 +++++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/jewel-publish.gradle.kts b/buildSrc/src/main/kotlin/jewel-publish.gradle.kts index e7a20b84e8..8e28842fef 100644 --- a/buildSrc/src/main/kotlin/jewel-publish.gradle.kts +++ b/buildSrc/src/main/kotlin/jewel-publish.gradle.kts @@ -1,5 +1,8 @@ @file:Suppress("UnstableApiUsage") +import SupportedIJVersion.IJ_232 +import SupportedIJVersion.IJ_233 + plugins { kotlin("jvm") `maven-publish` @@ -33,7 +36,11 @@ publishing { from(components["kotlin"]) artifact(javadocJar) artifact(sourcesJar) - version = project.version.toString() + val ijVersionRaw = when (supportedIJVersion()) { + IJ_232 -> "232" + IJ_233 -> "233" + } + version = "${project.version}-ij-$ijVersionRaw" artifactId = "jewel-${project.name}" pom { name = "Jewel" diff --git a/ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts b/ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts index 3a8d6f7127..92fe6f4049 100644 --- a/ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts +++ b/ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts @@ -10,5 +10,6 @@ dependencies { } tasks.withType().configureEach { + publication.artifactId = "jewel-ide-laf-bridge-platform-specific" enabled = supportedIJVersion() == SupportedIJVersion.IJ_232 } \ No newline at end of file diff --git a/ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts b/ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts index 1e17d8916d..445249c22d 100644 --- a/ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts +++ b/ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts @@ -10,5 +10,6 @@ dependencies { } tasks.withType().configureEach { + publication.artifactId = "jewel-ide-laf-bridge-platform-specific" enabled = supportedIJVersion() == SupportedIJVersion.IJ_233 } \ No newline at end of file diff --git a/samples/ide-plugin/build.gradle.kts b/samples/ide-plugin/build.gradle.kts index 8ace71a8fc..6774be3229 100644 --- a/samples/ide-plugin/build.gradle.kts +++ b/samples/ide-plugin/build.gradle.kts @@ -1,3 +1,5 @@ +import SupportedIJVersion.* + plugins { jewel alias(libs.plugins.composeDesktop) @@ -7,7 +9,11 @@ plugins { intellij { pluginName.set("Jewel Demo") plugins.set(listOf("org.jetbrains.kotlin")) - version.set("2023.2.1") + val versionRaw = when (supportedIJVersion()) { + IJ_232 -> libs.versions.idea232.get() + IJ_233 -> libs.versions.idea233.get() + } + version.set(versionRaw) } // TODO remove this once the IJ Gradle plugin fixes their repositories bug