-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
99 lines (82 loc) · 2.33 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import org.jetbrains.changelog.closure
import org.jetbrains.changelog.markdownToHTML
plugins {
kotlin("jvm") version "1.4.0-rc"
id("org.jetbrains.intellij") version "0.4.21"
id("org.jetbrains.changelog") version "0.4.0"
id("io.gitlab.arturbosch.detekt") version "1.10.0"
id("org.jlleitschuh.gradle.ktlint") version "9.2.1"
}
val pluginGroup: String by project
val pluginId: 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
repositories {
mavenCentral()
jcenter()
}
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.10.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
}
intellij {
pluginName = pluginId
version = platformVersion
type = platformType
downloadSources = platformDownloadSources.toBoolean()
updateSinceUntilBuild = true
setPlugins(
"com.tang:1.3.4.157-IDEA202" // EmmyLua
)
}
detekt {
config = files("./detekt-config.yml")
buildUponDefaultConfig = true
reports {
html.enabled = false
xml.enabled = false
txt.enabled = false
}
}
tasks {
patchPluginXml {
version(pluginVersion)
sinceBuild(pluginSinceBuild)
untilBuild(pluginUntilBuild)
pluginDescription(closure {
File("./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 file:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end))
}.joinToString("\n").run { markdownToHTML(this) }
})
changeNotes(closure {
changelog.getLatest().toHTML()
})
}
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
sourceSets {
main {
java.srcDir("src/main/gen")
}
}
kotlin {
sourceSets {
main {
kotlin.srcDir("src/main/gen")
}
}
}