diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ae2adf5..af2cb1c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -158,61 +158,6 @@ jobs: path: ./build/distributions/${{ needs.build.outputs.artifact }} if-no-files-found: error - # Verify built plugin using IntelliJ Plugin Verifier tool - # Requires build job to be passed - verify: - name: Verify - needs: build - runs-on: ubuntu-latest - steps: - - # Setup Java 17 environment for the next steps - - name: Setup Java - uses: actions/setup-java@v3.5.0 - with: - java-version: 17 - distribution: 'zulu' - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v3 - with: - submodules: true - - # Cache Gradle Dependencies - - name: Setup Gradle Dependencies Cache - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} - - # Cache Gradle Wrapper - - name: Setup Gradle Wrapper Cache - uses: actions/cache@v3 - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} - - # Set environment variables - - name: Export Properties - id: properties - shell: bash - run: | - PROPERTIES="$(./gradlew properties --console=plain -q)" - IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)" - echo "::set-output name=ideVersions::$IDE_VERSIONS" - echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier" - # Cache Plugin Verifier IDEs - - name: Setup Plugin Verifier IDEs Cache - uses: actions/cache@v3 - with: - path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides - key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }} - - # Run IntelliJ Plugin Verifier action using GitHub Action - - name: Verify Plugin - run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} - # Prepare a draft release for GitHub Releases page for the manual verification # If accepted and published, release workflow would be triggered releaseDraft: @@ -220,7 +165,7 @@ jobs: # don't run on pull requests to avoid creating draft releases for pull requests # only run on the main branch, to avoid cutting releases from feature branches if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }} - needs: [build, verify] + needs: [build] runs-on: ubuntu-latest steps: diff --git a/build.gradle.kts b/build.gradle.kts index 81156c17..280be9a1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ import io.gitlab.arturbosch.detekt.Detekt import org.jetbrains.changelog.date import org.jetbrains.changelog.markdownToHTML import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType fun properties(key: String) = project.findProperty(key).toString() @@ -11,11 +12,11 @@ plugins { // Kotlin support id("org.jetbrains.kotlin.jvm") version "2.0.0-Beta2" // gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin - id("org.jetbrains.intellij") version "1.16.1" + id("org.jetbrains.intellij.platform") version "2.2.0" // gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin id("org.jetbrains.changelog") version "1.3.1" // detekt linter - read more: https://detekt.github.io/detekt/gradle.html - id("io.gitlab.arturbosch.detekt") version "1.21.0" + id("io.gitlab.arturbosch.detekt") version "1.23.6" // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle id("org.jlleitschuh.gradle.ktlint") version "11.0.0" id("groovy") @@ -30,9 +31,16 @@ version = properties("pluginVersion") // Configure project's dependencies repositories { mavenCentral() + intellijPlatform { + defaultRepositories() + } flatDir { dirs("lib") } } dependencies { + intellijPlatform { + create(properties("platformType"), properties("platformVersion")) + bundledPlugins(listOf("com.intellij.java", "org.intellij.intelliLang")) + } // https://mvnrepository.com/artifact/com.googlecode.owasp-java-html-sanitizer/owasp-java-html-sanitizer implementation("com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer") // compile "org.jetbrains:markdown:${markdownParserVersion}" @@ -51,17 +59,41 @@ dependencies { } // Configure gradle-intellij-plugin plugin. // Read more: https://github.com/JetBrains/gradle-intellij-plugin -intellij { - pluginName.set(properties("pluginName")) - version.set(properties("platformVersion")) - type.set(properties("platformType")) - downloadSources.set(properties("platformDownloadSources").toBoolean()) - updateSinceUntilBuild.set(false) // don't write information of current IntelliJ build into plugin.xml, instead use information from patchPluginXml - -// Plugin Dependencies: -// https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html -// - plugins.set(listOf("com.intellij.java", "org.intellij.intelliLang")) +intellijPlatform { + pluginConfiguration { + name = properties("pluginName") + version = properties("pluginVersion") + + description = File(projectDir, "README.md").readText().lines().run { + val start = "" + val end = "" + + if (!containsAll(listOf(start, end))) { + throw GradleException("Plugin description section not found in README.md:\n$start ... $end") + } + subList(indexOf(start) + 1, indexOf(end)) + }.joinToString("\n").run { markdownToHTML(this) } + + changeNotes = changelog.getLatest().toHTML() + + ideaVersion { + sinceBuild = properties("pluginSinceBuild") + } + } + + pluginVerification { + ides { + properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty).forEach { + ide(IntelliJPlatformType.IntellijIdeaCommunity, it) + } + } + } + + publishing { + token = System.getenv("PUBLISH_TOKEN") + channels = listOf(if ("true" == System.getenv("PRE_RELEASE")) "EAP" else "default") + } + } // Configure detekt plugin. @@ -128,44 +160,6 @@ tasks { withType { jvmTarget = "11" } - patchPluginXml { - version.set(properties("pluginVersion")) - sinceBuild.set((properties("pluginSinceBuild"))) - // untilBuild(pluginUntilBuild) --> don't set "untilBuild" to allow new versions to use existing plugin without changes until breaking API changes are known - - // Extract the section from README.md and provide for the plugin's manifest - pluginDescription.set( - provider { - File(projectDir, "README.md").readText().lines().run { - val start = "" - val end = "" - - if (!containsAll(listOf(start, end))) { - throw GradleException("Plugin description section not found in README.md:\n$start ... $end") - } - subList(indexOf(start) + 1, indexOf(end)) - }.joinToString("\n").run { markdownToHTML(this) } - } - ) - - // Get the latest available change notes from the changelog file - changeNotes.set( - provider { - changelog.getLatest().toHTML() - } - ) - } - - runPluginVerifier { - ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty)) - } - - publishPlugin { - dependsOn("patchChangelog") - token.set(System.getenv("PUBLISH_TOKEN")) - // if release is marked as a pre-release in the GitHub release, push it to EAP - channels.set(listOf(if ("true" == System.getenv("PRE_RELEASE")) "EAP" else "default")) - } changelog { version.set(properties("pluginVersion")) header.set(provider { "[${project.version}] - ${date()}" }) diff --git a/gradle.properties b/gradle.properties index 843c65d0..bccf443e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,15 +6,15 @@ markdownParserVersion = 0.1.23 pluginGroup = org.jetbrains.plugins.template pluginName = zenuml -pluginVersion = 2024.12.23 +pluginVersion = 2025.1.1 pluginSinceBuild = 233 # Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl # See https://jb.gg/intellij-platform-builds-list for available build versions. -pluginVerifierIdeVersions = 2023.3 +pluginVerifierIdeVersions = 2024.1 platformType = IC -platformVersion = 2023.3 +platformVersion = 2024.1 platformDownloadSources = true # Opt-out flag for bundling Kotlin standard library. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 070cb702..a5952066 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/resource/META-INF/plugin.xml b/resource/META-INF/plugin.xml index 6ad90d80..2d478f32 100644 --- a/resource/META-INF/plugin.xml +++ b/resource/META-INF/plugin.xml @@ -167,5 +167,5 @@ - +