-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle.kts
135 lines (117 loc) · 4.92 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import org.jetbrains.changelog.closure
import org.jetbrains.changelog.markdownToHTML
plugins {
id("java")
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.intellij") version "0.7.2"
id("org.jetbrains.changelog") version "1.1.2"
id("maven-publish")
}
val vertxVersion = ext.get("vertxVersion")
// Import variables from gradle.properties file
val pluginGroup: String by project
val pluginName: String by project
val pluginVersion: String by project
val pluginSinceBuild: String by project
val pluginUntilBuild: String by project
val pluginVerifierIdeVersions: String by project
val platformType: String by project
val platformVersion: String by project
val platformPlugins: String by project
val platformDownloadSources: String by project
group = pluginGroup
version = pluginVersion
intellij {
pluginName = "SourceMarker"
version = platformVersion
type = platformType
downloadSources = platformDownloadSources.toBoolean()
updateSinceUntilBuild = true
setPlugins(*platformPlugins.split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray())
}
tasks.getByName("buildSearchableOptions").onlyIf { false } //todo: figure out how to remove
tasks.getByName<JavaExec>("runIde") {
systemProperty("sourcemarker.debug.capture_logs", true)
}
changelog {
version = pluginVersion
}
repositories {
maven(url = "https://jitpack.io") { name = "jitpack" }
}
dependencies {
implementation(project(":mapper"))
implementation(project(":marker"))
implementation(project(":monitor:skywalking"))
implementation(project(":protocol"))
implementation(project(":portal"))
implementation("com.github.sh5i:git-stein:v0.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3-native-mt")
implementation("io.vertx:vertx-core:$vertxVersion")
implementation("io.vertx:vertx-lang-kotlin:$vertxVersion")
implementation("io.vertx:vertx-lang-kotlin-coroutines:$vertxVersion")
implementation("io.vertx:vertx-web:$vertxVersion")
//implementation("io.vertx:vertx-service-discovery:$vertxVersion")
implementation(files(".ext/vertx-service-discovery-4.0.3-SNAPSHOT.jar"))
implementation("io.vertx:vertx-service-proxy:$vertxVersion")
implementation("io.vertx:vertx-tcp-eventbus-bridge:$vertxVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.2")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.2")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-guava:2.12.2")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.12.2")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.4.31")
implementation("io.dropwizard.metrics:metrics-core:4.1.18")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.1.1")
implementation("org.jooq:jooq:3.14.8")
implementation("org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5")
implementation("org.apache.commons:commons-lang3:3.12.0")
}
tasks {
patchPluginXml {
version(pluginVersion)
sinceBuild(pluginSinceBuild)
untilBuild(pluginUntilBuild)
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription(
closure {
File(rootProject.projectDir, "./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) }
}
)
// Get the latest available change notes from the changelog file
changeNotes(
closure {
changelog.getLatest().toHTML()
}
)
}
publishPlugin {
dependsOn("patchChangelog")
token(System.getenv("PUBLISH_TOKEN"))
channels(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first())
}
runPluginVerifier {
ideVersions(pluginVerifierIdeVersions)
}
//todo: should be a way to just add implementation() to dependencies
getByName("processResources") {
dependsOn(":portal:build")
doLast {
copy {
from(file("$rootDir/portal/build/distributions/portal.js"))
into(file("$rootDir/plugin/jetbrains/build/resources/main"))
}
copy {
from(file("$rootDir/portal/build/distributions/portal.js.map"))
into(file("$rootDir/plugin/jetbrains/build/resources/main"))
}
}
}
}
sourceSets.main.get().java.srcDirs(sourceSets.main.get().java.srcDirs, "$rootDir/protocol/build/generated/source/kapt/main")