-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
125 lines (105 loc) · 3.09 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
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "1.9.21"
id("org.jetbrains.intellij.platform") version "2.2.1"
id("com.diffplug.spotless") version "7.0.0.BETA2"
id("com.adarshr.test-logger") version "4.0.0"
}
// version for building plugin
val buildVersion = "2023.3"
// version for verifying plugin, check validation.yml
val verifyVersion =
if (hasProperty("verifyVersion")) {
property("verifyVersion") as String
} else {
buildVersion
}
group = "com.vaadin"
val publishChannel =
if (hasProperty("publishChannel")) {
property("publishChannel") as String
} else {
"Stable"
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin { jvmToolchain(17) }
repositories {
mavenCentral()
intellijPlatform { defaultRepositories() }
}
dependencies {
implementation("com.amplitude:java-sdk:[1.8.0,2.0)")
implementation("org.json:json:20201115")
implementation("com.vaadin:license-checker:1.13.3") {
exclude(group = "net.java.dev.jna", module = "jna")
exclude(group = "net.java.dev.jna", module = "jna-platform")
}
intellijPlatform {
intellijIdeaUltimate(buildVersion)
bundledPlugin("com.intellij.java")
bundledPlugin("org.jetbrains.idea.maven")
bundledPlugin("com.intellij.properties")
bundledPlugin("com.intellij.microservices.jvm")
bundledPlugin("JavaScript")
pluginVerifier()
zipSigner()
testFramework(TestFrameworkType.Platform)
}
testImplementation(kotlin("test"))
testImplementation("junit:junit:4.13.2")
}
intellijPlatform {
pluginConfiguration {
version =
if (hasProperty("projVersion")) {
property("projVersion") as String
} else {
"1.0-SNAPSHOT"
}
}
pluginVerification {
ides {
ide(IntelliJPlatformType.IntellijIdeaCommunity, verifyVersion)
ide(IntelliJPlatformType.IntellijIdeaUltimate, verifyVersion)
}
verificationReportsFormats = listOf(VerifyPluginTask.VerificationReportsFormats.MARKDOWN)
}
}
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
// by default the target is every '.kt' and '.kts` file in the java sourcesets
ktfmt("0.51").googleStyle().configure {
it.setMaxWidth(120)
it.setBlockIndent(4)
it.setContinuationIndent(4)
it.setRemoveUnusedImports(true)
it.setManageTrailingCommas(false)
}
}
kotlinGradle {
target("*.gradle.kts") // default target for kotlinGradle
ktfmt()
}
}
tasks {
patchPluginXml {
sinceBuild.set("233")
untilBuild.set("251.*")
}
signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
channels.set(listOf(publishChannel))
token.set(System.getenv("PUBLISH_TOKEN"))
}
test { useJUnitPlatform() }
}