Skip to content

Commit 293baa2

Browse files
committed
Add initial gradle configs
1 parent 07be802 commit 293baa2

File tree

3 files changed

+123
-0
lines changed

3 files changed

+123
-0
lines changed

build.gradle.kts

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import org.jetbrains.changelog.markdownToHTML
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
4+
fun properties(key: String) = project.findProperty(key).toString()
5+
6+
plugins {
7+
// Java support
8+
id("java")
9+
// Kotlin support
10+
id("org.jetbrains.kotlin.jvm") version "1.6.10"
11+
// Gradle IntelliJ Plugin
12+
id("org.jetbrains.intellij") version "1.4.0"
13+
// Gradle Changelog Plugin
14+
id("org.jetbrains.changelog") version "1.3.1"
15+
}
16+
17+
group = properties("pluginGroup")
18+
version = properties("pluginVersion")
19+
20+
// Configure project's dependencies
21+
repositories {
22+
mavenCentral()
23+
}
24+
25+
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
26+
intellij {
27+
pluginName.set(properties("pluginName"))
28+
version.set(properties("platformVersion"))
29+
type.set(properties("platformType"))
30+
31+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
32+
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
33+
}
34+
35+
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
36+
changelog {
37+
version.set(properties("pluginVersion"))
38+
groups.set(emptyList())
39+
}
40+
41+
tasks {
42+
// Set the JVM compatibility versions
43+
properties("javaVersion").let {
44+
withType<JavaCompile> {
45+
sourceCompatibility = it
46+
targetCompatibility = it
47+
}
48+
withType<KotlinCompile> {
49+
kotlinOptions.jvmTarget = it
50+
}
51+
}
52+
53+
wrapper {
54+
gradleVersion = properties("gradleVersion")
55+
}
56+
57+
patchPluginXml {
58+
version.set(properties("pluginVersion"))
59+
sinceBuild.set(properties("pluginSinceBuild"))
60+
untilBuild.set(properties("pluginUntilBuild"))
61+
62+
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
63+
pluginDescription.set(
64+
projectDir.resolve("README.md").readText().lines().run {
65+
val start = "<!-- Plugin description -->"
66+
val end = "<!-- Plugin description end -->"
67+
68+
if (!containsAll(listOf(start, end))) {
69+
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
70+
}
71+
subList(indexOf(start) + 1, indexOf(end))
72+
}.joinToString("\n").run { markdownToHTML(this) }
73+
)
74+
75+
// Get the latest available change notes from the changelog file
76+
changeNotes.set(provider {
77+
changelog.run {
78+
getOrNull(properties("pluginVersion")) ?: getLatest()
79+
}.toHTML()
80+
})
81+
}
82+
83+
// Configure UI tests plugin
84+
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
85+
runIdeForUiTests {
86+
systemProperty("robot-server.port", "8082")
87+
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
88+
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
89+
systemProperty("jb.consents.confirmation.enabled", "false")
90+
}
91+
}

gradle.properties

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# IntelliJ Platform Artifacts Repositories
2+
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
3+
4+
pluginGroup = com.coder
5+
pluginName = Coder Gateway
6+
# SemVer format -> https://semver.org
7+
pluginVersion = 1.0.0
8+
9+
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
10+
# for insight into build numbers and IntelliJ Platform versions.
11+
pluginSinceBuild = 211
12+
pluginUntilBuild = 213.*
13+
14+
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
15+
platformType = IC
16+
platformVersion = 2021.1.3
17+
18+
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
19+
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
20+
platformPlugins =
21+
22+
# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
23+
javaVersion = 11
24+
25+
# Gradle Releases -> https://github.com/gradle/gradle/releases
26+
gradleVersion = 7.4
27+
28+
# Opt-out flag for bundling Kotlin standard library.
29+
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
30+
# suppress inspection "UnusedProperty"
31+
kotlin.stdlib.default.dependency = false

settings.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = "Coder Gateway"

0 commit comments

Comments
 (0)