From 003eb1eed21fc71b5c911e27cbf953d9a149d0ca Mon Sep 17 00:00:00 2001 From: Sebastiano Poggi Date: Fri, 2 Feb 2024 15:07:31 +0100 Subject: [PATCH] Switching to the new branching strategy (#292) Additional branches have been created for 233 and 232. The main branch now tracks 241 EAPs. --- .github/workflows/build.yml | 36 ++--- .github/workflows/check-ide-version.yml | 19 ++- .github/workflows/publish.yml | 40 +++--- .../Check_IJP_version__23_2_.xml | 24 ---- .../Check_IJP_version__23_3_.xml | 24 ---- .idea/runConfigurations/IDE_sample__23_2_.xml | 25 ---- .idea/runConfigurations/IDE_sample__23_3_.xml | 25 ---- .../Run_checks__IJ_23_2_.xml | 24 ---- .../Run_checks__IJ_23_3_.xml | 24 ---- README.md | 126 +++++------------- build.gradle.kts | 2 - buildSrc/src/main/kotlin/IdeaConfiguration.kt | 41 ------ .../src/main/kotlin/SupportedIJVersion.kt | 15 --- .../main/kotlin/jewel-ij-publish.gradle.kts | 63 --------- buildSrc/src/main/kotlin/jewel.gradle.kts | 4 +- .../ideversion/CheckIdeaVersionTask.kt | 19 ++- .../buildlogic/ideversion/CurrentIjpTarget.kt | 15 +++ gradle.properties | 2 + gradle/libs.versions.toml | 22 +-- ide-laf-bridge/api/ide-laf-bridge.api | 15 +++ ide-laf-bridge/build.gradle.kts | 32 ++--- .../api/ide-laf-bridge-232.api | 19 --- .../ide-laf-bridge-232/build.gradle.kts | 16 --- .../jetbrains/jewel/bridge/BridgeIconData.kt | 17 --- .../jetbrains/jewel/bridge/BridgeOverride.kt | 42 ------ .../bridge/BridgePainterHintsProvider.kt | 53 -------- .../jewel/bridge/UiThemeExtensions.kt | 45 ------- .../api/ide-laf-bridge-233.api | 15 --- .../ide-laf-bridge-233/build.gradle.kts | 16 --- .../jetbrains/jewel/bridge/BridgeIconData.kt | 0 .../jetbrains/jewel/bridge/BridgeOverride.kt | 0 .../bridge/BridgePainterHintsProvider.kt | 7 +- .../jewel/bridge/UiThemeExtensions.kt | 0 samples/ide-plugin/build.gradle.kts | 15 +-- samples/standalone/build.gradle.kts | 2 +- settings.gradle.kts | 2 - 36 files changed, 145 insertions(+), 701 deletions(-) delete mode 100644 .idea/runConfigurations/Check_IJP_version__23_2_.xml delete mode 100644 .idea/runConfigurations/Check_IJP_version__23_3_.xml delete mode 100644 .idea/runConfigurations/IDE_sample__23_2_.xml delete mode 100644 .idea/runConfigurations/IDE_sample__23_3_.xml delete mode 100644 .idea/runConfigurations/Run_checks__IJ_23_2_.xml delete mode 100644 .idea/runConfigurations/Run_checks__IJ_23_3_.xml delete mode 100644 buildSrc/src/main/kotlin/IdeaConfiguration.kt delete mode 100644 buildSrc/src/main/kotlin/SupportedIJVersion.kt delete mode 100644 buildSrc/src/main/kotlin/jewel-ij-publish.gradle.kts create mode 100644 buildSrc/src/main/kotlin/org/jetbrains/jewel/buildlogic/ideversion/CurrentIjpTarget.kt delete mode 100644 ide-laf-bridge/ide-laf-bridge-232/api/ide-laf-bridge-232.api delete mode 100644 ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts delete mode 100644 ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeIconData.kt delete mode 100644 ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeOverride.kt delete mode 100644 ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt delete mode 100644 ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/UiThemeExtensions.kt delete mode 100644 ide-laf-bridge/ide-laf-bridge-233/api/ide-laf-bridge-233.api delete mode 100644 ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts rename ide-laf-bridge/{ide-laf-bridge-233 => }/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeIconData.kt (100%) rename ide-laf-bridge/{ide-laf-bridge-233 => }/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeOverride.kt (100%) rename ide-laf-bridge/{ide-laf-bridge-233 => }/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt (88%) rename ide-laf-bridge/{ide-laf-bridge-233 => }/src/main/kotlin/org/jetbrains/jewel/bridge/UiThemeExtensions.kt (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00c86bcf9..5760faeb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,52 +8,40 @@ jobs: assemble: runs-on: ubuntu-latest - strategy: - matrix: - supported-ij-version: - - 232 - - 233 - - 241 - steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - java-version: '17' - distribution: 'zulu' + java-version: 17 + distribution: zulu cache: gradle - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Run :assemble task - run: ./gradlew assemble -Psupported.ij.version=${{ matrix.supported-ij-version }} + run: ./gradlew assemble checks: runs-on: ubuntu-latest - strategy: - matrix: - supported-ij-version: - - 232 - - 233 - - 241 - steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - java-version: '17' - distribution: 'zulu' + java-version: 17 + distribution: zulu cache: gradle - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Run :check task - run: ./gradlew check -Psupported.ij.version=${{ matrix.supported-ij-version }} --continue + run: ./gradlew check --continue - uses: github/codeql-action/upload-sarif@v2 if: ${{ always() }} diff --git a/.github/workflows/check-ide-version.yml b/.github/workflows/check-ide-version.yml index 7bc62e987..0b29b6780 100644 --- a/.github/workflows/check-ide-version.yml +++ b/.github/workflows/check-ide-version.yml @@ -12,19 +12,24 @@ jobs: strategy: matrix: - supported-ij-version: - - 232 - - 233 - - 241 + branch-name: + - releases/232 + - releases/233 + - main steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch-name }} + + - uses: actions/setup-java@v4 with: distribution: zulu java-version: 17 cache: gradle + - name: Setup Gradle run: chmod +x gradlew + - name: Run Gradle - run: ./gradlew checkLatestIntelliJPlatformBuild -Psupported.ij.version=${{ matrix.supported-ij-version }} + run: ./gradlew checkLatestIntelliJPlatformBuild diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e7f5947be..5325b74b0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,51 +4,59 @@ on: release: types: [ published ] push: - branches: [ main ] + branches: + - main + - 'releases/**' jobs: - publish-core: - name: Publish Jewel Core + publish-current: + name: Publish standalone & current-IJP-version bridge runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 with: distribution: zulu java-version: 17 cache: gradle + - name: Setup Gradle run: chmod +x gradlew + - name: Run Gradle - # supported.ij.version is needed here for project configuration and won't be used during publishing - run: ./gradlew publishMainPublicationToSpaceRepository -Psupported.ij.version=232 + run: ./gradlew publishMainPublicationToSpaceRepository env: MAVEN_SPACE_USERNAME: ${{secrets.MAVEN_SPACE_USERNAME}} MAVEN_SPACE_PASSWORD: ${{secrets.MAVEN_SPACE_PASSWORD}} - publish-ide: - name: Publish Jewel IDE part - needs: publish-core + publish-older: + name: Publish older-IJP-version bridge(s) runs-on: ubuntu-latest strategy: matrix: - supported-ij-version: - - 232 - - 233 + branch-name: + - releases/232 + - releases/233 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch-name }} + + - uses: actions/setup-java@v4 with: distribution: zulu java-version: 17 cache: gradle + - name: Setup Gradle run: chmod +x gradlew + - name: Run Gradle - run: ./gradlew publishIdeMainPublicationToSpaceRepository -Psupported.ij.version=${{ matrix.supported-ij-version }} + run: ./gradlew :ide-laf-bridge:publishMainPublicationToSpaceRepository env: MAVEN_SPACE_USERNAME: ${{secrets.MAVEN_SPACE_USERNAME}} MAVEN_SPACE_PASSWORD: ${{secrets.MAVEN_SPACE_PASSWORD}} diff --git a/.idea/runConfigurations/Check_IJP_version__23_2_.xml b/.idea/runConfigurations/Check_IJP_version__23_2_.xml deleted file mode 100644 index 3ae6caca2..000000000 --- a/.idea/runConfigurations/Check_IJP_version__23_2_.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - true - true - false - false - - - \ No newline at end of file diff --git a/.idea/runConfigurations/Check_IJP_version__23_3_.xml b/.idea/runConfigurations/Check_IJP_version__23_3_.xml deleted file mode 100644 index 27eefaf44..000000000 --- a/.idea/runConfigurations/Check_IJP_version__23_3_.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - true - true - false - false - - - \ No newline at end of file diff --git a/.idea/runConfigurations/IDE_sample__23_2_.xml b/.idea/runConfigurations/IDE_sample__23_2_.xml deleted file mode 100644 index 62ae7ff01..000000000 --- a/.idea/runConfigurations/IDE_sample__23_2_.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - true - true - false - false - - - \ No newline at end of file diff --git a/.idea/runConfigurations/IDE_sample__23_3_.xml b/.idea/runConfigurations/IDE_sample__23_3_.xml deleted file mode 100644 index 9f87e27f3..000000000 --- a/.idea/runConfigurations/IDE_sample__23_3_.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - true - true - false - false - - - diff --git a/.idea/runConfigurations/Run_checks__IJ_23_2_.xml b/.idea/runConfigurations/Run_checks__IJ_23_2_.xml deleted file mode 100644 index 542a071f1..000000000 --- a/.idea/runConfigurations/Run_checks__IJ_23_2_.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - true - true - false - false - - - \ No newline at end of file diff --git a/.idea/runConfigurations/Run_checks__IJ_23_3_.xml b/.idea/runConfigurations/Run_checks__IJ_23_3_.xml deleted file mode 100644 index be12c0cea..000000000 --- a/.idea/runConfigurations/Run_checks__IJ_23_3_.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - true - true - false - false - - - \ No newline at end of file diff --git a/README.md b/README.md index 38463bb1a..da6bc9cf4 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ For an **IntelliJ Platform plugin**, then you should depend on the appropriate ` ```kotlin dependencies { // The platform version is a supported major IJP version (e.g., 232 or 233 for 2023.2 and 2023.3 respectively) - implementation("org.jetbrains.jewel:jewel-ide-laf-bridge:[jewel version]-ij-[platform version]") + implementation("org.jetbrains.jewel:jewel-ide-laf-bridge-[platform version]:[jewel version]") } ``` @@ -96,55 +96,36 @@ The project is split in modules: * `int-ui-decorated-window` has a standalone version of the Int UI styling values for the custom window decoration that can be used in any Compose for Desktop app 6. `ide-laf-bridge` contains the Swing LaF bridge to use in IntelliJ Platform plugins (see more below) - * The `ide-laf-bridge-*` sub-modules contain code that is specific to a certain IntelliJ Platform version 7. `samples` contains the example apps, which showcase the available components: * `standalone` is a regular CfD app, using the standalone theme definitions and custom window decoration * `ide-plugin` is an IntelliJ plugin that showcases the use of the Swing Bridge -### Int UI Standalone theme +## Branching strategy and IJ Platforms -The standalone theme can be used in any Compose for Desktop app. You use it as a normal theme, and you can customise it -to your heart's content. By default, it matches the official Int UI specs. +Code on the main branch is developed and tested against the current latest IntelliJ Platform version. -Your setup in `build.gradle.kts` should look something like this, assuming you use version catalogs: - -```kotlin -plugins { - kotlin("jvm") - alias(libs.plugins.composeDesktop) -} +When the EAP for a new major version starts, we cut a `releases/xxx` release branch, where `xxx` is the tracked major +IJP version. At that point, the main branch starts tracking the latest available major IJP version, and changes are +cherry-picked into each release branch as needed. All active release branches have the same functionality (where +supported by the corresponding IJP version), but might differ in platform version-specific fixes and internals. -java { - toolchain { - vendor = JvmVendorSpec.JETBRAINS - languageVersion = 21 - } -} +The standalone Int UI theme will always work the same way as the latest major IJP version; release branches will not +include the `int-ui` module, which is always released from the main branch. -kotlin { - jvmToolchain { - vendor = JvmVendorSpec.JETBRAINS - languageVersion = 21 - } -} +Releases of Jewel are always cut from a tag on the main branch; the HEAD of each `releases/xxx` branch is then tagged +as `[mainTag]-xxx`, and used to publish the artifacts for that major IJP version. -repositories { - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - mavenCentral() -} +> ![IMPORTANT] +> We only support the latest build of IJP for each major IJP version. If the latest 233 version is 2023.3.3, for +> example, we will only guarantee that Jewel works on that. Versions 2023.3.0–2023.3.2 might or might not work. -dependencies { - implementation(libs.jewel.intUi.standalone) - implementation(libs.jewel.intUi.decoratedWindow) // Optional +### Int UI Standalone theme - implementation(compose.desktop.currentOs) { - // Exclude Material components — we don't need them - exclude(group = "org.jetbrains.compose.material") - } -} -``` +The standalone theme can be used in any Compose for Desktop app. You use it as a normal theme, and you can customise it +to your heart's content. By default, it matches the official Int UI specs. -For further information, you can refer to the [`standalone` sample](samples/standalone/build.gradle.kts). +For an example on how to set up a standalone app, you can refer to +the [`standalone` sample](samples/standalone/build.gradle.kts). > [!WARNING] > Note that Jewel **requires** the JetBrains Runtime to work correctly. Some features like font loading depend on it, @@ -216,66 +197,19 @@ SwingBridgeTheme { #### Supported IntelliJ Platform versions -To use Jewel in the IntelliJ Platform, you should depend on the appropriate `ide-laf-bridge-*` artifact, which will -bring in the necessary transitive dependencies. - -| IntelliJ Platform version(s) | Artifact to use | - |------------------------------|----------------------| -| 2023.3 and 2024.1 | `ide-laf-bridge-233` | -| 2023.2 | `ide-laf-bridge-232` | -| 2023.1 or older | **Not supported** | +To use Jewel in the IntelliJ Platform, you should depend on the appropriate `jewel-ide-laf-bridge-*` artifact, which +will bring in the necessary transitive dependencies. These are the currently supported versions of the IntelliJ Platform +and the branch on which the corresponding bridge code lives: -> [!CAUTION] -> In the IntelliJ Platform 2024.1, to be able to use Jewel, you need to shadow both Jewel and Compose, due to -> potential clashes with the versions bundled in the platform. You can use the -> [Package Search plugin](https://github.com/JetBrains/package-search-intellij-plugin) as a reference on how to do it. - -Your setup in `build.gradle.kts` should look something like this, assuming you use version catalogs: - -```kotlin -plugins { - kotlin("jvm") - alias(libs.plugins.composeDesktop) - alias(libs.plugins.ideaGradlePlugin) -} - -java { - toolchain { - vendor = JvmVendorSpec.JETBRAINS - languageVersion = 17 // Or 21, if you're targeting IJ 2024.1 or later - } -} - -kotlin { - jvmToolchain { - vendor = JvmVendorSpec.JETBRAINS - languageVersion = 17 // Or 21, if you're targeting IJ 2024.1 or later - } -} - -repositories { - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - maven("https://www.jetbrains.com/intellij-repository/snapshots") - maven("https://www.jetbrains.com/intellij-repository/releases") - maven("https://cache-redirector.jetbrains.com/intellij-dependencies") - mavenCentral() -} - -dependencies { - implementation(libs.jewel.ideLafBridge) { - // Exclude any coroutines dependency that might be coming through — the IDE has its own - exclude(group = "org.jetbrains.kotlinx") - } - - implementation(compose.desktop.currentOs) { - // Exclude Material components — we don't need them - exclude(group = "org.jetbrains.compose.material") - exclude(group = "org.jetbrains.kotlinx") - } -} -``` +| IntelliJ Platform version(s) | Branch to use | + |------------------------------|-------------------| +| 2024.1 (EAP 3+) | `main` | +| 2023.3 | `releases/233` | +| 2023.2 | `releases/232` | +| 2023.1 or older | **Not supported** | -For further information, you can refer to the [`ide-plugin` sample](samples/ide-plugin/build.gradle.kts). +For an example on how to set up an IntelliJ Plugin, you can refer to +the [`ide-plugin` sample](samples/ide-plugin/build.gradle.kts). #### Accessing icons diff --git a/build.gradle.kts b/build.gradle.kts index d60312b3a..d698907af 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,6 @@ dependencies { sarif(projects.decoratedWindow) sarif(projects.foundation) sarif(projects.ideLafBridge) - sarif(projects.ideLafBridge.ideLafBridge232) - sarif(projects.ideLafBridge.ideLafBridge233) sarif(projects.intUi.intUiDecoratedWindow) sarif(projects.intUi.intUiStandalone) sarif(projects.samples.idePlugin) diff --git a/buildSrc/src/main/kotlin/IdeaConfiguration.kt b/buildSrc/src/main/kotlin/IdeaConfiguration.kt deleted file mode 100644 index 86435ce0f..000000000 --- a/buildSrc/src/main/kotlin/IdeaConfiguration.kt +++ /dev/null @@ -1,41 +0,0 @@ -import org.gradle.api.Project -import org.gradle.api.provider.Property -import org.gradle.jvm.toolchain.JavaLanguageVersion -import java.util.concurrent.atomic.AtomicBoolean - -private var warned = AtomicBoolean(false) - -fun Project.supportedIJVersion(): SupportedIJVersion { - val prop = kotlin.runCatching { - rootProject.findProperty("supported.ij.version")?.toString() - ?: localProperty("supported.ij.version") - }.getOrNull() - - if (prop == null) { - if (!warned.getAndSet(true)) { - logger.warn( - """ - No 'supported.ij.version' property provided. Falling back to IJ 241. - It is recommended to provide it using the local.properties file or - -Psupported.ij.version to avoid unexpected behavior. - """.trimIndent() - ) - } - return SupportedIJVersion.IJ_241 - } - - return when (prop) { - "232" -> SupportedIJVersion.IJ_232 - "233" -> SupportedIJVersion.IJ_233 - "241" -> SupportedIJVersion.IJ_241 - else -> error( - "Invalid 'supported.ij.version' with value '$prop' is provided. " + - "It should be one of these values: " + - SupportedIJVersion.values().joinToString(", ") { it.rawPlatformVersion } - ) - } -} - -@Suppress("unused") // Used to set the Java toolchain version -fun Property.assign(version: Int) = - set(JavaLanguageVersion.of(version)) diff --git a/buildSrc/src/main/kotlin/SupportedIJVersion.kt b/buildSrc/src/main/kotlin/SupportedIJVersion.kt deleted file mode 100644 index 9fee91589..000000000 --- a/buildSrc/src/main/kotlin/SupportedIJVersion.kt +++ /dev/null @@ -1,15 +0,0 @@ -enum class SupportedIJVersion( - /** Human-readable major platform version. E.g., `2023.3` */ - val majorPlatformVersion: String, - /** Raw major platform version. E.g., `233` */ - val rawPlatformVersion: String, - /** If true, this platform version has its dedicated bridge artifact. */ - val hasBridgeArtifact: Boolean, - /** The JDK version to use. */ - val jdkVersion: Int, -) { - - IJ_232("2023.2", "232", true, 17), - IJ_233("2023.3", "233", true, 17), - IJ_241("2024.1", "241", false, 17), -} diff --git a/buildSrc/src/main/kotlin/jewel-ij-publish.gradle.kts b/buildSrc/src/main/kotlin/jewel-ij-publish.gradle.kts deleted file mode 100644 index a21ad64f3..000000000 --- a/buildSrc/src/main/kotlin/jewel-ij-publish.gradle.kts +++ /dev/null @@ -1,63 +0,0 @@ -@file:Suppress("UnstableApiUsage") - -import gradle.kotlin.dsl.accessors._7527f81e50bfbc9f72561cc0d0801284.dokkaHtml -import gradle.kotlin.dsl.accessors._7527f81e50bfbc9f72561cc0d0801284.kotlin -import gradle.kotlin.dsl.accessors._7527f81e50bfbc9f72561cc0d0801284.main -import gradle.kotlin.dsl.accessors._7527f81e50bfbc9f72561cc0d0801284.publishing - -plugins { - kotlin("jvm") - `maven-publish` - id("org.jetbrains.dokka") -} - -val sourcesJar by tasks.registering(Jar::class) { - from(kotlin.sourceSets.main.map { it.kotlin }) - archiveClassifier = "sources" - destinationDirectory = layout.buildDirectory.dir("artifacts") -} - -val javadocJar by tasks.registering(Jar::class) { - from(tasks.dokkaHtml) - archiveClassifier = "javadoc" - destinationDirectory = layout.buildDirectory.dir("artifacts") -} - -publishing { - configureJewelRepositories() - - publications { - val ijpVersion = supportedIJVersion() - - if (ijpVersion.hasBridgeArtifact) { - register("IdeMain") { - from(components["kotlin"]) - artifact(javadocJar) - artifact(sourcesJar) - - val ijVersionRaw = ijpVersion.rawPlatformVersion - version = project.version.toString().withVersionSuffix("ij-$ijVersionRaw") - artifactId = "jewel-${project.name}" - pom { configureJewelPom() } - } - } - } -} - -/** - * Adds suffix to the version taking SNAPSHOT suffix into account - * - * For example, if [this] is "0.0.1-SNAPSHOT" and [suffix] is "ij-233" then - * the result will be "0.0.1-ij-233-SNAPSHOT" - */ -fun String.withVersionSuffix(suffix: String): String { - val splitString = this.split('-') - val snapshotRaw = "SNAPSHOT" - val withSnapshot = splitString.contains(snapshotRaw) - - if (!withSnapshot) return "$this-$suffix" - - val withoutSnapshot = splitString.filter { it != snapshotRaw }.joinToString("-") - - return "$withoutSnapshot-$suffix-$snapshotRaw" -} diff --git a/buildSrc/src/main/kotlin/jewel.gradle.kts b/buildSrc/src/main/kotlin/jewel.gradle.kts index b991aa4ce..ee92d92f2 100644 --- a/buildSrc/src/main/kotlin/jewel.gradle.kts +++ b/buildSrc/src/main/kotlin/jewel.gradle.kts @@ -19,14 +19,14 @@ version = when { java { toolchain { vendor = JvmVendorSpec.JETBRAINS - languageVersion = supportedIJVersion().jdkVersion + languageVersion = JavaLanguageVersion.of(17) } } kotlin { jvmToolchain { vendor = JvmVendorSpec.JETBRAINS - languageVersion = supportedIJVersion().jdkVersion + languageVersion = JavaLanguageVersion.of(17) } target { diff --git a/buildSrc/src/main/kotlin/org/jetbrains/jewel/buildlogic/ideversion/CheckIdeaVersionTask.kt b/buildSrc/src/main/kotlin/org/jetbrains/jewel/buildlogic/ideversion/CheckIdeaVersionTask.kt index 6e96474d0..735a73469 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/jewel/buildlogic/ideversion/CheckIdeaVersionTask.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/jewel/buildlogic/ideversion/CheckIdeaVersionTask.kt @@ -1,12 +1,10 @@ package org.jetbrains.jewel.buildlogic.ideversion -import SupportedIJVersion import kotlinx.serialization.json.Json import kotlinx.serialization.json.decodeFromStream import org.gradle.api.DefaultTask import org.gradle.api.GradleException import org.gradle.api.tasks.TaskAction -import supportedIJVersion import java.io.IOException import java.net.URL @@ -20,11 +18,10 @@ open class CheckIdeaVersionTask : DefaultTask() { private val versionRegex = "2\\d{2}\\.\\d+\\.\\d+(?:-EAP-SNAPSHOT)?".toRegex(RegexOption.IGNORE_CASE) + private val currentIjpVersion = project.currentIjpVersion + init { group = "jewel" - - val currentPlatformVersion = project.supportedIJVersion() - enabled = project.name.endsWith(currentPlatformVersion.rawPlatformVersion) } @TaskAction @@ -55,9 +52,8 @@ open class CheckIdeaVersionTask : DefaultTask() { check(icReleases.code == "IIC") { "Was expecting code IIC but was ${icReleases.code}" } check(icReleases.releases.isNotEmpty()) { "Was expecting to have releases but the list is empty" } - val currentPlatformVersion = project.supportedIJVersion() - val majorPlatformVersion = currentPlatformVersion.majorPlatformVersion - val rawPlatformBuild = readPlatformBuild(currentPlatformVersion) + val majorPlatformVersion = asMajorPlatformVersion(currentIjpVersion) + val rawPlatformBuild = readPlatformBuild() val isCurrentBuildStable = !rawPlatformBuild.contains("EAP") val latestAvailableBuild = @@ -86,9 +82,12 @@ open class CheckIdeaVersionTask : DefaultTask() { logger.lifecycle("No IntelliJ Platform version updates available. Current: $currentPlatformBuild") } - private fun readPlatformBuild(platformVersion: SupportedIJVersion): String { + private fun asMajorPlatformVersion(rawVersion: String) = + "20${rawVersion.take(2)}.${rawVersion.last()}" + + private fun readPlatformBuild(): String { val catalogFile = project.rootProject.file("gradle/libs.versions.toml") - val dependencyName = "idea${platformVersion.rawPlatformVersion}" + val dependencyName = "idea" val catalogDependencyLine = catalogFile.useLines { lines -> lines.find { it.startsWith(dependencyName) } } diff --git a/buildSrc/src/main/kotlin/org/jetbrains/jewel/buildlogic/ideversion/CurrentIjpTarget.kt b/buildSrc/src/main/kotlin/org/jetbrains/jewel/buildlogic/ideversion/CurrentIjpTarget.kt new file mode 100644 index 000000000..9bb9e0032 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/jewel/buildlogic/ideversion/CurrentIjpTarget.kt @@ -0,0 +1,15 @@ +package org.jetbrains.jewel.buildlogic.ideversion + +import org.gradle.api.Project + +val Project.currentIjpVersion: String + get() { + val rawValue = property("bridge.ijp.target") as? String + ?: error("Property bridge.ijp.target not defined. Check your gradle.properties!") + + if (rawValue.length != 3 || rawValue.toIntOrNull()?.let { it < 0 } == true) { + error("Invalid bridge.ijp.target property value: '$rawValue'") + } + + return rawValue + } diff --git a/gradle.properties b/gradle.properties index 26e4b28b9..2ce2eecdc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,3 +5,5 @@ kotlin.stdlib.default.dependency=false # Avoid using incremental classpath snapshot until we upgrade to Kotlin 1.9.0+ # See https://jb.gg/intellij-platform-kotlin-oom kotlin.incremental.useClasspathSnapshot=false + +bridge.ijp.target=241 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cf0aa024e..aa0097a6a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,9 +2,7 @@ composeDesktop = "1.6.0-dev1397" detekt = "1.23.4" dokka = "1.8.20" -idea232 = "232.10227.8" -idea233 = "233.14015.106" -idea241 = "241.9959.31-EAP-SNAPSHOT" +idea = "241.9959.31-EAP-SNAPSHOT" ideaGradlePlugin = "1.17.0" jna = "5.14.0" kotlin = "1.8.21" @@ -20,17 +18,9 @@ kotlinSarif = { module = "io.github.detekt.sarif4k:sarif4k", version.ref = "kotl kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" } -ij-platform-ide-core-232 = { module = "com.jetbrains.intellij.platform:ide-core", version.ref = "idea232" } -ij-platform-ide-impl-232 = { module = "com.jetbrains.intellij.platform:ide-impl", version.ref = "idea232" } -ij-platform-core-ui-232 = { module = "com.jetbrains.intellij.platform:core-ui", version.ref = "idea232" } - -ij-platform-ide-core-233 = { module = "com.jetbrains.intellij.platform:ide-core", version.ref = "idea233" } -ij-platform-ide-impl-233 = { module = "com.jetbrains.intellij.platform:ide-impl", version.ref = "idea233" } -ij-platform-core-ui-233 = { module = "com.jetbrains.intellij.platform:core-ui", version.ref = "idea233" } - -ij-platform-ide-core-241 = { module = "com.jetbrains.intellij.platform:ide-core", version.ref = "idea241" } -ij-platform-ide-impl-241 = { module = "com.jetbrains.intellij.platform:ide-impl", version.ref = "idea241" } -ij-platform-core-ui-241 = { module = "com.jetbrains.intellij.platform:core-ui", version.ref = "idea241" } +ij-platform-ide-core = { module = "com.jetbrains.intellij.platform:ide-core", version.ref = "idea" } +ij-platform-ide-impl = { module = "com.jetbrains.intellij.platform:ide-impl", version.ref = "idea" } +ij-platform-core-ui = { module = "com.jetbrains.intellij.platform:core-ui", version.ref = "idea" } jna-core = { module = "net.java.dev.jna:jna", version.ref = "jna" } @@ -44,9 +34,7 @@ kotlinx-binaryCompatValidator-gradlePlugin = { module = "org.jetbrains.kotlinx:b poko-gradlePlugin = { module = "dev.drewhamilton.poko:poko-gradle-plugin", version.ref = "poko" } [bundles] -idea232 = ["ij-platform-ide-core-232", "ij-platform-ide-impl-232", "ij-platform-core-ui-232"] -idea233 = ["ij-platform-ide-core-233", "ij-platform-ide-impl-233", "ij-platform-core-ui-233"] -idea241 = ["ij-platform-ide-core-241", "ij-platform-ide-impl-241", "ij-platform-core-ui-241"] +idea = ["ij-platform-ide-core", "ij-platform-ide-impl", "ij-platform-core-ui"] [plugins] composeDesktop = { id = "org.jetbrains.compose", version.ref = "composeDesktop" } diff --git a/ide-laf-bridge/api/ide-laf-bridge.api b/ide-laf-bridge/api/ide-laf-bridge.api index bc48290e0..b0d51fad0 100644 --- a/ide-laf-bridge/api/ide-laf-bridge.api +++ b/ide-laf-bridge/api/ide-laf-bridge.api @@ -1,3 +1,18 @@ +public final class org/jetbrains/jewel/bridge/BridgeIconDataKt { + public static final fun readFromLaF (Lorg/jetbrains/jewel/foundation/theme/ThemeIconData$Companion;)Lorg/jetbrains/jewel/foundation/theme/ThemeIconData; +} + +public final class org/jetbrains/jewel/bridge/BridgePainterHintsProvider : org/jetbrains/jewel/ui/painter/BasePainterHintsProvider { + public static final field $stable I + public static final field Companion Lorg/jetbrains/jewel/bridge/BridgePainterHintsProvider$Companion; + public synthetic fun (ZLjava/util/Map;Ljava/util/Map;Ljava/util/Map;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun hints (Ljava/lang/String;Landroidx/compose/runtime/Composer;I)Ljava/util/List; +} + +public final class org/jetbrains/jewel/bridge/BridgePainterHintsProvider$Companion { + public final fun invoke (Z)Lorg/jetbrains/jewel/ui/painter/BasePainterHintsProvider; +} + public final class org/jetbrains/jewel/bridge/BridgeResourceResolverKt { public static final fun bridgePainterProvider (Ljava/lang/String;)Lorg/jetbrains/jewel/ui/painter/ResourcePainterProvider; } diff --git a/ide-laf-bridge/build.gradle.kts b/ide-laf-bridge/build.gradle.kts index 75a58aeb6..90a55b7a6 100644 --- a/ide-laf-bridge/build.gradle.kts +++ b/ide-laf-bridge/build.gradle.kts @@ -1,38 +1,28 @@ -import SupportedIJVersion.IJ_232 -import SupportedIJVersion.IJ_233 -import SupportedIJVersion.IJ_241 - plugins { jewel - `jewel-ij-publish` + `jewel-publish` `jewel-check-public-api` + `ide-version-checker` alias(libs.plugins.composeDesktop) } +val bridgeIjpTarget = project.property("bridge.ijp.target") as String + dependencies { api(projects.ui) { exclude(group = "org.jetbrains.kotlinx") } - when (supportedIJVersion()) { - IJ_232 -> { - api(projects.ideLafBridge.ideLafBridge232) - compileOnly(libs.bundles.idea232) - } - - IJ_233 -> { - api(projects.ideLafBridge.ideLafBridge233) - compileOnly(libs.bundles.idea233) - } - - IJ_241 -> { - api(projects.ideLafBridge.ideLafBridge233) - compileOnly(libs.bundles.idea241) - } - } + compileOnly(libs.bundles.idea) testImplementation(compose.desktop.uiTestJUnit4) testImplementation(compose.desktop.currentOs) { exclude(group = "org.jetbrains.compose.material") } } + +publishing.publications { + named("main") { + artifactId = "jewel-${project.name}-$bridgeIjpTarget" + } +} diff --git a/ide-laf-bridge/ide-laf-bridge-232/api/ide-laf-bridge-232.api b/ide-laf-bridge/ide-laf-bridge-232/api/ide-laf-bridge-232.api deleted file mode 100644 index 1a22c7f84..000000000 --- a/ide-laf-bridge/ide-laf-bridge-232/api/ide-laf-bridge-232.api +++ /dev/null @@ -1,19 +0,0 @@ -public final class org/jetbrains/jewel/bridge/BridgeIconDataKt { - public static final fun readFromLaF (Lorg/jetbrains/jewel/foundation/theme/ThemeIconData$Companion;)Lorg/jetbrains/jewel/foundation/theme/ThemeIconData; -} - -public final class org/jetbrains/jewel/bridge/BridgePainterHintsProvider : org/jetbrains/jewel/ui/painter/BasePainterHintsProvider { - public static final field $stable I - public static final field Companion Lorg/jetbrains/jewel/bridge/BridgePainterHintsProvider$Companion; - public synthetic fun (ZLjava/util/Map;Ljava/util/Map;Ljava/util/Map;Lkotlin/jvm/internal/DefaultConstructorMarker;)V - public fun hints (Ljava/lang/String;Landroidx/compose/runtime/Composer;I)Ljava/util/List; -} - -public final class org/jetbrains/jewel/bridge/BridgePainterHintsProvider$Companion { - public final fun invoke (Z)Lorg/jetbrains/jewel/ui/painter/BasePainterHintsProvider; -} - -public final class org/jetbrains/jewel/bridge/UiThemeExtensionsKt { - public static final fun getIcons (Lcom/intellij/ide/ui/UITheme;)Ljava/util/Map; -} - diff --git a/ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts b/ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts deleted file mode 100644 index cc51b7122..000000000 --- a/ide-laf-bridge/ide-laf-bridge-232/build.gradle.kts +++ /dev/null @@ -1,16 +0,0 @@ -plugins { - jewel - `jewel-ij-publish` - `ide-version-checker` - alias(libs.plugins.composeDesktop) -} - -dependencies { - api(projects.ui) - compileOnly(libs.bundles.idea232) -} - -tasks.withType().configureEach { - publication.artifactId = "jewel-ide-laf-bridge-platform-specific" - enabled = supportedIJVersion() == SupportedIJVersion.IJ_232 -} diff --git a/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeIconData.kt b/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeIconData.kt deleted file mode 100644 index fb6627088..000000000 --- a/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeIconData.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.jetbrains.jewel.bridge - -import com.intellij.ide.ui.UITheme -import com.intellij.ui.ColorUtil -import org.jetbrains.jewel.foundation.InternalJewelApi -import org.jetbrains.jewel.foundation.theme.ThemeIconData - -@OptIn(InternalJewelApi::class) -public fun ThemeIconData.Companion.readFromLaF(): ThemeIconData { - val uiTheme = currentUiThemeOrNull() - val iconMap = uiTheme?.icons.orEmpty() - val selectedIconColorPalette = uiTheme?.selectedIconColorPalette.orEmpty() - .mapValues { ColorUtil.fromHex(it.value).rgb } - - val colorPalette = UITheme.getColorPalette() - return ThemeIconData(iconMap, colorPalette, selectedIconColorPalette) -} diff --git a/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeOverride.kt b/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeOverride.kt deleted file mode 100644 index 365194289..000000000 --- a/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeOverride.kt +++ /dev/null @@ -1,42 +0,0 @@ -package org.jetbrains.jewel.bridge - -import com.intellij.util.ui.DirProvider -import org.jetbrains.jewel.ui.painter.PainterPathHint -import org.jetbrains.jewel.ui.painter.PainterProviderScope -import org.jetbrains.jewel.ui.painter.ResourcePainterProviderScope - -internal object BridgeOverride : PainterPathHint { - - private val dirProvider = DirProvider() - - private val patchIconPath by lazy { - val clazz = Class.forName("com.intellij.ui.icons.CachedImageIconKt") - val patchIconPath = - clazz.getMethod("patchIconPath", String::class.java, ClassLoader::class.java) - patchIconPath.isAccessible = true - patchIconPath - } - - override fun PainterProviderScope.patch(): String { - if (this !is ResourcePainterProviderScope) return path - - // For all provided classloaders, we try to get the patched path, both using - // the original path, and an "abridged" path that has gotten the icon path prefix - // removed (the classloader is set up differently in prod IDEs and when running - // from Gradle, and the icon could be in either place depending on the environment) - val fallbackPath = path.removePrefix(dirProvider.dir()) - val patchedPath = - classLoaders - .firstNotNullOfOrNull { classLoader -> - val patchedPathAndClassLoader = - patchIconPath.invoke(null, path.removePrefix("/"), classLoader) - ?: patchIconPath.invoke(null, fallbackPath, classLoader) - patchedPathAndClassLoader as? Pair<*, *> - } - ?.first as? String - - return patchedPath ?: path - } - - override fun toString(): String = "BridgeOverride" -} diff --git a/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt b/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt deleted file mode 100644 index 6f600491c..000000000 --- a/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt +++ /dev/null @@ -1,53 +0,0 @@ -package org.jetbrains.jewel.bridge - -import androidx.compose.runtime.Composable -import androidx.compose.ui.graphics.Color -import com.intellij.ide.ui.UITheme -import com.intellij.openapi.diagnostic.thisLogger -import org.jetbrains.jewel.foundation.InternalJewelApi -import org.jetbrains.jewel.foundation.theme.JewelTheme -import org.jetbrains.jewel.ui.painter.BasePainterHintsProvider -import org.jetbrains.jewel.ui.painter.PainterHint -import org.jetbrains.jewel.ui.painter.hints.Dark -import org.jetbrains.jewel.ui.painter.hints.HiDpi -import org.jetbrains.jewel.ui.util.fromRGBAHexStringOrNull - -@InternalJewelApi -public class BridgePainterHintsProvider private constructor( - isDark: Boolean, - intellijIconPalette: Map = emptyMap(), - themeIconPalette: Map = emptyMap(), - themeColorPalette: Map = emptyMap(), -) : BasePainterHintsProvider(isDark, intellijIconPalette, themeIconPalette, themeColorPalette) { - - @Composable - override fun hints(path: String): List = buildList { - add(getPaletteHint(path)) - add(BridgeOverride) - add(HiDpi()) - add(Dark(JewelTheme.isDark)) - } - - public companion object { - - private val logger = thisLogger() - - public operator fun invoke(isDark: Boolean): BasePainterHintsProvider { - val uiTheme = currentUiThemeOrNull() ?: return BridgePainterHintsProvider(isDark) - logger.info("Parsing theme info from theme ${uiTheme.name} (id: ${uiTheme.id}, isDark: ${uiTheme.isDark})") - - val iconColorPalette = uiTheme.iconColorPalette - val keyPalette = UITheme.getColorPalette() - val themeColors = uiTheme.colors.orEmpty() - .mapValues { (_, v) -> - when (v) { - is Int -> Color(v) - is String -> Color.fromRGBAHexStringOrNull(v) - else -> null - } - } - - return BridgePainterHintsProvider(isDark, keyPalette, iconColorPalette, themeColors) - } - } -} diff --git a/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/UiThemeExtensions.kt b/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/UiThemeExtensions.kt deleted file mode 100644 index c4a75d91a..000000000 --- a/ide-laf-bridge/ide-laf-bridge-232/src/main/kotlin/org/jetbrains/jewel/bridge/UiThemeExtensions.kt +++ /dev/null @@ -1,45 +0,0 @@ -package org.jetbrains.jewel.bridge - -import com.intellij.ide.ui.LafManager -import com.intellij.ide.ui.UITheme -import com.intellij.ide.ui.laf.UIThemeBasedLookAndFeelInfo -import com.intellij.openapi.diagnostic.Logger -import org.jetbrains.jewel.foundation.InternalJewelApi -import java.lang.reflect.Field - -private val logger = Logger.getInstance("UiThemeExtensions") - -private val classUITheme - get() = UITheme::class.java - -@InternalJewelApi -internal fun currentUiThemeOrNull() = - (LafManager.getInstance().currentLookAndFeel as? UIThemeBasedLookAndFeelInfo)?.theme - -@InternalJewelApi -public val UITheme.icons: Map - get() = readMapField(classUITheme.getDeclaredField("icons")) - .filterKeys { it != "ColorPalette" } - -internal val UITheme.iconColorPalette: Map - get() = readMapField>(classUITheme.getDeclaredField("icons"))["ColorPalette"] - .orEmpty() - -internal val UITheme.selectedIconColorPalette: Map - get() = readMapField(classUITheme.getDeclaredField("iconColorsOnSelection")) - -private fun UITheme.readMapField(field: Field): Map { - @Suppress("DEPRECATION") // We don't have an alternative API to use - val wasAccessible = field.isAccessible - field.isAccessible = true - - return try { - @Suppress("UNCHECKED_CAST") - (field.get(this) as? Map).orEmpty() - } catch (e: IllegalAccessException) { - logger.warn("Error while retrieving LaF", e) - emptyMap() - } finally { - field.isAccessible = wasAccessible - } -} diff --git a/ide-laf-bridge/ide-laf-bridge-233/api/ide-laf-bridge-233.api b/ide-laf-bridge/ide-laf-bridge-233/api/ide-laf-bridge-233.api deleted file mode 100644 index 518880e9b..000000000 --- a/ide-laf-bridge/ide-laf-bridge-233/api/ide-laf-bridge-233.api +++ /dev/null @@ -1,15 +0,0 @@ -public final class org/jetbrains/jewel/bridge/BridgeIconDataKt { - public static final fun readFromLaF (Lorg/jetbrains/jewel/foundation/theme/ThemeIconData$Companion;)Lorg/jetbrains/jewel/foundation/theme/ThemeIconData; -} - -public final class org/jetbrains/jewel/bridge/BridgePainterHintsProvider : org/jetbrains/jewel/ui/painter/BasePainterHintsProvider { - public static final field $stable I - public static final field Companion Lorg/jetbrains/jewel/bridge/BridgePainterHintsProvider$Companion; - public synthetic fun (ZLjava/util/Map;Ljava/util/Map;Ljava/util/Map;Lkotlin/jvm/internal/DefaultConstructorMarker;)V - public fun hints (Ljava/lang/String;Landroidx/compose/runtime/Composer;I)Ljava/util/List; -} - -public final class org/jetbrains/jewel/bridge/BridgePainterHintsProvider$Companion { - public final fun invoke (Z)Lorg/jetbrains/jewel/ui/painter/BasePainterHintsProvider; -} - diff --git a/ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts b/ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts deleted file mode 100644 index 40259db2a..000000000 --- a/ide-laf-bridge/ide-laf-bridge-233/build.gradle.kts +++ /dev/null @@ -1,16 +0,0 @@ -plugins { - jewel - `jewel-ij-publish` - `ide-version-checker` - alias(libs.plugins.composeDesktop) -} - -dependencies { - api(projects.ui) - compileOnly(libs.bundles.idea233) -} - -tasks.withType().configureEach { - publication.artifactId = "jewel-ide-laf-bridge-platform-specific" - enabled = supportedIJVersion() == SupportedIJVersion.IJ_233 -} diff --git a/ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeIconData.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeIconData.kt similarity index 100% rename from ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeIconData.kt rename to ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeIconData.kt diff --git a/ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeOverride.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeOverride.kt similarity index 100% rename from ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeOverride.kt rename to ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeOverride.kt diff --git a/ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt similarity index 88% rename from ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt rename to ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt index d7fa143f7..839a66657 100644 --- a/ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt +++ b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePainterHintsProvider.kt @@ -12,7 +12,7 @@ import org.jetbrains.jewel.ui.painter.hints.Dark import org.jetbrains.jewel.ui.painter.hints.HiDpi @InternalJewelApi -class BridgePainterHintsProvider private constructor( +public class BridgePainterHintsProvider private constructor( isDark: Boolean, intellijIconPalette: Map = emptyMap(), themeIconPalette: Map = emptyMap(), @@ -27,11 +27,12 @@ class BridgePainterHintsProvider private constructor( add(Dark(JewelTheme.isDark)) } - companion object { + public companion object { private val logger = thisLogger() - operator fun invoke(isDark: Boolean): BasePainterHintsProvider { + @Suppress("UnstableApiUsage") // We need to call @Internal APIs + public operator fun invoke(isDark: Boolean): BasePainterHintsProvider { val uiTheme = currentUiThemeOrNull() ?: return BridgePainterHintsProvider(isDark) logger.info("Parsing theme info from theme ${uiTheme.name} (id: ${uiTheme.id}, isDark: ${uiTheme.isDark})") diff --git a/ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/UiThemeExtensions.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/UiThemeExtensions.kt similarity index 100% rename from ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/UiThemeExtensions.kt rename to ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/UiThemeExtensions.kt diff --git a/samples/ide-plugin/build.gradle.kts b/samples/ide-plugin/build.gradle.kts index dae85e4eb..ce2585cc3 100644 --- a/samples/ide-plugin/build.gradle.kts +++ b/samples/ide-plugin/build.gradle.kts @@ -1,7 +1,3 @@ -import SupportedIJVersion.IJ_232 -import SupportedIJVersion.IJ_233 -import SupportedIJVersion.IJ_241 - plugins { jewel alias(libs.plugins.composeDesktop) @@ -10,14 +6,9 @@ plugins { } intellij { - pluginName.set("Jewel Demo") - plugins.set(listOf("org.jetbrains.kotlin")) - val versionRaw = when (supportedIJVersion()) { - IJ_232 -> libs.versions.idea232.get() - IJ_233 -> libs.versions.idea233.get() - IJ_241 -> libs.versions.idea241.get() - } - version.set(versionRaw) + pluginName = "Jewel Demo" + plugins = listOf("org.jetbrains.kotlin") + version = libs.versions.idea.get() } // TODO remove this once the IJ Gradle plugin fixes their repositories bug diff --git a/samples/standalone/build.gradle.kts b/samples/standalone/build.gradle.kts index be0e8e53e..219e85078 100644 --- a/samples/standalone/build.gradle.kts +++ b/samples/standalone/build.gradle.kts @@ -45,7 +45,7 @@ tasks { // register the task in the afterEvaluate block afterEvaluate { javaLauncher = project.javaToolchains.launcherFor { - languageVersion = supportedIJVersion().jdkVersion + languageVersion = JavaLanguageVersion.of(17) vendor = JvmVendorSpec.JETBRAINS } setExecutable(javaLauncher.map { it.executablePath.asFile.absolutePath }.get()) diff --git a/settings.gradle.kts b/settings.gradle.kts index bfe09db55..3e3ec8938 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -36,8 +36,6 @@ include( ":int-ui:int-ui-decorated-window", ":int-ui:int-ui-standalone", ":ide-laf-bridge", - ":ide-laf-bridge:ide-laf-bridge-232", - ":ide-laf-bridge:ide-laf-bridge-233", ":samples:standalone", ":samples:ide-plugin", )