-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
116 lines (97 loc) · 3.28 KB
/
build.gradle.kts
File metadata and controls
116 lines (97 loc) · 3.28 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
113
114
115
116
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
fun config(name: String) = project.findProperty(name).toString()
repositories {
mavenLocal()
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
plugins {
java
alias(libs.plugins.kotlin)
alias(libs.plugins.intelliJPlatform)
id("dev.meanmail.intellij-plugin-conventions") version "1.0.0"
id("dev.meanmail.resumable-download") version "1.0.0"
}
group = config("group")
version = config("version")
dependencies {
testImplementation(libs.junit)
intellijPlatform {
create(config("platformType"), config("platformVersion"))
val plugins = providers.gradleProperty("plugins").map { it.split(',') }
if (plugins.isPresent && plugins.get().isNotEmpty()) {
compatiblePlugins(plugins)
}
val platformBundledPlugins = providers.gradleProperty("platformBundledPlugins").map { it.split(',') }
if (platformBundledPlugins.isPresent && platformBundledPlugins.get().isNotEmpty()) {
bundledPlugins(platformBundledPlugins)
}
pluginVerifier()
zipSigner()
testFramework(TestFrameworkType.Platform)
}
}
// Check if runIde task is requested (for optional=true during testing)
val isRunIde = gradle.startParameter.taskNames.any {
it.contains("runIde", ignoreCase = true) || it.contains("prepareSandbox", ignoreCase = true)
}
intellijPlatform {
pluginConfiguration {
name.set(config("pluginName"))
version.set(project.version.toString())
ideaVersion {
sinceBuild.set(config("platformSinceBuild"))
untilBuild.set(provider { null })
}
val pluginCode = config("code")
if (pluginCode.isNotBlank()) {
productDescriptor {
code = pluginCode
releaseDate = config("releaseDate")
releaseVersion = config("releaseVersion")
optional = if (isRunIde) true else config("optional").toBoolean()
}
}
}
autoReload = false
buildSearchableOptions = false
pluginVerification.ides {
recommended()
}
// Enable IDE caching for plugin verification
// Cache path is configured via org.jetbrains.intellij.platform.intellijPlatformCache in ~/.gradle/gradle.properties
caching.ides {
enabled = true
}
signing {
certificateChain.set(providers.environmentVariable("CERTIFICATE_CHAIN"))
privateKey.set(providers.environmentVariable("PRIVATE_KEY"))
password.set(providers.environmentVariable("PRIVATE_KEY_PASSWORD"))
}
publishing {
token.set(
providers.environmentVariable("PUBLISH_TOKEN").orElse(
providers.provider {
try {
file("token.txt").readLines()[0]
} catch (_: Exception) {
println("No PUBLISH_TOKEN env variable or token.txt found")
""
}
}
))
channels.set(listOf(config("publishChannel")))
}
}
tasks {
wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = config("gradleVersion")
}
test {
useJUnit()
maxHeapSize = "1G"
}
}