Skip to content

Commit

Permalink
sync with template v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
minh.tran committed May 28, 2021
1 parent 941824d commit 0e5afbc
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 56 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

# Validate wrapper
- name: Gradle Wrapper Validation
Expand All @@ -40,13 +40,14 @@ jobs:

# Setup Java 1.8 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: zulu
java-version: 8

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

# Cache Gradle dependencies
- name: Setup Gradle Dependencies Cache
Expand Down Expand Up @@ -85,9 +86,10 @@ jobs:

# Setup Java 1.8 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: zulu
java-version: 8

# Check out current repository
- name: Fetch Sources
Expand Down Expand Up @@ -147,13 +149,14 @@ jobs:

# Setup Java 1.8 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: zulu
java-version: 8

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

# Cache Gradle Dependencies
- name: Setup Gradle Dependencies Cache
Expand Down Expand Up @@ -202,7 +205,7 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

# Remove old release drafts by using the curl request for the available releases with draft flag
- name: Remove Old Release Drafts
Expand All @@ -218,7 +221,7 @@ jobs:
# Create new release draft - which is not publicly visible and requires manual acceptance
- name: Create Release Draft
id: createDraft
uses: actions/create-release@v1
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -236,7 +239,7 @@ jobs:
# Upload artifact as a release asset
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ jobs:

# Setup Java 1.8 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: zulu
java-version: 8

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4
with:
ref: ${{ github.event.release.tag_name }}

Expand All @@ -41,13 +42,14 @@ jobs:

# Setup Java 1.8 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: zulu
java-version: 8

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4
with:
ref: ${{ github.event.release.tag_name }}

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!-- Keep a Changelog guide -> https://keepachangelog.com -->
## [Latest release]
- support since-build: 201 and until-build: 211.*
- sync with intellij-platform-plugin-template v0.10.0

## [1.1.9]
- set `explicitToJson: true` by default
Expand Down
62 changes: 27 additions & 35 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.changelog.closure
import org.jetbrains.changelog.date
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand All @@ -10,13 +9,13 @@ plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.5.0"
id("org.jetbrains.kotlin.jvm") version "1.5.10"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "0.7.3"
id("org.jetbrains.intellij") version "1.0"
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "1.1.2"
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
id("io.gitlab.arturbosch.detekt") version "1.16.0"
id("io.gitlab.arturbosch.detekt") version "1.17.1"
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
}
Expand All @@ -27,33 +26,32 @@ version = properties("pluginVersion")
// Configure project's dependencies
repositories {
mavenCentral()
jcenter()
}
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.16.0")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.17.1")
}

// 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 = true
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.
setPlugins(*properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray())
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}

// Configure gradle-changelog-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
version = properties("pluginVersion")
keepUnreleasedSection = true
itemPrefix = "-"
unreleasedTerm = "[Latest release]"
groups = emptyList()
closure { "[$version] - ${date()}" }
}

// Configure detekt plugin.
Expand Down Expand Up @@ -84,42 +82,36 @@ tasks {
}

patchPluginXml {
version(properties("pluginVersion"))
sinceBuild(properties("pluginSinceBuild"))
untilBuild(properties("pluginUntilBuild"))
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))

// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription(
closure {
File("./DESCRIPTION.md")
.readText().lines()
.joinToString("\n")
.run { markdownToHTML(this) }
}

pluginDescription.set(
File("./DESCRIPTION.md")
.readText().lines()
.joinToString("\n")
.run { markdownToHTML(this) }
)

// Get the latest available change notes from the changelog file

changeNotes(
closure {
File("./CHANGELOG.md")
.readText().lines()
.joinToString("\n")
.run { markdownToHTML(this) }
}
)
changeNotes.set(provider { File("./CHANGELOG.md")
.readText().lines()
.joinToString("\n")
.run { markdownToHTML(this) } })
}

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"))
// 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(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first())
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

pluginGroup = com.github.tbm98.fluttergeneratorsnippets
pluginName = flutter_generator_snippets
pluginVersion = 1.2.0
pluginVersion = 1.3.0
pluginSinceBuild = 201
pluginUntilBuild = 211.*
# 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
pluginVerifierIdeVersions = 2020.2.4, 2020.3.4, 2021.1.2

platformType = IC
platformVersion = 2021.1
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.8.2-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 0e5afbc

Please sign in to comment.