Skip to content

Commit 3cf3e31

Browse files
authored
98 run configuration for intellij idea disappears after ide restart (#100)
* Bump gradle * Import build from platform-plugin-template Blindly. Without this it won't build (shrug) * Bump pluginUntilBuild * Bump plugin version
1 parent c89c1f0 commit 3cf3e31

File tree

6 files changed

+240
-180
lines changed

6 files changed

+240
-180
lines changed

build.gradle.kts

Lines changed: 55 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1-
import io.gitlab.arturbosch.detekt.Detekt
1+
import org.jetbrains.changelog.Changelog
22
import org.jetbrains.changelog.markdownToHTML
3-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
43

54
fun properties(key: String) = project.findProperty(key).toString()
65

76
plugins {
87
// Java support
98
id("java")
109
// Kotlin support
11-
id("org.jetbrains.kotlin.jvm") version "1.6.10"
12-
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
13-
id("org.jetbrains.intellij") version "1.0"
14-
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
15-
id("org.jetbrains.changelog") version "1.1.2"
16-
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
17-
id("io.gitlab.arturbosch.detekt") version "1.17.1"
18-
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
19-
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
20-
}
21-
22-
ktlint {
23-
// See https://github.com/pinterest/ktlint/issues/527
24-
disabledRules.add("import-ordering")
10+
id("org.jetbrains.kotlin.jvm") version "1.8.0"
11+
// Gradle IntelliJ Plugin
12+
id("org.jetbrains.intellij") version "1.12.0"
13+
// Gradle Changelog Plugin
14+
id("org.jetbrains.changelog") version "2.0.0"
15+
// Gradle Qodana Plugin
16+
id("org.jetbrains.qodana") version "0.1.13"
17+
// Gradle Kover Plugin
18+
id("org.jetbrains.kotlinx.kover") version "0.6.1"
2519
}
2620

2721
group = properties("pluginGroup")
@@ -31,55 +25,44 @@ version = properties("pluginVersion")
3125
repositories {
3226
mavenCentral()
3327
}
34-
dependencies {
35-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.19.0")
28+
29+
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
30+
kotlin {
31+
jvmToolchain(11)
3632
}
3733

38-
// Configure gradle-intellij-plugin plugin.
39-
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
34+
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
4035
intellij {
4136
pluginName.set(properties("pluginName"))
4237
version.set(properties("platformVersion"))
4338
type.set(properties("platformType"))
44-
downloadSources.set(properties("platformDownloadSources").toBoolean())
45-
updateSinceUntilBuild.set(true)
4639

4740
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
4841
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
4942
}
5043

51-
// Configure gradle-changelog-plugin plugin.
52-
// Read more: https://github.com/JetBrains/gradle-changelog-plugin
44+
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
5345
changelog {
54-
version = properties("pluginVersion")
55-
groups = emptyList()
46+
groups.set(emptyList())
47+
repositoryUrl.set(properties("pluginRepositoryUrl"))
5648
}
5749

58-
// Configure detekt plugin.
59-
// Read more: https://detekt.github.io/detekt/kotlindsl.html
60-
detekt {
61-
config = files("./detekt-config.yml")
62-
buildUponDefaultConfig = true
50+
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
51+
qodana {
52+
cachePath.set(file(".qodana").canonicalPath)
53+
reportPath.set(file("build/reports/inspections").canonicalPath)
54+
saveReport.set(true)
55+
showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
56+
}
6357

64-
reports {
65-
html.enabled = false
66-
xml.enabled = false
67-
txt.enabled = false
68-
}
58+
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
59+
kover.xmlReport {
60+
onCheck.set(true)
6961
}
7062

7163
tasks {
72-
// Set the compatibility versions to 1.8
73-
withType<JavaCompile> {
74-
sourceCompatibility = "1.8"
75-
targetCompatibility = "1.8"
76-
}
77-
withType<KotlinCompile> {
78-
kotlinOptions.jvmTarget = "1.8"
79-
}
80-
81-
withType<Detekt> {
82-
jvmTarget = "1.8"
64+
wrapper {
65+
gradleVersion = properties("gradleVersion")
8366
}
8467

8568
patchPluginXml {
@@ -89,41 +72,50 @@ tasks {
8972

9073
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
9174
pluginDescription.set(
92-
File(projectDir, "README.md").readText().lines().run {
75+
file("README.md").readText().lines().run {
9376
val start = "<!-- Plugin description -->"
9477
val end = "<!-- Plugin description end -->"
9578

9679
if (!containsAll(listOf(start, end))) {
9780
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
9881
}
9982
subList(indexOf(start) + 1, indexOf(end))
100-
}.joinToString("\n").run { markdownToHTML(this) }
83+
}.joinToString("\n").let { markdownToHTML(it) }
10184
)
10285

10386
// Get the latest available change notes from the changelog file
104-
changeNotes.set(provider { changelog.getLatest().toHTML() })
87+
changeNotes.set(provider {
88+
with(changelog) {
89+
renderItem(
90+
getOrNull(properties("pluginVersion"))
91+
?: runCatching { getLatest() }.getOrElse { getUnreleased() },
92+
Changelog.OutputType.HTML,
93+
)
94+
}
95+
})
96+
}
97+
98+
// Configure UI tests plugin
99+
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
100+
runIdeForUiTests {
101+
systemProperty("robot-server.port", "8082")
102+
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
103+
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
104+
systemProperty("jb.consents.confirmation.enabled", "false")
105105
}
106106

107-
runPluginVerifier {
108-
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty))
107+
signPlugin {
108+
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
109+
privateKey.set(System.getenv("PRIVATE_KEY"))
110+
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
109111
}
110112

111113
publishPlugin {
112114
dependsOn("patchChangelog")
113115
token.set(System.getenv("PUBLISH_TOKEN"))
114-
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
116+
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
115117
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
116118
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
117119
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
118120
}
119-
120-
runIde {
121-
autoReloadPlugins.set(true)
122-
}
123-
124-
buildSearchableOptions {
125-
// disable when is local development
126-
// see: https://plugins.jetbrains.com/docs/intellij/ide-development-instance.html#enabling-auto-reload
127-
enabled = System.getenv("CI") != null
128-
}
129121
}

gradle.properties

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@
22
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
33
pluginGroup=no.eirikb.avatest
44
pluginName=AvaJavaScriptTestRunnerRunConfigurationGenerator
5-
pluginVersion=1.9.1
5+
pluginVersion=1.10.0
66
pluginSinceBuild=203
7-
pluginUntilBuild=222.*
7+
pluginUntilBuild=223.*
88
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
99
# See https://jb.gg/intellij-platform-builds-list for available build versions
1010
pluginVerifierIdeVersions=2020.2.4, 2020.3.2, 2021.1, 2021.2
1111
platformType=IU
12-
platformVersion=2021.1
12+
platformVersion=2022.3
1313
platformDownloadSources=true
1414
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1515
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
1616
platformPlugins=JavaScript, NodeJS
17-
# Opt-out flag for bundling Kotlin standard library.
18-
# See https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details.
17+
# Gradle Releases -> https://github.com/gradle/gradle/releases
18+
gradleVersion=7.6
19+
# Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
20+
# suppress inspection "UnusedProperty"
1921
kotlin.stdlib.default.dependency=false
22+
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
23+
# suppress inspection "UnusedProperty"
24+
org.gradle.unsafe.configuration-cache=true

gradle/wrapper/gradle-wrapper.jar

2.32 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)