diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4207647..8d05ba5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,12 +48,13 @@ jobs: - name: Gradle Wrapper Validation uses: gradle/wrapper-validation-action@v1.0.6 - # Setup Java 11 environment for the next steps + # Setup Java environment for the next steps - name: Setup Java uses: actions/setup-java@v3 with: distribution: zulu - java-version: 11 + java-version: 17 + cache: gradle # Set environment variables - name: Export Properties @@ -114,7 +115,7 @@ jobs: # Run Qodana inspections - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v2022.3.4 + uses: JetBrains/qodana-action@v2023.1.0 # Prepare plugin archive content for creating artifact - name: Prepare Plugin Artifact diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28395c8..139f79e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,12 +24,13 @@ jobs: with: ref: ${{ github.event.release.tag_name }} - # Setup Java 11 environment for the next steps + # Setup Java environment for the next steps - name: Setup Java uses: actions/setup-java@v3 with: distribution: zulu - java-version: 11 + java-version: 17 + cache: gradle # Set environment variables - name: Export Properties diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml index 363d9e8..2c41301 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/run-ui-tests.yml @@ -35,12 +35,13 @@ jobs: - name: Fetch Sources uses: actions/checkout@v3 - # Setup Java 11 environment for the next steps + # Setup Java environment for the next steps - name: Setup Java uses: actions/setup-java@v3 with: distribution: zulu - java-version: 11 + java-version: 17 + cache: gradle # Run IDEA prepared for UI testing - name: Run IDE diff --git a/build.gradle.kts b/build.gradle.kts index 4bdd192..1a91123 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,18 +5,12 @@ fun properties(key: String) = providers.gradleProperty(key) fun environment(key: String) = providers.environmentVariable(key) plugins { - // Java support - id("java") - // Kotlin support - id("org.jetbrains.kotlin.jvm") version "1.8.10" - // Gradle IntelliJ Plugin - id("org.jetbrains.intellij") version "1.13.2" - // Gradle Changelog Plugin - id("org.jetbrains.changelog") version "2.0.0" - // Gradle Qodana Plugin - id("org.jetbrains.qodana") version "0.1.13" - // Gradle Kover Plugin - id("org.jetbrains.kotlinx.kover") version "0.6.1" + id("java") // Java support + alias(libs.plugins.kotlin) // Kotlin support + alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin + alias(libs.plugins.changelog) // Gradle Changelog Plugin + alias(libs.plugins.qodana) // Gradle Qodana Plugin + alias(libs.plugins.kover) // Gradle Kover Plugin } group = properties("pluginGroup").get() @@ -27,38 +21,47 @@ repositories { mavenCentral() } +// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog +dependencies { +// implementation(libs.annotations) +} + // Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+. kotlin { - jvmToolchain(11) + jvmToolchain(17) } // 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")) + repositoryUrl = 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)) + cachePath = provider { file(".qodana").canonicalPath } + reportPath = provider { file("build/reports/inspections").canonicalPath } + saveReport = true + showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false) } // Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration -kover.xmlReport { - onCheck.set(true) +koverReport { + defaults { + xml { + onCheck = true + } + } } tasks { @@ -67,12 +70,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 = "" @@ -82,11 +85,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()) @@ -95,7 +98,7 @@ tasks { Changelog.OutputType.HTML, ) } - }) + } } // Configure UI tests plugin @@ -108,17 +111,17 @@ 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.split('-').getOrElse(1) { "default" }.split('.').first()) } } } diff --git a/gradle.properties b/gradle.properties index 0f2ef4c..8c0bc64 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,23 +2,27 @@ # -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html pluginGroup=no.eirikb.avatest pluginName=AvaJavaScriptTestRunnerRunConfigurationGenerator -pluginVersion=1.12.0 -pluginSinceBuild=203 +pluginVersion=1.11.0 +pluginSinceBuild=221 pluginUntilBuild=231.* # 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.2.4, 2020.3.2, 2021.1, 2021.2 +pluginVerifierIdeVersions=2023.1 platformType=IU -platformVersion=2022.3 +platformVersion=2023.1 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=JavaScript, NodeJS # Gradle Releases -> https://github.com/gradle/gradle/releases -gradleVersion=8.0.2 +gradleVersion=8.1.1 # Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib -# suppress inspection "UnusedProperty" kotlin.stdlib.default.dependency=false # Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html -# suppress inspection "UnusedProperty" -org.gradle.unsafe.configuration-cache=true +org.gradle.configuration-cache=true +# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html +org.gradle.caching=true +# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment +systemProp.org.gradle.unsafe.kotlin.assignment=true +# Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom +kotlin.incremental.useClasspathSnapshot=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..294becf --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,22 @@ +[versions] +# libraries +annotations = "24.0.1" + +# plugins +dokka = "1.8.10" +kotlin = "1.8.21" +changelog = "2.1.0" +gradleIntelliJPlugin = "1.14.1" +qodana = "0.1.13" +kover = "0.7.1" + +[libraries] +annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" } + +[plugins] +changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } +gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" } +kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } +qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7..c1962a7 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 bdc9a83..37aef8d 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.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d4..aeb74cb 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# 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 @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done 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 diff --git a/qodana.yml b/qodana.yml new file mode 100644 index 0000000..f388de9 --- /dev/null +++ b/qodana.yml @@ -0,0 +1,12 @@ +# Qodana configuration: +# https://www.jetbrains.com/help/qodana/qodana-yaml.html + +version: 1.0 +linter: jetbrains/qodana-jvm-community:latest +projectJDK: 17 +profile: + name: qodana.recommended +exclude: + - name: All + paths: + - .qodana diff --git a/settings.gradle.kts b/settings.gradle.kts index 6083380..742ba4c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1 @@ -rootProject.name = "AvaJavaScriptTestRunnerRunConfigurationGenerator" +rootProject.name = "intellislit"