forked from lxm_plugin_idea/ADB-Wi-Fi
update intellij platform version
This commit is contained in:
@@ -1,44 +1,31 @@
|
||||
import io.gitlab.arturbosch.detekt.Detekt
|
||||
import org.jetbrains.changelog.closure
|
||||
import org.jetbrains.changelog.markdownToHTML
|
||||
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
fun properties(key: String) = project.findProperty(key).toString()
|
||||
|
||||
plugins {
|
||||
// Java support
|
||||
id("java")
|
||||
// Kotlin support
|
||||
id("org.jetbrains.kotlin.jvm") version "1.5.21"
|
||||
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
|
||||
id("org.jetbrains.intellij") version "0.6.5"
|
||||
id("org.jetbrains.intellij") version "1.1.5"
|
||||
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
|
||||
id("org.jetbrains.changelog") version "0.6.2"
|
||||
// detekt linter - read more: https://detekt.github.io/detekt/kotlindsl.html
|
||||
id("io.gitlab.arturbosch.detekt") version "1.18.1"
|
||||
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
|
||||
id("org.jlleitschuh.gradle.ktlint") version "9.4.1"
|
||||
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
|
||||
}
|
||||
|
||||
// Import variables from gradle.properties file
|
||||
val pluginGroup: String by project
|
||||
// `pluginName_` variable ends with `_` because of the collision with Kotlin magic getter in the `intellij` closure.
|
||||
// Read more about the issue: https://github.com/JetBrains/intellij-platform-plugin-template/issues/29
|
||||
val pluginName_: String by project
|
||||
val pluginVersion: String by project
|
||||
val pluginSinceBuild: String by project
|
||||
val pluginUntilBuild: String by project
|
||||
|
||||
val platformType: String by project
|
||||
val platformVersion: String by project
|
||||
val platformDownloadSources: String by project
|
||||
|
||||
group = pluginGroup
|
||||
version = pluginVersion
|
||||
group = properties("pluginGroup")
|
||||
version = properties("pluginVersion")
|
||||
|
||||
// Configure project's dependencies
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.5.1-native-mt")
|
||||
@@ -52,16 +39,14 @@ dependencies {
|
||||
// Configure gradle-intellij-plugin plugin.
|
||||
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
|
||||
intellij {
|
||||
pluginName = pluginName_
|
||||
version = platformVersion
|
||||
type = platformType
|
||||
downloadSources = 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:
|
||||
// https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
|
||||
//
|
||||
// setPlugins("java")
|
||||
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
|
||||
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@@ -72,6 +57,13 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
// Configure gradle-changelog-plugin plugin.
|
||||
// Read more: https://github.com/JetBrains/gradle-changelog-plugin
|
||||
changelog {
|
||||
version = properties("pluginVersion")
|
||||
groups = emptyList()
|
||||
}
|
||||
|
||||
// Configure detekt plugin.
|
||||
// Read more: https://detekt.github.io/detekt/kotlindsl.html
|
||||
detekt {
|
||||
@@ -88,7 +80,7 @@ detekt {
|
||||
// Configure ktlint-gradle plugin.
|
||||
// Read more: https://github.com/JLLeitschuh/ktlint-gradle
|
||||
ktlint {
|
||||
version.set("0.37.2")
|
||||
version.set("0.42.1")
|
||||
disabledRules.set(setOf("no-wildcard-imports", "import-ordering"))
|
||||
}
|
||||
|
||||
@@ -125,36 +117,37 @@ tasks {
|
||||
}
|
||||
|
||||
patchPluginXml {
|
||||
version(pluginVersion)
|
||||
sinceBuild(pluginSinceBuild)
|
||||
untilBuild(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(projectDir, "README.md").readText().lines().run {
|
||||
val start = "<!-- Plugin description -->"
|
||||
val end = "<!-- Plugin description end -->"
|
||||
pluginDescription.set(
|
||||
File(projectDir, "README.md").readText().lines().run {
|
||||
val start = "<!-- Plugin description -->"
|
||||
val end = "<!-- Plugin description end -->"
|
||||
|
||||
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) }
|
||||
}
|
||||
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) }
|
||||
)
|
||||
|
||||
// Get the latest available change notes from the changelog file
|
||||
changeNotes(
|
||||
closure {
|
||||
changelog.getLatest().toHTML()
|
||||
}
|
||||
)
|
||||
changeNotes.set(provider { changelog.getLatest().toHTML() })
|
||||
}
|
||||
|
||||
runPluginVerifier {
|
||||
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty))
|
||||
}
|
||||
|
||||
publishPlugin {
|
||||
dependsOn("patchChangelog")
|
||||
token(System.getenv("PUBLISH_TOKEN"))
|
||||
channels(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first())
|
||||
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()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,26 @@
|
||||
# -> https://www.jetbrains.org/intellij/sdk/docs/reference_guide/intellij_artifacts.html
|
||||
|
||||
pluginGroup = dev.polek.adbwifi
|
||||
pluginName_ = ADB Wi-Fi
|
||||
pluginName = ADB Wi-Fi
|
||||
pluginVersion = 1.2.3
|
||||
|
||||
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
|
||||
# for insight into build numbers and IntelliJ Platform versions.
|
||||
pluginSinceBuild = 193
|
||||
pluginUntilBuild = 212.*
|
||||
|
||||
# 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 = 2019.3.5, 2020.1.4, 2020.2.4, 2020.3.4, 2021.1.3, 2021.2.2
|
||||
|
||||
platformType = IC
|
||||
platformVersion = 2019.3
|
||||
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 =
|
||||
|
||||
# Opt-out flag for bundling Kotlin standard library.
|
||||
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
|
||||
kotlin.stdlib.default.dependency = false
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Reference in New Issue
Block a user