ci: Migrate to platform plugin 2.0
This commit is contained in:
parent
c1f1dd88f1
commit
79481eb6f3
16 changed files with 246 additions and 265 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -146,4 +146,5 @@ gradle-app.setting
|
||||||
|
|
||||||
jbr
|
jbr
|
||||||
secrets
|
secrets
|
||||||
.idea/runConfigurations/Sign_Plugin.xml
|
.idea/runConfigurations/*.xml
|
||||||
|
.intellijPlatform
|
425
build.gradle.kts
425
build.gradle.kts
|
@ -2,20 +2,22 @@ import groovy.xml.XmlParser
|
||||||
import groovy.xml.XmlSlurper
|
import groovy.xml.XmlSlurper
|
||||||
import org.jetbrains.changelog.Changelog
|
import org.jetbrains.changelog.Changelog
|
||||||
import org.jetbrains.changelog.markdownToHTML
|
import org.jetbrains.changelog.markdownToHTML
|
||||||
import org.jetbrains.intellij.tasks.PatchPluginXmlTask
|
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
|
||||||
import org.jetbrains.intellij.tasks.PublishPluginTask
|
import org.jetbrains.intellij.platform.gradle.tasks.PatchPluginXmlTask
|
||||||
|
import org.jetbrains.intellij.platform.gradle.tasks.PublishPluginTask
|
||||||
|
import org.jetbrains.intellij.platform.gradle.tasks.RunIdeTask
|
||||||
|
import org.jetbrains.intellij.platform.gradle.utils.extensionProvider
|
||||||
|
|
||||||
fun properties(key: String) = providers.gradleProperty(key)
|
fun properties(key: String) = providers.gradleProperty(key)
|
||||||
fun environment(key: String) = providers.environmentVariable(key)
|
fun environment(key: String) = providers.environmentVariable(key)
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("java") // Java support
|
java
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("java-library")
|
`java-library`
|
||||||
id("org.jetbrains.intellij") version("1.17.3")
|
id("org.jetbrains.intellij.platform") version("2.0.0-beta7")
|
||||||
id("org.jetbrains.changelog") version("2.2.0")
|
id("org.jetbrains.changelog") version("2.2.0")
|
||||||
id("org.jetbrains.grammarkit") version("2022.3.2.2")
|
id("org.jetbrains.grammarkit") version("2022.3.2.2")
|
||||||
id("com.palantir.git-version") version("3.0.0")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val publishVersions = listOf("232", "233", "241", "242")
|
val publishVersions = listOf("232", "233", "241", "242")
|
||||||
|
@ -31,14 +33,9 @@ val rootPackagePath = rootPackage.replace('.', '/')
|
||||||
val javaLangVersion: JavaLanguageVersion = JavaLanguageVersion.of(17)
|
val javaLangVersion: JavaLanguageVersion = JavaLanguageVersion.of(17)
|
||||||
val javaVersion = JavaVersion.VERSION_17
|
val javaVersion = JavaVersion.VERSION_17
|
||||||
|
|
||||||
val baseIDE: String = properties("baseIDE").get()
|
val baseIDE = properties("baseIDE").get()
|
||||||
val ideaVersion: String = properties("ideaVersion").get()
|
val ideaVersion = properties("ideaVersion").get()
|
||||||
val clionVersion: String = properties("clionVersion").get()
|
val clionVersion = properties("clionVersion").get()
|
||||||
val baseVersion = when(baseIDE) {
|
|
||||||
"idea" -> ideaVersion
|
|
||||||
"clion" -> clionVersion
|
|
||||||
else -> error("Unexpected IDE name: `$baseIDE")
|
|
||||||
}
|
|
||||||
|
|
||||||
val clionPlugins = listOf("com.intellij.clion", "com.intellij.cidr.lang", "com.intellij.cidr.base", "com.intellij.nativeDebug")
|
val clionPlugins = listOf("com.intellij.clion", "com.intellij.cidr.lang", "com.intellij.cidr.base", "com.intellij.nativeDebug")
|
||||||
|
|
||||||
|
@ -48,27 +45,10 @@ tasks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun pluginVersionGit(): Provider<String> {
|
|
||||||
return provider {
|
|
||||||
try {
|
|
||||||
gitVersion()
|
|
||||||
} catch (_: java.lang.Exception) {
|
|
||||||
error("Git version not found and RELEASE_VERSION environment variable is not set!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun pluginVersion(): Provider<String> {
|
fun pluginVersion(): Provider<String> {
|
||||||
return provider {
|
return provider {
|
||||||
System.getenv("RELEASE_VERSION")
|
System.getenv("RELEASE_VERSION")
|
||||||
}.orElse(pluginVersionGit().map {
|
}.orElse(properties("pluginVersion"))
|
||||||
val suffix = "-" + properties("pluginSinceBuild").get()
|
|
||||||
if (it.endsWith(suffix)) {
|
|
||||||
it.substring(0, it.length - suffix.length)
|
|
||||||
} else {
|
|
||||||
it
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun pluginVersionFull(): Provider<String> {
|
fun pluginVersionFull(): Provider<String> {
|
||||||
|
@ -77,33 +57,74 @@ fun pluginVersionFull(): Provider<String> {
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
apply {
|
apply {
|
||||||
plugin("org.jetbrains.grammarkit")
|
plugin("org.jetbrains.intellij.platform")
|
||||||
plugin("org.jetbrains.intellij")
|
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://cache-redirector.jetbrains.com/repo.maven.apache.org/maven2")
|
intellijPlatform {
|
||||||
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
|
localPlatformArtifacts {
|
||||||
}
|
content {
|
||||||
dependencies {
|
includeGroup("bundledPlugin")
|
||||||
compileOnly("org.projectlombok:lombok:1.18.30")
|
}
|
||||||
annotationProcessor("org.projectlombok:lombok:1.18.30")
|
}
|
||||||
}
|
snapshots {
|
||||||
intellij {
|
content {
|
||||||
version = baseVersion
|
includeModule("com.jetbrains.intellij.clion", "clion")
|
||||||
updateSinceUntilBuild = true
|
includeModule("com.jetbrains.intellij.idea", "ideaIC")
|
||||||
instrumentCode = false
|
}
|
||||||
}
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
java {
|
|
||||||
srcDirs(
|
|
||||||
"${grammarKitGenDir}/lexer",
|
|
||||||
"${grammarKitGenDir}/parser"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dependencies {
|
||||||
|
compileOnly("org.projectlombok:lombok:1.18.32")
|
||||||
|
annotationProcessor("org.projectlombok:lombok:1.18.32")
|
||||||
|
if (path !in listOf(":", ":debugger")) {
|
||||||
|
intellijPlatform {
|
||||||
|
intellijIdeaCommunity(ideaVersion)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (path in listOf(":zig", ":zon")) {
|
||||||
|
apply {
|
||||||
|
plugin("org.jetbrains.grammarkit")
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
srcDirs(
|
||||||
|
"${grammarKitGenDir}/lexer",
|
||||||
|
"${grammarKitGenDir}/parser"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tasks {
|
||||||
|
|
||||||
|
generateLexer {
|
||||||
|
enabled = true
|
||||||
|
purgeOldFiles = true
|
||||||
|
}
|
||||||
|
|
||||||
|
generateParser {
|
||||||
|
enabled = true
|
||||||
|
targetRootOutputDir = file("${grammarKitGenDir}/parser")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
register<DefaultTask>("generateGrammars") {
|
||||||
|
description = "Generate source code from parser/lexer definitions"
|
||||||
|
group = "build setup"
|
||||||
|
dependsOn("generateLexer")
|
||||||
|
dependsOn("generateParser")
|
||||||
|
}
|
||||||
|
|
||||||
|
compileJava {
|
||||||
|
dependsOn("generateGrammars")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
configure<JavaPluginExtension> {
|
configure<JavaPluginExtension> {
|
||||||
toolchain {
|
toolchain {
|
||||||
|
@ -125,80 +146,22 @@ allprojects {
|
||||||
runIde { enabled = false }
|
runIde { enabled = false }
|
||||||
prepareSandbox { enabled = false }
|
prepareSandbox { enabled = false }
|
||||||
buildSearchableOptions { enabled = false }
|
buildSearchableOptions { enabled = false }
|
||||||
|
verifyPlugin { enabled = false }
|
||||||
|
buildPlugin { enabled = false }
|
||||||
|
signPlugin { enabled = false }
|
||||||
|
|
||||||
withType<PatchPluginXmlTask> {
|
withType<PatchPluginXmlTask> {
|
||||||
sinceBuild = properties("pluginSinceBuild")
|
sinceBuild = properties("pluginSinceBuild")
|
||||||
untilBuild = properties("pluginUntilBuild")
|
untilBuild = properties("pluginUntilBuild")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
withType<org.jetbrains.intellij.tasks.RunIdeBase> {
|
intellijPlatform {
|
||||||
rootProject.file("jbr/lib/openjdk/bin/java")
|
instrumentCode = false
|
||||||
.takeIf { it.exists() }
|
|
||||||
?.let { projectExecutable.set(it.toString()) }
|
|
||||||
}
|
|
||||||
|
|
||||||
withType<org.jetbrains.intellij.tasks.RunPluginVerifierTask> {
|
|
||||||
rootProject.file("jbr/lib/openjdk")
|
|
||||||
.takeIf { it.exists() }
|
|
||||||
?.let { runtimeDir.set(it.toString()) }
|
|
||||||
}
|
|
||||||
|
|
||||||
generateLexer {
|
|
||||||
purgeOldFiles = true
|
|
||||||
}
|
|
||||||
generateParser {
|
|
||||||
targetRootOutputDir = file("${grammarKitGenDir}/parser")
|
|
||||||
purgeOldFiles = true
|
|
||||||
}
|
|
||||||
|
|
||||||
register<DefaultTask>("generateGrammars") {
|
|
||||||
description = "Generate source code from parser/lexer definitions"
|
|
||||||
group = "build setup"
|
|
||||||
dependsOn("generateLexer")
|
|
||||||
dependsOn("generateParser")
|
|
||||||
}
|
|
||||||
|
|
||||||
verifyPlugin {
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project(":") {
|
project(":common") {
|
||||||
apply {
|
|
||||||
plugin("org.jetbrains.changelog")
|
|
||||||
}
|
|
||||||
task<Exec>("nixos_jbr") {
|
|
||||||
description = "Create a symlink to package jetbrains.jdk"
|
|
||||||
group = "build setup"
|
|
||||||
commandLine("nix-build", "<nixpkgs>", "-A", "jetbrains.jdk", "-o", "jbr")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
buildPlugin {
|
|
||||||
enabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
changelog {
|
|
||||||
groups.empty()
|
|
||||||
repositoryUrl = properties("pluginRepositoryUrl")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project(":debugger") {
|
|
||||||
dependencies {
|
|
||||||
implementation(project(":zig"))
|
|
||||||
implementation(project(":project"))
|
|
||||||
implementation(project(":common"))
|
|
||||||
implementation(project(":lsp-common"))
|
|
||||||
implementation(project(":lsp"))
|
|
||||||
implementation("org.eclipse.lsp4j:org.eclipse.lsp4j.debug:0.22.0")
|
|
||||||
}
|
|
||||||
intellij {
|
|
||||||
version = clionVersion
|
|
||||||
plugins = clionPlugins
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
project(":lsp-common") {
|
project(":lsp-common") {
|
||||||
|
@ -228,22 +191,15 @@ project(":zig") {
|
||||||
}
|
}
|
||||||
tasks {
|
tasks {
|
||||||
generateLexer {
|
generateLexer {
|
||||||
enabled = true
|
|
||||||
sourceFile = file("src/main/grammar/Zig.flex")
|
sourceFile = file("src/main/grammar/Zig.flex")
|
||||||
targetOutputDir = file("${grammarKitGenDir}/lexer/${rootPackagePath}/zig/lexer")
|
targetOutputDir = file("${grammarKitGenDir}/lexer/${rootPackagePath}/zig/lexer")
|
||||||
}
|
}
|
||||||
|
|
||||||
generateParser {
|
generateParser {
|
||||||
enabled = true
|
|
||||||
sourceFile = file("src/main/grammar/Zig.bnf")
|
sourceFile = file("src/main/grammar/Zig.bnf")
|
||||||
pathToParser = "${rootPackagePath}/zig/psi/ZigParser.java"
|
pathToParser = "${rootPackagePath}/zig/psi/ZigParser.java"
|
||||||
pathToPsiRoot = "${rootPackagePath}/zig/psi"
|
pathToPsiRoot = "${rootPackagePath}/zig/psi"
|
||||||
}
|
}
|
||||||
|
|
||||||
compileJava {
|
|
||||||
dependsOn("generateGrammars")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,148 +210,167 @@ project(":project") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
project(":debugger") {
|
||||||
|
dependencies {
|
||||||
|
implementation(project(":zig"))
|
||||||
|
implementation(project(":project"))
|
||||||
|
implementation(project(":common"))
|
||||||
|
implementation(project(":lsp-common"))
|
||||||
|
implementation(project(":lsp"))
|
||||||
|
implementation("org.eclipse.lsp4j:org.eclipse.lsp4j.debug:0.22.0")
|
||||||
|
intellijPlatform {
|
||||||
|
clion(clionVersion)
|
||||||
|
for (p in clionPlugins) {
|
||||||
|
bundledPlugin(p)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
project(":zon") {
|
project(":zon") {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(project(":common"))
|
implementation(project(":common"))
|
||||||
}
|
}
|
||||||
tasks {
|
tasks {
|
||||||
generateLexer {
|
generateLexer {
|
||||||
enabled = true
|
|
||||||
sourceFile = file("src/main/grammar/Zon.flex")
|
sourceFile = file("src/main/grammar/Zon.flex")
|
||||||
targetOutputDir = file("${grammarKitGenDir}/lexer/${rootPackagePath}/zon/lexer")
|
targetOutputDir = file("${grammarKitGenDir}/lexer/${rootPackagePath}/zon/lexer")
|
||||||
}
|
}
|
||||||
|
|
||||||
generateParser {
|
generateParser {
|
||||||
enabled = true
|
|
||||||
sourceFile = file("src/main/grammar/Zon.bnf")
|
sourceFile = file("src/main/grammar/Zon.bnf")
|
||||||
pathToParser = "${rootPackagePath}/zon/psi/ZonParser.java"
|
pathToParser = "${rootPackagePath}/zon/psi/ZonParser.java"
|
||||||
pathToPsiRoot = "${rootPackagePath}/zon/psi"
|
pathToPsiRoot = "${rootPackagePath}/zon/psi"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
compileJava {
|
dependencies {
|
||||||
dependsOn("generateGrammars")
|
implementation(project(":zig"))
|
||||||
|
implementation(project(":project"))
|
||||||
|
implementation(project(":zon"))
|
||||||
|
implementation(project(":debugger"))
|
||||||
|
intellijPlatform {
|
||||||
|
zipSigner()
|
||||||
|
pluginVerifier()
|
||||||
|
when (baseIDE) {
|
||||||
|
"idea" -> intellijIdeaCommunity(ideaVersion)
|
||||||
|
"clion" -> clion(clionVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project(":plugin") {
|
intellijPlatform {
|
||||||
apply {
|
pluginConfiguration {
|
||||||
plugin("org.jetbrains.changelog")
|
name = properties("pluginName")
|
||||||
}
|
description = providers.fileContents(rootProject.layout.projectDirectory.file("README.md")).asText.map {
|
||||||
|
val start = "<!-- Plugin description -->"
|
||||||
|
val end = "<!-- Plugin description end -->"
|
||||||
|
|
||||||
dependencies {
|
with(it.lines()) {
|
||||||
implementation(project(":zig"))
|
if (!containsAll(listOf(start, end))) {
|
||||||
implementation(project(":project"))
|
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
|
||||||
implementation(project(":zon"))
|
}
|
||||||
implementation(project(":debugger"))
|
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
|
||||||
implementation(project(":"))
|
}
|
||||||
|
}
|
||||||
|
changeNotes = pluginVersion().map { pluginVersion ->
|
||||||
|
with(rootProject.changelog) {
|
||||||
|
renderItem(
|
||||||
|
(getOrNull(pluginVersion) ?: getUnreleased())
|
||||||
|
.withHeader(false)
|
||||||
|
.withEmptySections(false),
|
||||||
|
Changelog.OutputType.HTML,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
version = pluginVersionFull()
|
||||||
}
|
}
|
||||||
|
signing {
|
||||||
intellij {
|
certificateChainFile = rootProject.file("secrets/chain.crt")
|
||||||
pluginName = properties("pluginName")
|
privateKeyFile = rootProject.file("secrets/private.pem")
|
||||||
|
password = environment("PRIVATE_KEY_PASSWORD")
|
||||||
}
|
}
|
||||||
|
verifyPlugin {
|
||||||
|
ides {
|
||||||
|
ide(IntelliJPlatformType.IntellijIdeaCommunity, ideaVersion)
|
||||||
|
ide(IntelliJPlatformType.IntellijIdeaUltimate, ideaVersion)
|
||||||
|
ide(IntelliJPlatformType.CLion, clionVersion)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Include the generated files in the source set
|
// Include the generated files in the source set
|
||||||
|
|
||||||
// Collects all jars produced by compilation of project modules and merges them into singe one.
|
// Collects all jars produced by compilation of project modules and merges them into singe one.
|
||||||
// We need to put all plugin manifest files into single jar to make new plugin model work
|
// We need to put all plugin manifest files into single jar to make new plugin model work
|
||||||
val mergePluginJarTask = task<Jar>("mergePluginJars") {
|
val mergePluginJarTask = task<Jar>("mergePluginJars") {
|
||||||
duplicatesStrategy = DuplicatesStrategy.FAIL
|
duplicatesStrategy = DuplicatesStrategy.FAIL
|
||||||
archiveBaseName.set("ZigBrains")
|
archiveBaseName.set("ZigBrains")
|
||||||
|
|
||||||
exclude("META-INF/MANIFEST.MF")
|
exclude("META-INF/MANIFEST.MF")
|
||||||
exclude("**/classpath.index")
|
exclude("**/classpath.index")
|
||||||
|
|
||||||
val pluginLibDir by lazy {
|
val pluginLibDir by lazy {
|
||||||
val sandboxTask = tasks.prepareSandbox.get()
|
val sandboxTask = tasks.prepareSandbox.get()
|
||||||
sandboxTask.destinationDir.resolve("${sandboxTask.pluginName.get()}/lib")
|
sandboxTask.destinationDir.resolve("${project.extensionProvider.map { it.projectName }.get()}/lib")
|
||||||
}
|
}
|
||||||
|
|
||||||
val pluginJars by lazy {
|
val pluginJars by lazy {
|
||||||
pluginLibDir.listFiles().orEmpty().filter { it.isPluginJar() }
|
pluginLibDir.listFiles().orEmpty().filter { it.isPluginJar() }
|
||||||
}
|
}
|
||||||
|
|
||||||
destinationDirectory.set(project.layout.dir(provider { pluginLibDir }))
|
destinationDirectory.set(project.layout.dir(provider { pluginLibDir }))
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
for (file in pluginJars) {
|
for (file in pluginJars) {
|
||||||
from(zipTree(file))
|
from(zipTree(file))
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
delete(pluginJars)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
doLast {
|
||||||
|
delete(pluginJars)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildPlugin {
|
tasks {
|
||||||
archiveBaseName.set("ZigBrains")
|
runIde {
|
||||||
}
|
dependsOn(mergePluginJarTask)
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
|
||||||
runIde {
|
prepareSandbox {
|
||||||
dependsOn(mergePluginJarTask)
|
finalizedBy(mergePluginJarTask)
|
||||||
enabled = true
|
enabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareSandbox {
|
buildSearchableOptions {
|
||||||
finalizedBy(mergePluginJarTask)
|
dependsOn(mergePluginJarTask)
|
||||||
enabled = true
|
}
|
||||||
}
|
|
||||||
|
|
||||||
buildSearchableOptions {
|
verifyPlugin {
|
||||||
dependsOn(mergePluginJarTask)
|
dependsOn(mergePluginJarTask)
|
||||||
}
|
enabled = true
|
||||||
|
}
|
||||||
|
|
||||||
patchPluginXml {
|
signPlugin {
|
||||||
version = pluginVersionFull()
|
enabled = true
|
||||||
|
}
|
||||||
|
|
||||||
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
|
verifyPluginSignature {
|
||||||
pluginDescription = providers.fileContents(rootProject.layout.projectDirectory.file("README.md")).asText.map {
|
dependsOn(signPlugin)
|
||||||
val start = "<!-- Plugin description -->"
|
}
|
||||||
val end = "<!-- Plugin description end -->"
|
|
||||||
|
|
||||||
with (it.lines()) {
|
buildPlugin {
|
||||||
if (!containsAll(listOf(start, end))) {
|
enabled = true
|
||||||
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
|
}
|
||||||
}
|
|
||||||
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val changelog = rootProject.changelog // local variable for configuration cache compatibility
|
generateLexer {
|
||||||
// Get the latest available change notes from the changelog file
|
enabled = false
|
||||||
changeNotes = pluginVersion().map { pluginVersion ->
|
}
|
||||||
with(changelog) {
|
|
||||||
renderItem(
|
|
||||||
(getOrNull(pluginVersion) ?: getUnreleased())
|
|
||||||
.withHeader(false)
|
|
||||||
.withEmptySections(false),
|
|
||||||
Changelog.OutputType.HTML,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signPlugin {
|
generateParser {
|
||||||
certificateChainFile = rootProject.file("secrets/chain.crt")
|
enabled = false
|
||||||
privateKeyFile = rootProject.file("secrets/private.pem")
|
|
||||||
password = environment("PRIVATE_KEY_PASSWORD")
|
|
||||||
}
|
|
||||||
|
|
||||||
verifyPluginSignature {
|
|
||||||
certificateChainFile = rootProject.file("secrets/chain.crt")
|
|
||||||
}
|
|
||||||
|
|
||||||
verifyPlugin {
|
|
||||||
dependsOn(mergePluginJarTask)
|
|
||||||
enabled = true
|
|
||||||
}
|
|
||||||
|
|
||||||
listProductsReleases {
|
|
||||||
types = listOf("IU", "IC", "CL")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,7 +378,7 @@ fun distFile(it: String) = layout.buildDirectory.file("dist/ZigBrains-${pluginVe
|
||||||
|
|
||||||
publishVersions.forEach {
|
publishVersions.forEach {
|
||||||
tasks.register<PublishPluginTask>("jbpublish-$it") {
|
tasks.register<PublishPluginTask>("jbpublish-$it") {
|
||||||
distributionFile.set(distFile(it))
|
archiveFile = distFile(it)
|
||||||
token = environment("IJ_PUBLISH_TOKEN")
|
token = environment("IJ_PUBLISH_TOKEN")
|
||||||
}
|
}
|
||||||
tasks.named("publish") {
|
tasks.named("publish") {
|
||||||
|
|
4
build.sh
4
build.sh
|
@ -64,7 +64,7 @@ fi
|
||||||
for i in "${branches[@]}"
|
for i in "${branches[@]}"
|
||||||
do
|
do
|
||||||
echo "Building branch $i"
|
echo "Building branch $i"
|
||||||
git checkout "$i" && ./gradlew :plugin:verifyPluginSignature
|
git checkout "$i" && ./gradlew :verifyPluginSignature
|
||||||
RESULT=$?
|
RESULT=$?
|
||||||
if [ $RESULT != 0 ]; then
|
if [ $RESULT != 0 ]; then
|
||||||
echo "Failed to build plugin on branch $i!"
|
echo "Failed to build plugin on branch $i!"
|
||||||
|
@ -76,6 +76,6 @@ git checkout "$DEFAULT_BRANCH"
|
||||||
|
|
||||||
mkdir -p build/dist
|
mkdir -p build/dist
|
||||||
|
|
||||||
cp plugin/build/distributions/*-signed.zip build/dist/
|
cp build/distributions/*-signed.zip build/dist/
|
||||||
|
|
||||||
./gradlew publish
|
./gradlew publish
|
|
@ -1,21 +1,25 @@
|
||||||
pluginGroup = com.falsepattern.zigbrains
|
pluginGroup=com.falsepattern.zigbrains
|
||||||
pluginName = ZigBrains
|
pluginName=ZigBrains
|
||||||
pluginRepositoryUrl = https://github.com/FalsePattern/ZigBrains
|
pluginRepositoryUrl=https://github.com/FalsePattern/ZigBrains
|
||||||
|
|
||||||
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
|
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
|
||||||
pluginSinceBuild = 242
|
pluginSinceBuild=242
|
||||||
pluginUntilBuild = 242.*
|
pluginUntilBuild=242.*
|
||||||
|
|
||||||
baseIDE = clion
|
baseIDE=clion
|
||||||
|
|
||||||
ideaVersion = IC-242-EAP-SNAPSHOT
|
ideaVersion=242-EAP-SNAPSHOT
|
||||||
clionVersion = CL-242-EAP-SNAPSHOT
|
clionVersion=242-EAP-SNAPSHOT
|
||||||
|
|
||||||
|
pluginVersion=15.2.0-dev
|
||||||
|
|
||||||
# Gradle Releases -> https://github.com/gradle/gradle/releases
|
# Gradle Releases -> https://github.com/gradle/gradle/releases
|
||||||
gradleVersion = 8.7
|
gradleVersion=8.8
|
||||||
|
|
||||||
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
|
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
|
||||||
org.gradle.caching = true
|
org.gradle.caching=true
|
||||||
|
|
||||||
# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment
|
# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment
|
||||||
systemProp.org.gradle.unsafe.kotlin.assignment = true
|
systemProp.org.gradle.unsafe.kotlin.assignment=true
|
||||||
|
|
||||||
|
org.jetbrains.intellij.platform.buildFeature.useBinaryReleases=false
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
19
gradlew
vendored
19
gradlew
vendored
|
@ -55,7 +55,7 @@
|
||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
@ -83,7 +83,8 @@ done
|
||||||
# This is normally unused
|
# This is normally unused
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
|
@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
@ -201,11 +202,11 @@ fi
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
|
20
gradlew.bat
vendored
20
gradlew.bat
vendored
|
@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package com.falsepattern.zigbrains.lspcommon.connection;
|
package com.falsepattern.zigbrains.lspcommon.connection;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
rootProject.name = "ZigBrains"
|
rootProject.name = "ZigBrains"
|
||||||
|
|
||||||
include("plugin")
|
|
||||||
|
|
||||||
File(rootDir, "modules").eachDir { dir ->
|
File(rootDir, "modules").eachDir { dir ->
|
||||||
include(dir.name)
|
if (dir.resolve("src").exists()) {
|
||||||
project(":${dir.name}").projectDir = dir
|
include(dir.name)
|
||||||
|
project(":${dir.name}").projectDir = dir
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun File.eachDir(block: (File) -> Unit) {
|
fun File.eachDir(block: (File) -> Unit) {
|
||||||
|
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Loading…
Add table
Reference in a new issue