Skip to content

Commit

Permalink
upgrading build script to latest intellij gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ahus1 committed Aug 7, 2021
1 parent 9ed60b3 commit 008564e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:

# Run verifyPlugin Gradle task
- name: Verify Plugin
run: ./gradlew verifyPlugin
run: ./gradlew --stacktrace verifyPlugin

# Build plugin with buildPlugin Gradle task and provide the artifact for the next workflow jobs
# Requires test job to be passed
Expand Down
29 changes: 14 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ version = properties("pluginVersion")
// Configure project's dependencies
repositories {
mavenCentral()
jcenter()
}
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.17.1")
Expand All @@ -42,11 +41,11 @@ dependencies {
// Configure gradle-intellij-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
pluginName = properties("pluginName")
version = properties("platformVersion")
type = properties("platformType")
downloadSources = properties("platformDownloadSources").toBoolean()
updateSinceUntilBuild = false // don't write information of current IntelliJ build into plugin.xml, instead use information from patchPluginXml
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
type.set(properties("platformType"))
downloadSources.set(properties("platformDownloadSources").toBoolean())
updateSinceUntilBuild.set(false) // don't write information of current IntelliJ build into plugin.xml, instead use information from patchPluginXml

// Plugin Dependencies:
// https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
Expand Down Expand Up @@ -101,13 +100,13 @@ tasks {
jvmTarget = "11"
}
patchPluginXml {
version(properties("pluginVersion"))
sinceBuild(properties("pluginSinceBuild"))
version.set(properties("pluginVersion"))
sinceBuild.set((properties("pluginSinceBuild")))
// untilBuild(pluginUntilBuild) --> don't set "untilBuild" to allow new versions to use existing plugin without changes until breaking API changes are known

// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription(
closure {
pluginDescription.set(
provider {
File(projectDir, "README.md").readText().lines().run {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"
Expand All @@ -121,22 +120,22 @@ tasks {
)

// Get the latest available change notes from the changelog file
changeNotes(
closure {
changeNotes.set(
provider {
changelog.getLatest().toHTML()
}
)
}

runPluginVerifier {
ideVersions(properties("pluginVerifierIdeVersions"))
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty))
}

publishPlugin {
dependsOn("patchChangelog")
token(System.getenv("PUBLISH_TOKEN"))
token.set(System.getenv("PUBLISH_TOKEN"))
// if release is marked as a pre-release in the GitHub release, push it to EAP
channels(if ("true" == System.getenv("PRE_RELEASE")) "EAP" else "default")
channels.set(listOf(if ("true" == System.getenv("PRE_RELEASE")) "EAP" else "default"))
}
changelog {
version = properties("pluginVersion")
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 008564e

Please sign in to comment.