diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 592fdc7..f4b6ec3 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -15,5 +15,6 @@
+
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 238bf8c..a89246b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
# wgsl plugin Changelog
## [Unreleased]
+- update for 2024.1
## [0.0.30]
- support for multi-line preprocessor declarations - #71
diff --git a/build.gradle.kts b/build.gradle.kts
index 8198034..db13ae6 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,93 +1,104 @@
+import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-fun properties(key: String) = project.findProperty(key).toString()
+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.20"
- // Gradle IntelliJ Plugin
- id("org.jetbrains.intellij") version "1.13.3"
- // Gradle Changelog Plugin
- id("org.jetbrains.changelog") version "1.3.1"
- // Gradle Qodana Plugin
- id("org.jetbrains.qodana") version "0.1.13"
+ 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")
-version = properties("pluginVersion")
+group = properties("pluginGroup").get()
+version = properties("pluginVersion").get()
// Configure project's dependencies
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.
+kotlin {
+ jvmToolchain(17)
+}
+
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
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").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 {
- version.set(properties("pluginVersion"))
- groups.set(emptyList())
+ groups.empty()
+ repositoryUrl = properties("pluginRepositoryUrl")
}
// 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 JVM compatibility versions
- properties("javaVersion").let {
- withType {
- sourceCompatibility = it
- targetCompatibility = it
- }
- withType {
- kotlinOptions.jvmTarget = it
+//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)
+//}
+
+// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
+koverReport {
+ defaults {
+ xml {
+ onCheck = true
}
}
+}
+tasks {
wrapper {
- gradleVersion = properties("gradleVersion")
+ gradleVersion = properties("gradleVersion").get()
}
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(
- projectDir.resolve("README.md").readText().lines().run {
- val start = ""
- val end = ""
+ pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
+ val start = ""
+ val end = ""
+ with (it.lines()) {
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) }
- )
+ 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(provider {
- changelog.run {
- getOrNull(properties("pluginVersion")) ?: getLatest()
- }.toHTML()
- })
+ changeNotes = properties("pluginVersion").map { pluginVersion ->
+ with(changelog) {
+ renderItem(
+ (getOrNull(pluginVersion) ?: getUnreleased())
+ .withHeader(false)
+ .withEmptySections(false),
+ Changelog.OutputType.HTML,
+ )
+ }
+ }
}
// Configure UI tests plugin
@@ -100,18 +111,18 @@ tasks {
}
signPlugin {
- certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
- privateKey.set(System.getenv("PRIVATE_KEY"))
- password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
+ certificateChain = environment("CERTIFICATE_CHAIN")
+ privateKey = environment("PRIVATE_KEY")
+ password = environment("PRIVATE_KEY_PASSWORD")
}
publishPlugin {
dependsOn("patchChangelog")
- token.set(System.getenv("PUBLISH_TOKEN"))
- // pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
+ 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(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
+ channels = properties("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
}
}
diff --git a/gradle.properties b/gradle.properties
index 4e47d82..e3bed42 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -9,23 +9,29 @@ pluginVersion = 0.0.30
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild = 222
-pluginUntilBuild = 233.*
+pluginUntilBuild = 241.*
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IC
-platformVersion = 2023.2
+platformVersion = 2022.2
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = org.intellij.plugins.markdown
-# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
-javaVersion = 11
+# Java language level used to compile sources and to generate the files for - Java 17 is required since 2022.2
+javaVersion = 17
# Gradle Releases -> https://github.com/gradle/gradle/releases
-gradleVersion = 7.6
+gradleVersion = 8.6
# Opt-out flag for bundling Kotlin standard library.
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
# suppress inspection "UnusedProperty"
kotlin.stdlib.default.dependency = false
+
+# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
+org.gradle.configuration-cache = true
+
+# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
+org.gradle.caching = true
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
new file mode 100644
index 0000000..e2d2590
--- /dev/null
+++ b/gradle/libs.versions.toml
@@ -0,0 +1,20 @@
+[versions]
+# libraries
+annotations = "24.1.0"
+
+# plugins
+kotlin = "1.9.23"
+changelog = "2.2.0"
+gradleIntelliJPlugin = "1.17.2"
+qodana = "2023.3.1"
+kover = "0.7.6"
+
+[libraries]
+annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
+
+[plugins]
+changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
+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" }
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index e750102..92c1ac1 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
+zipStorePath=wrapper/dists
\ No newline at end of file
diff --git a/settings.gradle.kts b/settings.gradle.kts
index fc0c070..2e0c38e 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -1 +1,5 @@
+plugins {
+ id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
+}
+
rootProject.name = "intellij-wgsl"