forked from flikas/archived-idea-spring-boot-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
112 lines (97 loc) · 3.36 KB
/
build.gradle.kts
File metadata and controls
112 lines (97 loc) · 3.36 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
import org.gradle.api.JavaVersion.VERSION_1_8
import org.jetbrains.changelog.date
import org.jetbrains.changelog.markdownToHTML
buildscript {
repositories {
mavenCentral()
}
}
plugins {
java
id("org.jetbrains.intellij") version "1.2.1"
id("org.jetbrains.changelog") version "1.2.1"
id("io.freefair.lombok") version "6.2.0"
}
java {
sourceCompatibility = VERSION_1_8
}
group = "dev.flikas"
version = "0.2.3-alpha"
repositories {
mavenCentral()
}
dependencies {
implementation("org.apache.commons", "commons-collections4", "4.4")
implementation("com.miguelfonseca.completely", "completely-core", "0.9.0")
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.8.1")
testImplementation("org.mockito", "mockito-core", "2.12.0")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "5.8.1")
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
type.set("IC")
version.set("2021.2.3")
plugins.set(listOf("properties", "yaml", "maven", "gradle", "com.intellij.java"))
downloadSources.set(true)
}
changelog {
header.set(provider { "[${version.get()}] - ${date()}" })
}
tasks {
patchPluginXml {
sinceBuild.set("193.5233.102")
untilBuild.set("213.4928.*")
version.set(
project.version.toString().run {
val pieces = split('-')
if (pieces.size > 1) {
pieces[0] + "." + (System.currentTimeMillis() / 1000 - 1633046400) / 60
} else {
pieces[0]
}
}
)
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription.set(
projectDir.resolve("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(
separator = "\n",
postfix = "\nProject [document](https://github.com/flikas/idea-spring-boot-assistant/#readme)\n"
).run { markdownToHTML(this) }
)
changeNotes.set(provider {
changelog.run {
getOrNull(version.get()) ?: getLatest()
}.toHTML()
})
}
signPlugin {
cliVersion.set("0.1.8")
val chain = rootProject.file("chain.crt")
if (chain.exists()) {
certificateChainFile.set(chain)
} else {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
}
val private = rootProject.file("private.pem")
if (private.exists()) {
privateKeyFile.set(rootProject.file("private.pem"))
} else {
privateKey.set(System.getenv("PRIVATE_KEY"))
}
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
if (!version.toString().contains('-')) {
dependsOn("patchChangelog")
}
token.set(System.getenv("PUBLISH_TOKEN"))
channels.set(listOf(version.toString().split('-').getOrElse(1) { "default" }.split('.').first()))
}
}