diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 19035a2..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,172 +0,0 @@ -# GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps: -# - validate Gradle Wrapper, -# - 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. -# -# GitHub Actions reference: https://help.github.com/en/actions -# -## JBIJPPTPL - -name: Build -on: - # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests) - push: - branches: [main] - # Trigger the workflow on any pull request - pull_request: - -jobs: - - # Run Gradle Wrapper Validation Action to verify the wrapper's checksum - # 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: - - # Free GitHub Actions Environment Disk Space - - name: Maximize Build Space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf /usr/local/lib/android - sudo rm -rf /opt/ghc - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v3 - - # Validate wrapper - - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1.0.6 - - # Setup Java 17 environment for the next steps - - name: Setup Java - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 17 - - # Set environment variables - - name: Export Properties - id: properties - shell: bash - run: | - PROPERTIES="$(./gradlew properties --console=plain -q)" - VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" - NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" - CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" - - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "name=$NAME" >> $GITHUB_OUTPUT - echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT - - echo "changelog<> $GITHUB_OUTPUT - echo "$CHANGELOG" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier - - # Run tests - - name: Run Tests - run: ./gradlew check - - # Collect Tests Result of failed tests - - name: Collect Tests Result - if: ${{ failure() }} - uses: actions/upload-artifact@v3 - with: - name: tests-result - path: ${{ github.workspace }}/build/reports/tests - - # Upload Kover report to CodeCov - - name: Upload Code Coverage Report - uses: codecov/codecov-action@v3 - with: - files: ${{ github.workspace }}/build/reports/kover/xml/report.xml - - # Cache Plugin Verifier IDEs - - name: Setup Plugin Verifier IDEs Cache - uses: actions/cache@v3 - with: - path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides - key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} - - # Run Verify Plugin task and IntelliJ Plugin Verifier tool - - name: Run Plugin Verification tasks - run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} - - # Collect Plugin Verifier Result - - name: Collect Plugin Verifier Result - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: pluginVerifier-result - path: ${{ github.workspace }}/build/reports/pluginVerifier - - # Run Qodana inspections - - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v2022.3.4 - - # Prepare plugin archive content for creating artifact - - name: Prepare Plugin Artifact - id: artifact - shell: bash - run: | - cd ${{ github.workspace }}/build/distributions - FILENAME=`ls *.zip` - unzip "$FILENAME" -d content - - echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT - - # Store already-built plugin as an artifact for downloading - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - 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 - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v3 - - # Remove old release drafts by using the curl request for the available releases with a draft flag - - name: Remove Old Release Drafts - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh api repos/{owner}/{repo}/releases \ - --jq '.[] | select(.draft == true) | .id' \ - | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} - - # Create a new release draft which is not publicly visible and requires manual acceptance - - name: Create Release Draft - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - 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/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..33d3c7d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI +run-name: > + CI (${{ github.event_name }}) + ${{ github.event_name == 'pull_request' && format('PR#{0}', github.event.number) || '' }} + +on: + workflow_dispatch: + inputs: + ui-tests: + description: Run UI-tests + type: boolean + default: false + pull_request: + branches: [ main ] + push: + branches: [ main ] + schedule: + - cron: 0 0 15 * * + + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + tests: + name: ๐Ÿงช tests + uses: ./.github/workflows/step_tests.yml + with: + mask-experimental: ${{ github.event_name == 'push' }} + ui-tests: ${{ inputs.ui-tests || false }} + + static-analysis: + name: ๐Ÿ” Static-Analysis + uses: ./.github/workflows/step_static-analysis.yml + secrets: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + permissions: + security-events: write + contents: write + checks: write + pull-requests: write + if: github.event_name != 'schedule' + + draft: + name: ๐Ÿš€ Release + needs: [ tests, static-analysis ] + uses: ./.github/workflows/step_draft.yml + permissions: + contents: write + if: github.event_name == 'push' + + pass: + name: โœ… Pass + needs: [ tests, static-analysis, draft ] + runs-on: ubuntu-latest + steps: + - name: Check all CI jobs + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} + allowed-skips: draft, static-analysis + if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d3ff9e..cf01224 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,16 +17,10 @@ jobs: contents: write pull-requests: write steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.release.tag_name }} - - # Setup Java 11 environment for the next steps - - name: Setup Java - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: zulu java-version: 17 diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml deleted file mode 100644 index 45a08f2..0000000 --- a/.github/workflows/run-ui-tests.yml +++ /dev/null @@ -1,59 +0,0 @@ -# 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@v3 - - # Setup Java 11 environment for the next steps - - name: Setup Java - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 17 - - # 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@v3 - with: - url: http://127.0.0.1:8082 - max-attempts: 15 - retry-delay: 30s - - # Run tests - - name: Tests - run: ./gradlew test diff --git a/.github/workflows/step_draft.yml b/.github/workflows/step_draft.yml new file mode 100644 index 0000000..18419d8 --- /dev/null +++ b/.github/workflows/step_draft.yml @@ -0,0 +1,39 @@ +# TODO: Unify with release.yml +name: Draft + +on: + workflow_call: + +permissions: + contents: write + +jobs: + Draft: + # TODO: Get the artifacts from a build run + # What to do with this workflow? + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # Remove old release drafts by using the curl request for the available releases with a draft flag + - name: Remove Old Release Drafts + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api repos/{owner}/{repo}/releases \ + --jq '.[] | select(.draft == true) | .id' \ + | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} + + # Create a new release draft which is not publicly visible and requires manual acceptance + - name: Create Release Draft + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create v${{ needs.build.outputs.version }} \ + --draft \ + --title "v${{ needs.build.outputs.version }}" \ + --notes "$(cat << 'EOM' + ${{ needs.build.outputs.changelog }} + EOM + )" + if: false diff --git a/.github/workflows/step_static-analysis.yml b/.github/workflows/step_static-analysis.yml new file mode 100644 index 0000000..eefd7ea --- /dev/null +++ b/.github/workflows/step_static-analysis.yml @@ -0,0 +1,29 @@ +name: Static Analysis + +on: + workflow_call: + secrets: + QODANA_TOKEN: + required: false + description: Qodana token + +permissions: + security-events: write + contents: write + checks: write + pull-requests: write + +jobs: + Qodana: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # TODO: Java setup? + - name: Qodana Scan + uses: JetBrains/qodana-action@v2023.3 + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + - name: Upload to GitHub code scanning + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json diff --git a/.github/workflows/step_tests.yml b/.github/workflows/step_tests.yml new file mode 100644 index 0000000..0da061d --- /dev/null +++ b/.github/workflows/step_tests.yml @@ -0,0 +1,180 @@ +name: ๐Ÿงช tests + +on: + workflow_call: + inputs: + mask-experimental: + type: boolean + default: true + description: Always report experimental test as successful + ui-tests: + type: boolean + default: false + description: Run UI-tests + +permissions: {} + +jobs: + + # Run Gradle Wrapper Validation Action to verify the wrapper's checksum + # Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks + # Build plugin and provide the artifact for the next workflow jobs + build: + name: ๐Ÿ› ๏ธ Build ${{ matrix.platform-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform-version: [ "2023.1", "2023.2", "2023.3", "2024.1" ] + env: + ORG_GRADLE_PROJECT_platformVersion: ${{ matrix.platform-version }} + steps: + - uses: actions/checkout@v4 + # TODO: Move this to a pre-commit check + - uses: gradle/wrapper-validation-action@v2 + - uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 17 + # Build plugin + - name: Build plugin + run: ./gradlew buildPlugin + + - uses: actions/upload-artifact@v4 + with: + name: build-artifact-${{ matrix.platform-version }} + path: ./build/distributions/* + + test: + name: ๐Ÿงช Test ${{ matrix.platform-version }} + needs: [ build ] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform-version: [ "2023.1", "2023.2", "2023.3", "2024.1" ] + env: + ORG_GRADLE_PROJECT_platformVersion: ${{ matrix.platform-version }} + steps: + - uses: actions/checkout@v4 + # TODO: Move this to a pre-commit check + - uses: gradle/wrapper-validation-action@v2 + - uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 17 + + # Run tests + - name: Run Tests + run: ./gradlew check + + # Collect Tests Result of failed tests + - name: Collect Tests Result + if: ${{ failure() }} + uses: actions/upload-artifact@v4 + with: + name: tests-result-${{ matrix.platform-version }} + path: ${{ github.workspace }}/build/reports/tests + + # Upload Kover report to CodeCov + - name: Upload Code Coverage Report + uses: codecov/codecov-action@v3 + with: + files: ${{ github.workspace }}/build/reports/kover/xml/report.xml + + verify: + name: ๐Ÿงช Verify ${{ matrix.platform-version }} + needs: [ build ] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform-version: [ "2023.1", "2023.2", "2023.3", "2024.1" ] + env: + ORG_GRADLE_PROJECT_platformVersion: ${{ matrix.platform-version }} + steps: + - uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + large-packages: false + + - uses: actions/checkout@v4 + # Set environment variables + - name: Export Properties + id: properties + shell: bash + run: | + PROPERTIES="$(./gradlew properties --console=plain -q)" + VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" + CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" + + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT + + echo "changelog<> $GITHUB_OUTPUT + echo "$CHANGELOG" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier + - uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 17 + # Cache Plugin Verifier IDEs + - name: Setup Plugin Verifier IDEs Cache + uses: actions/cache@v4 + with: + path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides + key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} + + # Run Verify Plugin task and IntelliJ Plugin Verifier tool + - name: Run Plugin Verification tasks + run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} + + # Collect Plugin Verifier Result + - name: Collect Plugin Verifier Result + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: pluginVerifier-result-${{ matrix.platform-version }} + path: ${{ github.workspace }}/build/reports/pluginVerifier + + 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 & + if: ${{ inputs.ui-tests }} + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 17 + + # 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@v3 + 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 Qodana.run.xml b/.run/Run Qodana.run.xml deleted file mode 100644 index 9603583..0000000 --- a/.run/Run Qodana.run.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - true - true - false - - - \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 5a7f688..f41e88c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,11 +9,9 @@ plugins { kotlin("jvm") version "1.8.10" id("java") // Gradle IntelliJ Plugin - id("org.jetbrains.intellij") version "1.16.1" + id("org.jetbrains.intellij") version "1.17.3" // Gradle Changelog Plugin - id("org.jetbrains.changelog") version "2.0.0" - // Gradle Qodana Plugin - id("org.jetbrains.qodana") version "0.1.13" + id("org.jetbrains.changelog") version "2.2.0" } group = properties("pluginGroup").get() @@ -36,26 +34,18 @@ java { // Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - pluginName.set(properties("pluginName")) - version.set(properties("platformVersion")) - type.set(properties("platformType")) + pluginName = properties("pluginName") + version = properties("platformVersion") + type = properties("platformType") // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file. - plugins.set(properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }) + plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) } } // Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin changelog { groups.empty() - repositoryUrl.set(properties("pluginRepositoryUrl")) -} - -// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin -qodana { - cachePath.set(provider { file(".qodana").canonicalPath }) - reportPath.set(provider { file("build/reports/inspections").canonicalPath }) - saveReport.set(true) - showReport.set(environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)) + repositoryUrl = properties("pluginRepositoryUrl") } tasks { @@ -64,12 +54,12 @@ tasks { } patchPluginXml { - version.set(properties("pluginVersion")) - sinceBuild.set(properties("pluginSinceBuild")) - untilBuild.set(properties("pluginUntilBuild")) + version = properties("pluginVersion") + sinceBuild = properties("pluginSinceBuild") + untilBuild = properties("pluginUntilBuild") // Extract the section from README.md and provide for the plugin's manifest - pluginDescription.set(providers.fileContents(layout.projectDirectory.file("README.md")).asText.map { + pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map { val start = "" val end = "" @@ -79,11 +69,11 @@ tasks { } subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML) } - }) + } val changelog = project.changelog // local variable for configuration cache compatibility // Get the latest available change notes from the changelog file - changeNotes.set(properties("pluginVersion").map { pluginVersion -> + changeNotes = properties("pluginVersion").map { pluginVersion -> with(changelog) { renderItem( (getOrNull(pluginVersion) ?: getUnreleased()) @@ -92,7 +82,7 @@ tasks { Changelog.OutputType.HTML, ) } - }) + } } // Configure UI tests plugin @@ -105,22 +95,18 @@ tasks { } signPlugin { - certificateChain.set(environment("CERTIFICATE_CHAIN")) - privateKey.set(environment("PRIVATE_KEY")) - password.set(environment("PRIVATE_KEY_PASSWORD")) + certificateChain = environment("CERTIFICATE_CHAIN") + privateKey = environment("PRIVATE_KEY") + password = environment("PRIVATE_KEY_PASSWORD") } publishPlugin { dependsOn("patchChangelog") - token.set(environment("PUBLISH_TOKEN")) + token = environment("PUBLISH_TOKEN") // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3 // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more: // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel - channels.set(properties("pluginVersion").map { - listOf( - it.split('-').getOrElse(1) { "default" }.split('.').first() - ) - }) + channels = properties("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) } } withType { diff --git a/gradle.properties b/gradle.properties index 24ad83b..dae83cd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ platformVersion = 2023.1 platformPlugins = org.jetbrains.plugins.github,org.jetbrains.plugins.yaml # Gradle Releases -> https://github.com/gradle/gradle/releases -gradleVersion = 8.0.2 +gradleVersion = 8.7 # Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib # suppress inspection "UnusedProperty" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c..e644113 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 9f4197d..b82aa23 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +202,11 @@ fi # 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"' -# 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. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85..7101f8e 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/qodana.yml b/qodana.yml index c09f8da..f1f7203 100644 --- a/qodana.yml +++ b/qodana.yml @@ -1,11 +1,8 @@ -# Qodana configuration: -# https://www.jetbrains.com/help/qodana/qodana-yaml.html +version: "1.0" + +projectJDK: "17" -version: 1.0 profile: name: qodana.recommended - projectJDK: 17 -exclude: - - name: All - paths: - - .qodana + +linter: jetbrains/qodana-jvm-community:latest