-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
116 lines (104 loc) · 3.21 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
116 lines (104 loc) · 3.21 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
// SPDX-FileCopyrightText: Copyright (c) 2026 Max Trunnikov
// SPDX-License-Identifier: MIT
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
plugins {
id("org.jetbrains.kotlin.jvm") version "2.4.10"
id("org.jetbrains.intellij.platform") version "2.18.1"
id("io.gitlab.arturbosch.detekt") version "1.23.8"
id("org.jetbrains.kotlinx.kover") version "0.9.9"
}
group = providers.gradleProperty("pluginGroup").get()
version = providers.gradleProperty("pluginVersion").get()
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
intellijIdeaCommunity(providers.gradleProperty("platformVersion"))
plugin(providers.gradleProperty("platformPlugins"))
pluginVerifier()
zipSigner()
testFramework(TestFrameworkType.Platform)
}
testImplementation("junit:junit:4.13.2")
}
intellijPlatform {
pluginConfiguration {
version = providers.gradleProperty("pluginVersion")
description = "XSL/XSLT linting for JetBrains IDEs, powered by the " +
"xslint language server."
ideaVersion {
sinceBuild = providers.gradleProperty("pluginSinceBuild")
untilBuild = provider { null }
}
}
signing {
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
privateKey = providers.environmentVariable("PRIVATE_KEY")
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
}
publishing {
token = providers.environmentVariable("PUBLISH_TOKEN")
}
pluginVerification {
ides {
recommended()
}
}
}
kotlin {
jvmToolchain(21)
}
detekt {
config.setFrom(files("config/detekt/detekt.yml"))
buildUponDefaultConfig = true
}
kover {
reports {
filters {
excludes {
// Platform glue — instantiable only inside a running IDE, so
// it's exercised by the Plugin Verifier, not by unit tests.
classes(
"com.xslint.jetbrains.XslintLanguageServerFactory",
"com.xslint.jetbrains.XslintLanguageServer",
)
}
}
total {
xml {
onCheck = true
}
}
verify {
rule {
minBound(100)
}
}
}
}
// Fetch the xslint-lsp Node server and bundle it into the plugin distribution,
// so the runtime finds it at <pluginPath>/xslint-lsp/node_modules/xslint-lsp.
val xslintLspDir = layout.buildDirectory.dir("xslint-lsp")
val npm = if (System.getProperty("os.name").startsWith("Windows", true)) "npm.cmd" else "npm"
val installXslintLsp = tasks.register<Exec>("installXslintLsp") {
val out = xslintLspDir.get().asFile
val server = providers.gradleProperty("xslintLspVersion").get()
outputs.dir(out)
doFirst { out.mkdirs() }
commandLine(
npm, "install", "--no-audit", "--no-fund",
"--prefix", out.absolutePath, "xslint-lsp@$server",
)
}
tasks {
prepareSandbox {
dependsOn(installXslintLsp)
from(xslintLspDir) {
into(pluginName.map { "$it/xslint-lsp" })
}
}
}