Skip to content

Commit 382680b

Browse files
authored
Merge pull request #84 from valery-labuzhsky/develop
[IDEA] Version 1.4.0.1
2 parents c96bf06 + 2c29d40 commit 382680b

5 files changed

Lines changed: 38 additions & 20 deletions

File tree

.github/workflows/idea-gradle-build-and-test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ jobs:
1212
# Note: if we wanted, we could expand this to test on multiple OS's
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: Set up JDK 17
17-
uses: actions/setup-java@v1
17+
uses: actions/setup-java@v4
1818
with:
19+
distribution: 'temurin'
1920
java-version: '17'
2021
- name: Run tests and build plugin
2122
run: |
2223
cd IDEA
2324
chmod +x gradlew
2425
./gradlew test buildPlugin
2526
- name: Upload artifact
26-
uses: actions/upload-artifact@v2
27+
uses: actions/upload-artifact@v4
2728
with:
2829
name: KerboScript(kOS).zip
2930
path: IDEA/build/distributions/KerboScript(kOS).zip

IDEA/build.gradle.kts

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import org.jetbrains.grammarkit.tasks.GenerateLexerTask
22
import org.jetbrains.grammarkit.tasks.GenerateParserTask
3+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
34
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
45

56
plugins {
6-
id("org.jetbrains.intellij") version "1.14.1"
7-
id("org.jetbrains.kotlin.jvm") version "1.8.22"
8-
id("org.jetbrains.grammarkit") version "2022.3.1"
7+
id("org.jetbrains.intellij.platform") version "2.0.1"
8+
id("org.jetbrains.kotlin.jvm") version "2.0.20"
9+
id("org.jetbrains.grammarkit") version "2022.3.2.2"
910
}
1011

1112
repositories {
1213
mavenCentral()
14+
intellijPlatform {
15+
defaultRepositories()
16+
}
1317
}
1418

1519
// Java target version
@@ -31,6 +35,15 @@ kotlin {
3135
}
3236

3337
dependencies {
38+
intellijPlatform {
39+
intellijIdeaCommunity("2024.2.1")
40+
41+
bundledPlugins(listOf("com.intellij.java"))
42+
instrumentationTools()
43+
44+
testFramework(TestFrameworkType.Platform)
45+
}
46+
3447
// From Kotlin documentation
3548
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.8.22")
3649
// just in case, version number specified in buildscript is used by default
@@ -47,24 +60,30 @@ dependencies {
4760

4861
// Configure Gradle IntelliJ Plugin
4962
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
50-
intellij {
51-
version.set("2023.1.2")
52-
type.set("IC") // Target IDE Platform
63+
intellijPlatform {
64+
pluginConfiguration {
65+
// ...
66+
67+
version = "1.4.0.1"
5368

54-
plugins.set(listOf("com.intellij.java"))
69+
ideaVersion {
70+
sinceBuild = "242.21829.142"
71+
untilBuild = provider { null }
72+
}
73+
}
5574
}
5675

5776
project(":") {
5877
val generateLexer = task<GenerateLexerTask>("generateMyLexer") {
5978
sourceFile.set(file("src/main/grammar/KerboScript.flex"))
60-
targetDir.set("src/gen/ksp/kos/ideaplugin/parser")
61-
targetClass.set("KerboScriptLexer")
79+
targetOutputDir.set(file("src/gen/ksp/kos/ideaplugin/parser"))
80+
// targetClass.set("KerboScriptLexer")
6281
purgeOldFiles.set(true)
6382
}
6483

6584
val generateParser = task<GenerateParserTask>("generateMyParser") {
6685
sourceFile.set(file("src/main/grammar/KerboScript.bnf"))
67-
targetRoot.set("src/gen")
86+
targetRootOutputDir.set(file("src/gen"))
6887
pathToParser.set("/ksp/kos/ideaplugin/parser/KerboScriptParser.java")
6988
pathToPsiRoot.set("/ksp/kos/ideaplugin/psi")
7089
purgeOldFiles.set(true)
@@ -85,7 +104,7 @@ project(":") {
85104
getByName<KotlinCompile>(it) {
86105
kotlinOptions {
87106
jvmTarget = "17"
88-
freeCompilerArgs = listOf("-Xjvm-default=enable")
107+
freeCompilerArgs = listOf("-Xjvm-default=all")
89108
}
90109
}
91110
}
@@ -106,7 +125,6 @@ tasks.test {
106125
allprojects {
107126
gradle.projectsEvaluated {
108127
tasks.withType<JavaCompile> {
109-
options.compilerArgs.add("-Werror")
110128
options.compilerArgs.add("-Xlint:all")
111129
options.compilerArgs.add("-Xlint:-serial")
112130
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

IDEA/src/main/java/ksp/kos/ideaplugin/format/KerboScriptBlock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import com.intellij.psi.tree.IElementType;
1010
import ksp.kos.ideaplugin.KerboScriptFile;
1111
import ksp.kos.ideaplugin.psi.KerboScriptIfStmt;
12-
import ksp.kos.ideaplugin.psi.KerboScriptInstruction;
1312
import ksp.kos.ideaplugin.psi.KerboScriptInstructionBlock;
1413
import ksp.kos.ideaplugin.psi.KerboScriptTypes;
1514
import org.jetbrains.annotations.NotNull;
@@ -18,6 +17,7 @@
1817
import java.util.*;
1918

2019
import static ksp.kos.ideaplugin.psi.KerboScriptTypes.CURLYCLOSE;
20+
import static ksp.kos.ideaplugin.psi.KerboScriptTypes.CURLYOPEN;
2121

2222
/**
2323
* Created on 17/01/16.
@@ -55,7 +55,7 @@ public Indent getIndent() {
5555
if (psi.getParent() == null || psi.getParent() instanceof KerboScriptFile) {
5656
return Indent.getNoneIndent();
5757
} else if (psi.getParent() instanceof KerboScriptInstructionBlock) {
58-
if (psi.getNode().getElementType() == CURLYCLOSE) {
58+
if (psi.getNode().getElementType() == CURLYCLOSE || psi.getNode().getElementType() == CURLYOPEN) {
5959
return Indent.getNoneIndent();
6060
}
6161
return Indent.getNormalIndent();

IDEA/src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<idea-plugin url="https://github.com/KSP-KOS/EditorTools/tree/develop/IDEA">
22
<id>kos-ksp.idea-plugin</id>
33
<name>KerboScript(kOS)</name>
4-
<version>1.4</version>
54
<vendor email="ynicorn@gmail.com" url="https://github.com/valery-labuzhsky">Valery Labuzhsky
65
</vendor>
76

@@ -77,7 +76,7 @@ kOS version supported: 1.4
7776
</change-notes>
7877

7978
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
80-
<idea-version since-build="231.9011.34"/>
79+
<idea-version/>
8180

8281
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
8382
on how to target different products -->

0 commit comments

Comments
 (0)