Skip to content

Commit ae36949

Browse files
committed
chore(project): update to gradle 2.0
1 parent 211c016 commit ae36949

12 files changed

+211
-180
lines changed

.idea/jarRepositories.xml

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinScripting.xml

-9
This file was deleted.

.idea/kotlinc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

+135-119
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,180 @@
1-
/*
1+
/**
2+
* ****************************************************************************
23
* The MIT License (MIT)
34
*
4-
* Copyright (c) 2021 Elior "Mallowigi" Boukhobza
5+
* Copyright (c) 2015-2024 Elior "Mallowigi" Boukhobza
56
*
6-
* Permission is hereby granted, free of charge, to any person obtaining a copy
7-
* of this software and associated documentation files (the "Software"), to deal
8-
* in the Software without restriction, including without limitation the rights
9-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
* copies of the Software, and to permit persons to whom the Software is
11-
* furnished to do so, subject to the following conditions:
7+
* Permission is hereby granted, free of charge, to any person obtaining
8+
* a copy of this software and associated documentation files (the
9+
* "Software"), to deal in the Software without restriction, including
10+
* without limitation the rights to use, copy, modify, merge, publish,
11+
* distribute, sublicense, and/or sell copies of the Software, and to
12+
* permit persons to whom the Software is furnished to do so, subject to
13+
* the following conditions:
1214
*
13-
* The above copyright notice and this permission notice shall be included in all
14-
* copies or substantial portions of the Software.
15+
* The above copyright notice and this permission notice shall be included
16+
* in all copies or substantial portions of the Software.
1517
*
16-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22-
* SOFTWARE.
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
22+
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
23+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25+
* ****************************************************************************
2326
*/
27+
2428
@file:Suppress("SpellCheckingInspection", "HardCodedStringLiteral")
2529

2630
import io.gitlab.arturbosch.detekt.Detekt
31+
import kotlinx.coroutines.runBlocking
2732
import org.jetbrains.changelog.Changelog
33+
import org.jetbrains.changelog.markdownToHTML
34+
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
35+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
36+
37+
fun properties(key: String) = providers.gradleProperty(key).get()
38+
fun environment(key: String) = providers.environmentVariable(key)
39+
fun fileContents(filePath: String) = providers.fileContents(layout.projectDirectory.file(filePath)).asText
40+
41+
val platformVersion: String by project
42+
43+
val pluginName: String by project
44+
val pluginID: String by project
45+
val pluginVersion: String by project
46+
val pluginDescription: String by project
47+
val pluginSinceBuild: String by project
48+
val pluginUntilBuild: String by project
2849

29-
fun properties(key: String) = project.findProperty(key).toString()
50+
val pluginVendorName: String by project
51+
val pluginVendorEmail: String by project
52+
val pluginVendorUrl: String by project
53+
54+
val pluginChannels: String by project
55+
56+
val javaVersion: String by project
57+
val gradleVersion: String by project
3058

3159
plugins {
32-
// Java support
3360
id("java")
34-
// Kotlin support
35-
id("org.jetbrains.kotlin.jvm") version "1.9.22"
36-
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
37-
id("org.jetbrains.intellij") version "1.17.0"
38-
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
39-
id("org.jetbrains.changelog") version "2.2.0"
40-
// Gradle Qodana Plugin
41-
id("org.jetbrains.qodana") version "2023.2.1"
42-
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
43-
id("io.gitlab.arturbosch.detekt") version "1.23.4"
44-
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
45-
id("org.jlleitschuh.gradle.ktlint") version "12.1.0"
61+
62+
alias(libs.plugins.kotlin)
63+
alias(libs.plugins.gradleIntelliJPlugin)
64+
alias(libs.plugins.changelog)
65+
alias(libs.plugins.detekt)
66+
alias(libs.plugins.ktlint)
4667
}
4768

48-
group = properties("pluginGroup")
49-
version = properties("pluginVersion")
69+
group = pluginID
70+
version = pluginVersion
5071

51-
// Configure project's dependencies
5272
repositories {
5373
mavenCentral()
54-
maven(url = "https://maven-central.storage-download.googleapis.com/repos/central/data/")
55-
maven(url = "https://repo.eclipse.org/content/groups/releases/")
56-
maven(url = "https://www.jetbrains.com/intellij-repository/releases")
57-
maven(url = "https://www.jetbrains.com/intellij-repository/snapshots")
74+
mavenLocal()
75+
gradlePluginPortal()
76+
77+
intellijPlatform {
78+
defaultRepositories()
79+
}
5880
}
5981

6082
dependencies {
61-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.4")
62-
implementation("com.jgoodies:jgoodies-forms:1.9.0")
63-
implementation("com.thoughtworks.xstream:xstream:1.4.20")
64-
implementation("org.javassist:javassist:3.30.2-GA")
65-
implementation("com.mixpanel:mixpanel-java:1.5.2")
83+
intellijPlatform {
84+
intellijIdeaUltimate(platformVersion, useInstaller = false)
85+
instrumentationTools()
86+
// local(properties("idePath"))
87+
88+
pluginVerifier()
89+
zipSigner()
90+
}
91+
92+
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.6")
6693
}
6794

