generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade to gradle 8.5 * Add support for 2024.3 * Prepare for release 3.0.0 * Update klint
- Loading branch information
1 parent
ea301b7
commit 64a66d3
Showing
8 changed files
with
102 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.gradle | ||
.idea | ||
build | ||
.intellijPlatform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import io.gitlab.arturbosch.detekt.Detekt | ||
import org.jetbrains.changelog.Changelog | ||
import org.jetbrains.changelog.markdownToHTML | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
fun properties(key: String) = project.findProperty(key).toString() | ||
|
@@ -9,21 +10,22 @@ plugins { | |
// Java support | ||
id("java") | ||
// Kotlin support | ||
id("org.jetbrains.kotlin.jvm") version "2.0.20" | ||
kotlin("jvm") version "2.0.20" | ||
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin | ||
id("org.jetbrains.intellij") version "1.17.4" | ||
id("org.jetbrains.intellij.platform") version "2.1.0" | ||
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin | ||
id("org.jetbrains.changelog") version "2.2.1" | ||
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html | ||
id("io.gitlab.arturbosch.detekt") version "1.23.7" | ||
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle | ||
id("org.jlleitschuh.gradle.ktlint") version "11.6.1" | ||
id("org.jlleitschuh.gradle.ktlint") version "12.1.0" | ||
// google-java-format | ||
id("com.github.sherter.google-java-format") version "0.9" | ||
// license header | ||
id("com.github.hierynomus.license") version "0.16.1" | ||
// Sonar support | ||
id("org.sonarqube") version "5.1.0.4882" | ||
// plugin verifier | ||
} | ||
|
||
group = properties("pluginGroup") | ||
|
@@ -32,23 +34,58 @@ version = properties("pluginVersion") | |
// Configure project's dependencies | ||
repositories { | ||
mavenCentral() | ||
intellijPlatform { | ||
defaultRepositories() | ||
} | ||
} | ||
|
||
dependencies { | ||
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.7") | ||
intellijPlatform { | ||
create(properties("platformType"), properties("platformVersion")) | ||
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') }) | ||
} | ||
runtimeOnly("org.jetbrains.intellij.plugins:verifier-cli:1.379") | ||
} | ||
|
||
// 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(true) | ||
|
||
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file. | ||
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty)) | ||
intellijPlatform { | ||
buildSearchableOptions = true | ||
instrumentCode = false | ||
projectName = project.name | ||
pluginConfiguration { | ||
id = "cookiecode-stepbuilder-plugin" | ||
name = "Stepbuilder Codegen" | ||
ideaVersion { | ||
sinceBuild = properties("pluginSinceBuild") | ||
untilBuild = properties("pluginUntilBuild") | ||
} | ||
vendor { | ||
name = "Sebastien Vermeille" | ||
email = "[email protected]" | ||
url = "https://cookiecode.dev" | ||
} | ||
} | ||
pluginVerification { | ||
cliPath = file("build/libs/verifier-cli-1.379.jar") | ||
|
||
ides { | ||
recommended() | ||
// select { | ||
// types = listOf(IntelliJPlatformType.IntellijIdeaCommunity) | ||
// channels = listOf(ProductRelease.Channel.RELEASE) | ||
// sinceBuild = properties("pluginSinceBuild") | ||
// untilBuild = properties("pluginUntilBuild") | ||
// } | ||
} | ||
} | ||
publishing { | ||
host = "https://plugins.jetbrains.com" | ||
token = System.getenv("PUBLISH_TOKEN") | ||
channels = listOf("default") | ||
ideServices = false | ||
hidden = false | ||
} | ||
} | ||
|
||
sonarqube { | ||
|
@@ -69,14 +106,8 @@ changelog { | |
// Configure detekt plugin. | ||
// Read more: https://detekt.github.io/detekt/kotlindsl.html | ||
detekt { | ||
config = files("./detekt-config.yml") | ||
config.setFrom(files("./detekt-config.yml")) | ||
buildUponDefaultConfig = true | ||
|
||
reports { | ||
html.enabled = false | ||
xml.enabled = false | ||
txt.enabled = false | ||
} | ||
} | ||
|
||
googleJavaFormat { | ||
|
@@ -91,21 +122,29 @@ license { | |
tasks { | ||
// Set the compatibility versions to 17 | ||
withType<JavaCompile> { | ||
sourceCompatibility = "17" | ||
targetCompatibility = "17" | ||
sourceCompatibility = properties("targetJdk") | ||
targetCompatibility = properties("targetJdk") | ||
} | ||
withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = "17" | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_17) | ||
} | ||
} | ||
|
||
withType<Detekt> { | ||
jvmTarget = "17" | ||
jvmTarget = properties("targetJdk") | ||
} | ||
|
||
withType<Detekt>().configureEach { | ||
reports { | ||
html.required.set(true) | ||
xml.required.set(true) | ||
txt.required.set(false) | ||
} | ||
} | ||
|
||
patchPluginXml { | ||
version.set(properties("pluginVersion")) | ||
sinceBuild.set(properties("pluginSinceBuild")) | ||
untilBuild.set(properties("pluginUntilBuild")) | ||
version = properties("pluginVersion") | ||
|
||
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest | ||
pluginDescription.set( | ||
|
@@ -117,23 +156,30 @@ tasks { | |
throw GradleException("Plugin description section not found in README.md:\n$start ... $end") | ||
} | ||
subList(indexOf(start) + 1, indexOf(end)) | ||
}.joinToString("\n").run { markdownToHTML(this) } | ||
}.joinToString("\n").run { | ||
markdownToHTML(this) | ||
}, | ||
) | ||
|
||
// Get the latest available change notes from the changelog file | ||
changeNotes.set(provider { changelog.renderItem(changelog.getLatest(), Changelog.OutputType.HTML) }) | ||
} | ||
} | ||
|
||
runPluginVerifier { | ||
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty)) | ||
} | ||
tasks.register<Copy>("downloadVerifierCli") { | ||
val outputDir = layout.buildDirectory.dir("libs").get().asFile | ||
|
||
from( | ||
configurations.create("verifierCli").apply { | ||
dependencies.add( | ||
project.dependencies.create("org.jetbrains.intellij.plugins:verifier-cli:1.379"), | ||
) | ||
}, | ||
) | ||
|
||
into(outputDir) | ||
|
||
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 | ||
// 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())) | ||
doLast { | ||
println("Dependency downloaded to: ${outputDir.absolutePath}") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#Mon Sep 30 18:22:08 CEST 2024 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters