forked from patricklx/intellij-wsl-symlinks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
116 lines (95 loc) · 3.49 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
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import java.net.URL
// Configure project's dependencies
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.9.24"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij.platform") version "2.0.0-beta7"
// id("org.jetbrains.intellij.platform.migration") version "2.0.0-beta7"
}
group = "com.wsl.symlinks"
version = "2024.2.1"
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.assertj:assertj-core:3.25.3")
testImplementation("org.junit.platform:junit-platform-launcher:1.10.2")
implementation(kotlin("test"))
implementation("org.codehaus.jettison:jettison:1.5.4")
intellijPlatform {
pluginVerifier()
zipSigner()
instrumentationTools()
testFramework(TestFrameworkType.Platform)
create(IntelliJPlatformType.IntellijIdeaUltimate, "242.19890.14")
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
}
intellijPlatform {
pluginConfiguration {
name.set("WslSymlinks")
}
// Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
// Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
//
// com.dmarcotte.handlebars: see https://plugins.jetbrains.com/plugin/6884-handlebars-mustache/versions
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "17"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "17"
}
publishPlugin {
token.set(System.getenv("ORG_GRADLE_PROJECT_intellijPublishToken"))
}
}
tasks.buildSearchableOptions {
enabled = false
}
tasks.register("printVersion") {
doLast { println(version) }
}
tasks.register("updateChangelog") {
doLast {
var input = generateSequence(::readLine).joinToString("\n")
input = input.replace(":rocket:", "🚀")
input = input.replace(":bug:", "🐛")
input = input.replace(":documentation:", "📝")
input = input.replace(":breaking:", "💥")
input += "\nsee <a href=\"https://github.com/patricklx/intellij-wsl-symlinks/blob/main/CHANGELOG.md\">https://github.com/patricklx/intellij-wsl-symlinks/</a> for more"
val f = File("./src/main/resources/META-INF/plugin.xml")
var content = f.readText()
content = content.replace("CHANGELOG_PLACEHOLDER", input)
f.writeText(content)
}
}
tasks.register("listRecentReleased") {
doLast {
val text = URL("https://plugins.jetbrains.com/api/plugins/24097/updates?channel=&size=8").readText()
val obj = groovy.json.JsonSlurper().parseText(text)
val versions = (obj as ArrayList<Map<*,*>>).map { it.get("version") }
println(groovy.json.JsonBuilder(versions).toPrettyString())
}
}
tasks.register("verifyAlreadyReleased") {
doLast {
var input = generateSequence(::readLine).joinToString("\n")
val text = URL("https://plugins.jetbrains.com/api/plugins/24097/updates?channel=&size=100").readText()
val obj = groovy.json.JsonSlurper().parseText(text)
val versions = (obj as ArrayList<Map<*,*>>).map { it.get("version") }
println(versions.contains(input))
}
}