From 6997fb3c023f457642892556c439833b254fc8db Mon Sep 17 00:00:00 2001 From: Lamberto Basti Date: Mon, 12 Feb 2024 16:53:50 +0100 Subject: [PATCH] Refactor Kotlin Multiplatform Plugin (#64) Refactored the Kotlin Multiplatform Plugin and added plugin parameters in a generated static class. Changes include modifications and relocations of several utilities methods related to KMP attributes and conditions. Environment variables have been introduced to control runtime behavior. --- .github/workflows/publish-snapshot.yml | 1 + ...ml => [KMP] Package Search Plugin.run.xml} | 10 ++++- README.md | 4 +- .../gradle/GeneratePackageSearchObject.kt | 25 +++++++++-- plugin/core/build.gradle.kts | 7 +--- .../plugin/core/utils/KMPAttributes.kt | 41 +++++++++++++++++++ .../plugin/gradle/GradleModuleProvider.kt | 3 +- .../plugin/gradle/KMPAttributes.kt | 20 --------- .../packagesearch/plugin/gradle/KMPUtils.kt | 20 +-------- .../KotlinMultiplatformModuleProvider.kt | 3 +- .../plugin/gradle/utils/GradleUtils.kt | 6 ++- .../ui/model/infopanel/asPanelContent.kt | 2 +- 12 files changed, 85 insertions(+), 57 deletions(-) rename .run/{Build Plugin.run.xml => [KMP] Package Search Plugin.run.xml} (68%) create mode 100644 plugin/core/src/main/kotlin/com/jetbrains/packagesearch/plugin/core/utils/KMPAttributes.kt delete mode 100644 plugin/gradle/kmp/src/main/kotlin/com/jetbrains/packagesearch/plugin/gradle/KMPAttributes.kt diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index d1a298fd..e2d1e4d6 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -26,3 +26,4 @@ jobs: MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }} RUN_NUMBER: ${{ github.run_number }} RUN_ATTEMPT: ${{ github.run_attempt }} + KMP: true diff --git a/.run/Build Plugin.run.xml b/.run/[KMP] Package Search Plugin.run.xml similarity index 68% rename from .run/Build Plugin.run.xml rename to .run/[KMP] Package Search Plugin.run.xml index 7b9824de..d9b95371 100644 --- a/.run/Build Plugin.run.xml +++ b/.run/[KMP] Package Search Plugin.run.xml @@ -1,6 +1,12 @@ - + + +