-
Notifications
You must be signed in to change notification settings - Fork 176
/
build.gradle.kts
executable file
·104 lines (94 loc) · 2.99 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
100
101
102
103
104
import org.hildan.github.changelog.builder.DEFAULT_TIMEZONE
import org.hildan.github.changelog.builder.SectionDefinition
import org.jetbrains.changelog.closure
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
}
plugins {
id("org.jetbrains.intellij") version "0.7.3"
kotlin("jvm") version "1.5.20"
id("org.jetbrains.changelog") version "1.1.1"
id("org.hildan.github.changelog") version "1.6.0"
}
group = "wu.seal"
version = System.getenv("TAG") ?: "Unreleased"
intellij {
version = "2020.1"
pluginName = "JsonToKotlinClass"
}
tasks.patchPluginXml {
untilBuild("")
changeNotes(closure {
changelogForIDEPlugin.getLatest().toHTML()
})
}
tasks.publishPlugin {
token(System.getenv("token"))
channels(System.getProperty("channels", ""))
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.5.30")
testImplementation("com.winterbe:expekt:0.5.0") {
exclude(group = "org.jetbrains.kotlin")
}
}
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
tasks.getByPath("publishPlugin").dependsOn("generateChangelog")
changelogForIDEPlugin {
version = project.version.toString()
path = "${project.projectDir}/doc/CHANGELOG.md"
unreleasedTerm = "Unreleased"
itemPrefix = "**"
}
changelog {
githubUser = "wuseal"
githubRepository = rootProject.name
githubToken = findProperty("githubToken")?.toString() ?: (System.getenv("GH_TOKEN")?.toString())
title = "Change Log"
showUnreleased = true
unreleasedVersionTitle = "Unreleased"
if (!System.getenv("TAG").isNullOrEmpty()) {
println("TAG is ${System.getenv("TAG")}, Set future version to $version")
futureVersionTag = version.toString()
}
sections = listOf(
SectionDefinition("Features", "feature request"),
SectionDefinition("Bugfix", listOf("bug", "bug fix")),
SectionDefinition("Enhancement", "enhancement")
) // no custom sections by default, but default sections are prepended
includeLabels = listOf("feature request", "bug", "bug fix", "enhancement")
excludeLabels = listOf("duplicate", "invalid", "question", "wontfix")
sinceTag = "V3.0.0"
skipTags = listOf(
)
useMilestoneAsTag = true
timezone = DEFAULT_TIMEZONE
outputFile = file("${projectDir}/doc/CHANGELOG.md")
}
task("createGithubReleaseNotes") {
doLast {
val githubReleaseNoteFile = file("./githubReleaseNote.md")
val content = "**" + file("${projectDir}/doc/CHANGELOG.md").readText()
.substringAfter("**").substringBefore("##").trim()
githubReleaseNoteFile.writeText(content)
}
}
tasks.withType(KotlinCompile::class.java).configureEach {
kotlinOptions {
jvmTarget = "1.8" // Set the JVM target to match the bytecode you are inlining
}
}
tasks.buildSearchableOptions {
enabled = false
}