diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d4bb422..e37bdf2 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,15 +1,14 @@
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
# - validate Gradle Wrapper,
-# - run test and verifyPlugin tasks,
-# - run buildPlugin task and prepare artifact for the further tests,
-# - run IntelliJ Plugin Verifier,
+# - run 'test' and 'verifyPlugin' tasks,
+# - run Qodana inspections,
+# - run 'buildPlugin' task and prepare artifact for the further tests,
+# - run 'runPluginVerifier' task,
# - create a draft release.
#
# Workflow is triggered on push and pull_request events.
#
-# Docs:
-# - GitHub Actions: https://help.github.com/en/actions
-# - IntelliJ Plugin Verifier GitHub Action: https://github.com/ChrisCarini/intellij-platform-plugin-verifier-action
+# GitHub Actions reference: https://help.github.com/en/actions
#
## JBIJPPTPL
@@ -24,102 +23,31 @@ on:
jobs:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
- gradleValidation:
- name: Gradle Wrapper
+ # Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
+ # Build plugin and provide the artifact for the next workflow jobs
+ build:
+ name: Build
runs-on: ubuntu-latest
+ outputs:
+ version: ${{ steps.properties.outputs.version }}
+ changelog: ${{ steps.properties.outputs.changelog }}
steps:
# Check out current repository
- name: Fetch Sources
- uses: actions/checkout@v2.3.4
+ uses: actions/checkout@v2.4.0
# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.4
- # Run verifyPlugin and test Gradle tasks
- test:
- name: Test
- needs: gradleValidation
- runs-on: ubuntu-latest
- steps:
-
- # Setup Java 1.8 environment for the next steps
- - name: Setup Java
- uses: actions/setup-java@v2
- with:
- distribution: zulu
- java-version: 8
-
- # Check out current repository
- - name: Fetch Sources
- uses: actions/checkout@v2.3.4
-
- # Cache Gradle dependencies
- - name: Setup Gradle Dependencies Cache
- uses: actions/cache@v2.1.6
- 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@v2.1.6
- with:
- path: ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
-
- # Run detekt, ktlint and tests
- - name: Run Linters and Test
- run: ./gradlew check
-
- - uses: actions/upload-artifact@v2
- if: failure()
- with:
- name: test-report
- path: ./build/reports/tests/
-
- # Run verifyPlugin Gradle task
- - name: Verify Plugin
- run: ./gradlew verifyPlugin
-
- # Build plugin with buildPlugin Gradle task and provide the artifact for the next workflow jobs
- # Requires test job to be passed
- build:
- name: Build
- needs: test
- runs-on: ubuntu-latest
- outputs:
- name: ${{ steps.properties.outputs.name }}
- version: ${{ steps.properties.outputs.version }}
- changelog: ${{ steps.properties.outputs.changelog }}
- artifact: ${{ steps.properties.outputs.artifact }}
- steps:
-
- # Setup Java 1.8 environment for the next steps
+ # Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: zulu
- java-version: 8
-
- # Check out current repository
- - name: Fetch Sources
- uses: actions/checkout@v2.3.4
-
- # Cache Gradle Dependencies
- - name: Setup Gradle Dependencies Cache
- uses: actions/cache@v2.1.6
- 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@v2.1.6
- with:
- path: ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
+ java-version: 11
+ cache: gradle
# Set environment variables
- name: Export Properties
@@ -133,129 +61,105 @@ jobs:
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
- ARTIFACT="${NAME}-${VERSION}.zip"
echo "::set-output name=version::$VERSION"
echo "::set-output name=name::$NAME"
echo "::set-output name=changelog::$CHANGELOG"
- echo "::set-output name=artifact::$ARTIFACT"
+ echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
- # Build artifact using buildPlugin Gradle task
- - name: Build Plugin
- run: ./gradlew buildPlugin
+ ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
- # Upload plugin artifact to make it available in the next jobs
- - name: Upload artifact
- uses: actions/upload-artifact@v2.2.3
- with:
- name: plugin-artifact
- path: ./build/distributions/${{ steps.properties.outputs.artifact }}
+ # Run tests
+ - name: Run Tests
+ run: ./gradlew test
- # Verify built plugin using IntelliJ Plugin Verifier tool
- # Requires build job to be passed
- verify:
- name: Verify
- needs: build
- runs-on: ubuntu-latest
- steps:
+ # Collect Tests Result of failed tests
+ - name: Collect Tests Result
+ if: ${{ failure() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: tests-result
+ path: ${{ github.workspace }}/build/reports/tests
- # Setup Java 1.8 environment for the next steps
- - name: Setup Java
- uses: actions/setup-java@v2
+ # Cache Plugin Verifier IDEs
+ - name: Setup Plugin Verifier IDEs Cache
+ uses: actions/cache@v2.1.6
with:
- distribution: zulu
- java-version: 8
+ path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
+ key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
- # Check out current repository
- - name: Fetch Sources
- uses: actions/checkout@v2.3.4
+ # Run Verify Plugin task and IntelliJ Plugin Verifier tool
+ - name: Run Plugin Verification tasks
+ run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
- # Cache Gradle Dependencies
- - name: Setup Gradle Dependencies Cache
- uses: actions/cache@v2.1.6
+ # Collect Plugin Verifier Result
+ - name: Collect Plugin Verifier Result
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v2
with:
- path: ~/.gradle/caches
- key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
+ name: pluginVerifier-result
+ path: ${{ github.workspace }}/build/reports/pluginVerifier
- # Cache Gradle Wrapper
- - name: Setup Gradle Wrapper Cache
- uses: actions/cache@v2.1.6
+ # Run Qodana inspections
+ - name: Qodana - Code Inspection
+ uses: JetBrains/qodana-action@v2.1-eap
+
+ # Collect Qodana Result
+ - name: Collect Qodana Result
+ uses: actions/upload-artifact@v2
with:
- path: ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
+ name: qodana-result
+ path: ${{ github.workspace }}/qodana
- # Set environment variables
- - name: Export Properties
- id: properties
+ # Prepare plugin archive content for creating artifact
+ - name: Prepare Plugin Artifact
+ id: artifact
shell: bash
run: |
- PROPERTIES="$(./gradlew properties --console=plain -q)"
- IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)"
+ cd ${{ github.workspace }}/build/distributions
+ FILENAME=`ls *.zip`
+ unzip "$FILENAME" -d content
- echo "::set-output name=ideVersions::$IDE_VERSIONS"
- echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
+ echo "::set-output name=filename::$FILENAME"
- # Cache Plugin Verifier IDEs
- - name: Setup Plugin Verifier IDEs Cache
- uses: actions/cache@v2.1.6
+ # Store already-built plugin as an artifact for downloading
+ - name: Upload artifact
+ uses: actions/upload-artifact@v2.2.4
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 }}
+ name: ${{ steps.artifact.outputs.filename }}
+ path: ./build/distributions/content/*/*
# Prepare a draft release for GitHub Releases page for the manual verification
# If accepted and published, release workflow would be triggered
releaseDraft:
name: Release Draft
if: github.event_name != 'pull_request'
- needs: [build, verify]
+ needs: build
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
- uses: actions/checkout@v2.3.4
+ uses: actions/checkout@v2.4.0
# Remove old release drafts by using the curl request for the available releases with draft flag
- name: Remove Old Release Drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- curl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases \
- | tr '\r\n' ' ' \
- | jq '.[] | select(.draft == true) | .id' \
- | xargs -I '{}' \
- curl -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/{}
+ gh api repos/{owner}/{repo}/releases \
+ --jq '.[] | select(.draft == true) | .id' \
+ | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
# Create new release draft - which is not publicly visible and requires manual acceptance
- name: Create Release Draft
- id: createDraft
- uses: actions/create-release@v1.1.4
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- tag_name: v${{ needs.build.outputs.version }}
- release_name: v${{ needs.build.outputs.version }}
- body: ${{ needs.build.outputs.changelog }}
- draft: true
-
- # Download plugin artifact provided by the previous job
- - name: Download Artifact
- uses: actions/download-artifact@v2
- with:
- name: plugin-artifact
-
- # Upload artifact as a release asset
- - name: Upload Release Asset
- id: upload-release-asset
- uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.createDraft.outputs.upload_url }}
- asset_path: ./${{ needs.build.outputs.artifact }}
- asset_name: ${{ needs.build.outputs.artifact }}
- asset_content_type: application/zip
+ run: |
+ gh release create v${{ needs.build.outputs.version }} \
+ --draft \
+ --title "v${{ needs.build.outputs.version }}" \
+ --notes "$(cat << 'EOM'
+ ${{ needs.build.outputs.changelog }}
+ EOM
+ )"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 028ffbe..7896918 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -14,18 +14,40 @@ jobs:
runs-on: ubuntu-latest
steps:
- # Setup Java 1.8 environment for the next steps
+ # Check out current repository
+ - name: Fetch Sources
+ uses: actions/checkout@v2.4.0
+ with:
+ ref: ${{ github.event.release.tag_name }}
+
+ # Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: zulu
- java-version: 8
+ java-version: 11
+ cache: gradle
- # Check out current repository
- - name: Fetch Sources
- uses: actions/checkout@v2.3.4
- with:
- ref: ${{ github.event.release.tag_name }}
+ # Set environment variables
+ - name: Export Properties
+ id: properties
+ shell: bash
+ run: |
+ CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d'
+ ${{ github.event.release.body }}
+ EOM
+ )"
+
+ echo "::set-output name=changelog::$CHANGELOG"
+
+ # Update Unreleased section with the current release note
+ - name: Patch Changelog
+ if: ${{ steps.properties.outputs.changelog != '' }}
+ run: |
+ ./gradlew patchChangelog --release-note "$(cat << 'EOM'
+ ${{ steps.properties.outputs.changelog }}
+ EOM
+ )"
# Publish the plugin to the Marketplace
- name: Publish Plugin
@@ -33,40 +55,30 @@ jobs:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
run: ./gradlew publishPlugin
- # Patch changelog, commit and push to the current repository
- changelog:
- name: Update Changelog
- needs: release
- runs-on: ubuntu-latest
- steps:
-
- # Setup Java 1.8 environment for the next steps
- - name: Setup Java
- uses: actions/setup-java@v2
- with:
- distribution: zulu
- java-version: 8
+ # Upload artifact as a release asset
+ - name: Upload Release Asset
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
- # Check out current repository
- - name: Fetch Sources
- uses: actions/checkout@v2.3.4
- with:
- ref: ${{ github.event.release.tag_name }}
+ # Create pull request
+ - name: Create Pull Request
+ if: ${{ steps.properties.outputs.changelog != '' }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ VERSION="${{ github.event.release.tag_name }}"
+ BRANCH="changelog-update-$VERSION"
- # Update Unreleased section with the current version
- - name: Patch Changelog
- run: ./gradlew patchChangelog
+ git config user.email "action@github.com"
+ git config user.name "GitHub Action"
- # Commit patched Changelog
- - name: Commit files
- run: |
- git config --local user.email "action@github.com"
- git config --local user.name "GitHub Action"
- git commit -m "Update changelog" -a
+ git checkout -b $BRANCH
+ git commit -am "Changelog update - $VERSION"
+ git push --set-upstream origin $BRANCH
- # Push changes
- - name: Push changes
- uses: ad-m/github-push-action@master
- with:
- branch: main
- github_token: ${{ secrets.GITHUB_TOKEN }}
+ gh pr create \
+ --title "Changelog update - \`$VERSION\`" \
+ --body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
+ --base main \
+ --head $BRANCH
diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml
new file mode 100644
index 0000000..3108cf1
--- /dev/null
+++ b/.github/workflows/run-ui-tests.yml
@@ -0,0 +1,60 @@
+# GitHub Actions Workflow for launching UI tests on Linux, Windows, and Mac in the following steps:
+# - prepare and launch IDE with your plugin and robot-server plugin, which is needed to interact with UI
+# - wait for IDE to start
+# - run UI tests with separate Gradle task
+#
+# Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ Platform
+#
+# Workflow is triggered manually.
+
+name: Run UI Tests
+on:
+ workflow_dispatch
+
+jobs:
+
+ testUI:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - os: ubuntu-latest
+ runIde: |
+ export DISPLAY=:99.0
+ Xvfb -ac :99 -screen 0 1920x1080x16 &
+ gradle runIdeForUiTests &
+ - os: windows-latest
+ runIde: start gradlew.bat runIdeForUiTests
+ - os: macos-latest
+ runIde: ./gradlew runIdeForUiTests &
+
+ steps:
+
+ # Check out current repository
+ - name: Fetch Sources
+ uses: actions/checkout@v2.4.0
+
+ # Setup Java 11 environment for the next steps
+ - name: Setup Java
+ uses: actions/setup-java@v2
+ with:
+ distribution: zulu
+ java-version: 11
+ cache: gradle
+
+ # Run IDEA prepared for UI testing
+ - name: Run IDE
+ run: ${{ matrix.runIde }}
+
+ # Wait for IDEA to be started
+ - name: Health Check
+ uses: jtalk/url-health-check-action@v2
+ with:
+ url: http://127.0.0.1:8082
+ max-attempts: 15
+ retry-delay: 30s
+
+ # Run tests
+ - name: Tests
+ run: ./gradlew test
diff --git a/.run/Run IDE for UI Tests.run.xml b/.run/Run IDE for UI Tests.run.xml
new file mode 100644
index 0000000..9b028c3
--- /dev/null
+++ b/.run/Run IDE for UI Tests.run.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ false
+
+
+
\ No newline at end of file
diff --git a/.run/Run Plugin Tests.run.xml b/.run/Run Plugin Tests.run.xml
index 03d0287..ae9ae13 100644
--- a/.run/Run Plugin Tests.run.xml
+++ b/.run/Run Plugin Tests.run.xml
@@ -11,7 +11,7 @@
@@ -21,4 +21,4 @@
false
-
\ No newline at end of file
+
diff --git a/.run/Run Qodana.run.xml b/.run/Run Qodana.run.xml
new file mode 100644
index 0000000..9603583
--- /dev/null
+++ b/.run/Run Qodana.run.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ false
+
+
+
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a72e75d..71b2666 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,11 @@
### Added
### Changed
+- rebased on latest [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)
+- upgraded
+ - *gradle* to 7.3
+ - *kotlin* to 1.6.0
+ - *detekt* to 1.18.1
### Deprecated
diff --git a/build.gradle.kts b/build.gradle.kts
index 24c782a..fe3e9b1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,3 @@
-import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@@ -9,14 +8,14 @@ plugins {
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.6.0"
- // gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
- id("org.jetbrains.intellij") version "1.0"
- // gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
+ // Gradle IntelliJ Plugin
+ id("org.jetbrains.intellij") version "1.3.0"
+ // Gradle Changelog Plugin
id("org.jetbrains.changelog") version "1.3.1"
+ // Gradle Qodana Plugin
+ id("org.jetbrains.qodana") version "0.1.13"
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
- id("io.gitlab.arturbosch.detekt") version "1.17.1"
- // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
- id("org.jlleitschuh.gradle.ktlint") version "10.2.0"
+ id("io.gitlab.arturbosch.detekt") version "1.18.1"
}
group = properties("pluginGroup")
@@ -30,8 +29,7 @@ dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.18.1")
}
-// Configure gradle-intellij-plugin plugin.
-// Read more: https://github.com/JetBrains/gradle-intellij-plugin
+// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
@@ -43,11 +41,10 @@ intellij {
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}
-// Configure gradle-changelog-plugin plugin.
-// Read more: https://github.com/JetBrains/gradle-changelog-plugin
+// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
- version = properties("pluginVersion")
- groups = emptyList()
+ version.set(properties("pluginVersion"))
+ groups.set(emptyList())
}
// Configure detekt plugin.
@@ -63,18 +60,28 @@ detekt {
}
}
+// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
+qodana {
+ cachePath.set(projectDir.resolve(".qodana").canonicalPath)
+ reportPath.set(projectDir.resolve("build/reports/inspections").canonicalPath)
+ saveReport.set(true)
+ showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
+}
+
tasks {
- // Set the compatibility versions to 1.8
- withType {
- sourceCompatibility = "1.8"
- targetCompatibility = "1.8"
- }
- withType {
- kotlinOptions.jvmTarget = "1.8"
+ // Set the JVM compatibility versions
+ properties("javaVersion").let {
+ withType {
+ sourceCompatibility = it
+ targetCompatibility = it
+ }
+ withType {
+ kotlinOptions.jvmTarget = it
+ }
}
- withType {
- jvmTarget = "1.8"
+ wrapper {
+ gradleVersion = properties("gradleVersion")
}
patchPluginXml {
@@ -84,7 +91,7 @@ tasks {
// Extract the section from README.md and provide for the plugin's manifest
pluginDescription.set(
- File(projectDir, "README.md").readText().lines().run {
+ projectDir.resolve("README.md").readText().lines().run {
val start = ""
val end = ""
@@ -96,11 +103,33 @@ tasks {
)
// Get the latest available change notes from the changelog file
- changeNotes.set(provider { changelog.getLatest().toHTML() })
+ changeNotes.set(provider {
+ changelog.run {
+ getOrNull(properties("pluginVersion")) ?: getLatest()
+ }.toHTML()
+ })
}
runPluginVerifier {
- ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty))
+ ideVersions.set(properties("pluginVerifierIdeVersions")
+ .split(',')
+ .map(String::trim)
+ .filter(String::isNotEmpty))
+ }
+
+ // Configure UI tests plugin
+ // Read more: https://github.com/JetBrains/intellij-ui-test-robot
+ runIdeForUiTests {
+ systemProperty("robot-server.port", "8082")
+ systemProperty("ide.mac.message.dialogs.as.sheets", "false")
+ systemProperty("jb.privacy.policy.text", "")
+ systemProperty("jb.consents.confirmation.enabled", "false")
+ }
+
+ signPlugin {
+ certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
+ privateKey.set(System.getenv("PRIVATE_KEY"))
+ password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
diff --git a/gradle.properties b/gradle.properties
index 9f7ee76..ee56102 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -2,22 +2,35 @@
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
pluginGroup = com.github.developerutils.kotlin-function-arguments-helper
-pluginName_ = Kotlin Function Arguments Helper
-pluginVersion = 2021.2.0
+pluginName = Kotlin Function Arguments Helper
+# SemVer format -> https://semver.org
+pluginVersion = 2021.3.0
+
+# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
+# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild = 203
pluginUntilBuild = 213.*
# 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 = 2020.3.2, 2021.1
+pluginVerifierIdeVersions = IC-2020.3.4, IC-2021.3
+# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IC
-platformVersion = 2020.3
+platformVersion = 2020.3.4
platformDownloadSources = true
+
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = com.intellij.java, org.jetbrains.kotlin
+# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
+javaVersion = 11
+
+# Gradle Releases -> https://github.com/gradle/gradle/releases
+gradleVersion = 7.3
+
# Opt-out flag for bundling Kotlin standard library.
-# See https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details.
+# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
+# suppress inspection "UnusedProperty"
kotlin.stdlib.default.dependency = false
kotlin.code.style = official
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index e708b1c..7454180 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 29e4134..e750102 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.0.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 4f906e0..1b6c787 100755
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
-#!/usr/bin/env sh
+#!/bin/sh
#
-# Copyright 2015 the original author or authors.
+# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,67 +17,101 @@
#
##############################################################################
-##
-## Gradle start up script for UN*X
-##
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
##############################################################################
# Attempt to set APP_HOME
+
# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
+APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
+MAX_FD=maximum
warn () {
echo "$*"
-}
+} >&2
die () {
echo
echo "$*"
echo
exit 1
-}
+} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
+ JAVACMD=$JAVA_HOME/jre/sh/java
else
- JAVACMD="$JAVA_HOME/bin/java"
+ JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
- JAVACMD="java"
+ JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@@ -106,80 +140,95 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
fi
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
-if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
fi
- i=`expr $i + 1`
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
done
- case $i in
- 0) set -- ;;
- 1) set -- "$args0" ;;
- 2) set -- "$args0" "$args1" ;;
- 3) set -- "$args0" "$args1" "$args2" ;;
- 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
fi
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=`save "$@"`
+# Collect all arguments for the java command;
+# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+# shell script including quotes and variable substitutions, so put them in
+# double quotes to make sure that they get re-expanded; and
+# * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
exec "$JAVACMD" "$@"
diff --git a/qodana.yml b/qodana.yml
new file mode 100644
index 0000000..dac95d3
--- /dev/null
+++ b/qodana.yml
@@ -0,0 +1,6 @@
+# Qodana configuration:
+# https://www.jetbrains.com/help/qodana/qodana-yaml.html
+
+version: 1.0
+profile:
+ name: qodana.recommended
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 9d2d362..200de4c 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -1,3 +1,4 @@
+
com.github.developerutils.kotlin-function-arguments-helper
Kotlin Function Arguments Helper