68-
// Configure gradle-intellij-plugin plugin.
69-
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
70-
intellij {
71-
pluginName.set(properties("pluginName"))
72-
version.set(properties("platformVersion"))
73-
type.set(properties("platformType"))
74-
downloadSources.set(true)
75-
instrumentCode.set(true)
76-
updateSinceUntilBuild.set(true)
77-
// localPath.set(properties("idePath"))
78-
79-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
80-
plugins.set(listOf("java"))
95+
intellijPlatform {
96+
buildSearchableOptions = false
97+
instrumentCode = true
98+
99+
projectName = pluginName
100+
101+
pluginConfiguration {
102+
id = pluginID
103+
name = pluginName
104+
version = pluginVersion
105+
description = pluginDescription
106+
107+
// Get the latest available change notes from the changelog file
108+
val changelog = project.changelog // local variable for configuration cache compatibility
109+
// Get the latest available change notes from the changelog file
110+
val pluginVersion = pluginVersion
111+
changeNotes.set(provider {
112+
with(changelog) {
113+
renderItem(
114+
(getOrNull(pluginVersion) ?: getUnreleased()).withHeader(false).withEmptySections(false),
115+
Changelog.OutputType.HTML,
116+
)
117+
}
118+
})
119+
120+
ideaVersion {
121+
sinceBuild = pluginSinceBuild
122+
untilBuild = pluginUntilBuild
123+
}
124+
125+
vendor {
126+
name = pluginVendorName
127+
email = pluginVendorEmail
128+
url = pluginVendorUrl
129+
}
130+
}
131+
132+
publishing {
133+
token = environment("INTELLIJ_PUBLISH_TOKEN")
134+
channels = pluginChannels.split(',').map { it.trim() }
135+
}
136+
137+
signing {
138+
certificateChain = fileContents("./chain.crt")
139+
privateKey = fileContents("./private.pem")
140+
password = fileContents("./private_encrypted.pem")
141+
}
142+
143+
pluginVerification {
144+
ides {
145+
recommended()
146+
select {
147+
sinceBuild = pluginSinceBuild
148+
untilBuild = pluginUntilBuild
149+
}
150+
}
151+
}
81152
}
82-
// Configure gradle-changelog-plugin plugin.
83-
// Read more: https://github.com/JetBrains/gradle-changelog-plugin
153+
84154
changelog {
85155
path.set("${project.projectDir}/docs/CHANGELOG.md")
86-
version.set(properties("pluginVersion"))
87-
header.set(provider { version.get() })
156+
version.set(pluginVersion)
157+
// header.set(provider { version })
88158
itemPrefix.set("-")
89159
keepUnreleasedSection.set(true)
90160
unreleasedTerm.set("Changelog")
91161
groups.set(listOf("Features", "Fixes", "Removals", "Other"))
92162
}
93163

94-
// Configure detekt plugin.
95-
// Read more: https://detekt.github.io/detekt/kotlindsl.html
96164
detekt {
97-
config = files("./detekt-config.yml")
165+
config.from(files("./detekt-config.yml"))
98166
buildUponDefaultConfig = true
99167
autoCorrect = true
100168
}
101169

102-
103170
tasks {
104-
properties("javaVersion").let {
171+
javaVersion.let {
105172
// Set the compatibility versions to 1.8
106173
withType<JavaCompile> {
107174
sourceCompatibility = it
108175
targetCompatibility = it
109176
}
110-
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
177+
withType<KotlinCompile> {
111178
kotlinOptions.jvmTarget = it
112179
kotlinOptions.freeCompilerArgs += listOf("-Xskip-prerelease-check", "-Xjvm-default=all")
113180
}
@@ -118,7 +185,7 @@ tasks {
118185
}
119186

120187
withType<Detekt> {
121-
jvmTarget = properties("javaVersion")
188+
jvmTarget = javaVersion
122189
reports.xml.required.set(true)
123190
}
124191

@@ -133,61 +200,10 @@ tasks {
133200
}
134201
}
135202

136-
patchPluginXml {
137-
version.set(properties("pluginVersion"))
138-
sinceBuild.set(properties("pluginSinceBuild"))
139-
untilBuild.set(properties("pluginUntilBuild"))
140-
141-
// Get the latest available change notes from the changelog file
142-
changeNotes.set(provider {
143-
changelog.renderItem(
144-
changelog
145-
.getUnreleased()
146-
.withHeader(false)
147-
.withEmptySections(false),
148-
Changelog.OutputType.HTML
149-
)
150-
})
151-
}
152-
153-
runPluginVerifier {
154-
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map { it.trim() }.toList())
155-
}
156-
157-
buildSearchableOptions {
158-
enabled = false
159-
}
160-
161-
// Configure UI tests plugin
162-
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
163-
runIdeForUiTests {
164-
systemProperty("robot-server.port", "8082")
165-
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
166-
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
167-
systemProperty("jb.consents.confirmation.enabled", "false")
168-
}
169-
170-
// runIde {
171-
// jvmArgs = properties("jvmArgs").split("")
172-
// systemProperty("jb.service.configuration.url", properties("salesUrl"))
173-
// }
174-
175-
signPlugin {
176-
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
177-
privateKey.set(System.getenv("PRIVATE_KEY"))
178-
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
179-
}
180-
181-
publishPlugin {
182-
// dependsOn("patchChangelog")
183-
token.set(System.getenv("INTELLIJ_PUBLISH_TOKEN") ?: file("./publishToken").readText().trim())
184-
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
185-
}
186-
187203
register("markdownToHtml") {
188204
val input = File("./docs/CHANGELOG.md")
189205
File("./docs/CHANGELOG.html").run {
190-
writeText(org.jetbrains.changelog.markdownToHTML(input.readText()))
206+
writeText(markdownToHTML(input.readText()))
191207
}
192208
}
193209
}

docs/CHANGELOG.html

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<h2>Changelog</h2>
22

3+
<h1>20.0.0</h1>
4+
5+
<h3>Features</h3>
6+
<ul><li>Add Compact and Compact Contrast themes<ul><li>Compact line height</li><li>Compact tab height</li></ul></li></ul>
7+
38
<h1>19.0.0</h1>
49

510
<h3>Features</h3>

0 commit comments

Comments
 (0)