-
Notifications
You must be signed in to change notification settings - Fork 255
/
build.gradle.kts
111 lines (91 loc) · 3.06 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
105
106
107
108
109
110
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.Changelog.OutputType.HTML
import org.jetbrains.changelog.Changelog.OutputType.MARKDOWN
plugins {
// Must match the Kotlin version bundled with the IDE
// https://plugins.jetbrains.com/docs/intellij/using-kotlin.html#kotlin-standard-library
// https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
id("org.jetbrains.kotlin.jvm") version "1.9.24"
// https://github.com/JetBrains/intellij-platform-gradle-plugin
id("org.jetbrains.intellij.platform") version "2.0.1"
// https://github.com/ajoberstar/reckon
id("org.ajoberstar.reckon") version "0.14.0"
// https://github.com/b3er/gradle-local-properties-plugin
id("com.github.b3er.local.properties") version "1.1"
// https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "2.0.0"
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
intellijPlatform {
pluginConfiguration {
name = "adb_idea"
group = "com.developerphil.intellij.plugin.adbidea"
changeNotes.set(provider { recentChanges(HTML) })
ideaVersion.sinceBuild.set(project.property("sinceBuild").toString())
ideaVersion.untilBuild.set(provider { null })
}
buildSearchableOptions.set(false)
instrumentCode = true
}
changelog {
repositoryUrl.set("https://github.com/pbreault/adb-idea")
itemPrefix.set("-")
keepUnreleasedSection.set(true)
unreleasedTerm.set("[Unreleased]")
groups.empty()
combinePreReleases.set(true)
}
reckon {
scopeFromProp()
snapshotFromProp()
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.runIde {
jvmArgs = listOf("-Xmx4096m", "-XX:+UnlockDiagnosticVMOptions")
}
tasks.register("printLastChanges") {
doLast {
println(recentChanges(outputType = MARKDOWN))
println(recentChanges(outputType = HTML))
}
}
val localIdePath: String? by project.extra
localIdePath?.let {
val runLocalIde by intellijPlatformTesting.runIde.registering {
localPath.set(file(it))
}
}
dependencies {
intellijPlatform {
bundledPlugin("org.jetbrains.android")
instrumentationTools()
if (project.hasProperty("localIdeOverride")) {
local(property("localIdeOverride").toString())
} else {
androidStudio(property("ideVersion").toString())
}
}
implementation("org.jooq:joor-java-8:0.9.14")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-core:4.7.0")
testImplementation("com.google.truth:truth:1.4.4")
}
fun recentChanges(outputType: Changelog.OutputType): String {
var s = ""
changelog.getAll().toList().drop(1) // drop the [Unreleased] section
.take(5) // last 5 changes
.forEach { (key, _) ->
s += changelog.renderItem(
changelog.get(key).withHeader(true).withEmptySections(false), outputType
)
}
return s
}