Skip to content

Commit 5045014

Browse files
committed
build: externalize plugin properties
1 parent dbe96ec commit 5045014

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22

33
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
44

5+
fun properties(key: String) = project.findProperty(key).toString()
6+
57
plugins {
68
id("org.jetbrains.intellij") version "1.6.0"
79
kotlin("jvm") version "1.7.0-RC2"
810
}
911

1012
group = "com.github.lppedd"
11-
version = "0.1.2"
1213

1314
repositories {
1415
mavenCentral()
1516
}
1617

1718
intellij {
18-
type.set("IU")
19-
version.set("2019.2")
19+
type.set(properties("platformType"))
20+
version.set(properties("platformVersion"))
2021
downloadSources.set(true)
2122
pluginName.set("idea-conventional-commit-commitlint")
2223
plugins.set(listOf("com.github.lppedd.idea-conventional-commit:0.15.3"))
@@ -41,7 +42,7 @@ tasks {
4142

4243
patchPluginXml {
4344
version.set(project.version.toString())
44-
sinceBuild.set("192")
45+
sinceBuild.set(properties("pluginSinceBuild"))
4546
untilBuild.set(null as String?)
4647

4748
val projectPath = projectDir.path

gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
version=0.1.2
2+
platformType=IU
3+
platformVersion=2019.2
4+
pluginSinceBuild=192
15
kotlin.code.style=official

0 commit comments

Comments
 (0)