Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDEA] Version 1.4.0.1 #84

Merged
merged 5 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/idea-gradle-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ jobs:
# Note: if we wanted, we could expand this to test on multiple OS's
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Run tests and build plugin
run: |
cd IDEA
chmod +x gradlew
./gradlew test buildPlugin
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: KerboScript(kOS).zip
path: IDEA/build/distributions/KerboScript(kOS).zip
42 changes: 30 additions & 12 deletions IDEA/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import org.jetbrains.grammarkit.tasks.GenerateLexerTask
import org.jetbrains.grammarkit.tasks.GenerateParserTask
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.jetbrains.intellij") version "1.14.1"
id("org.jetbrains.kotlin.jvm") version "1.8.22"
id("org.jetbrains.grammarkit") version "2022.3.1"
id("org.jetbrains.intellij.platform") version "2.0.1"
id("org.jetbrains.kotlin.jvm") version "2.0.20"
id("org.jetbrains.grammarkit") version "2022.3.2.2"
}

repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}

// Java target version
Expand All @@ -31,6 +35,15 @@ kotlin {
}

dependencies {
intellijPlatform {
intellijIdeaCommunity("2024.2.1")

bundledPlugins(listOf("com.intellij.java"))
instrumentationTools()

testFramework(TestFrameworkType.Platform)
}

// From Kotlin documentation
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.8.22")
// just in case, version number specified in buildscript is used by default
Expand All @@ -47,24 +60,30 @@ dependencies {

// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
version.set("2023.1.2")
type.set("IC") // Target IDE Platform
intellijPlatform {
pluginConfiguration {
// ...

version = "1.4.0.1"

plugins.set(listOf("com.intellij.java"))
ideaVersion {
sinceBuild = "242.21829.142"
untilBuild = provider { null }
}
}
}

project(":") {
val generateLexer = task<GenerateLexerTask>("generateMyLexer") {
sourceFile.set(file("src/main/grammar/KerboScript.flex"))
targetDir.set("src/gen/ksp/kos/ideaplugin/parser")
targetClass.set("KerboScriptLexer")
targetOutputDir.set(file("src/gen/ksp/kos/ideaplugin/parser"))
// targetClass.set("KerboScriptLexer")
purgeOldFiles.set(true)
}

val generateParser = task<GenerateParserTask>("generateMyParser") {
sourceFile.set(file("src/main/grammar/KerboScript.bnf"))
targetRoot.set("src/gen")
targetRootOutputDir.set(file("src/gen"))
pathToParser.set("/ksp/kos/ideaplugin/parser/KerboScriptParser.java")
pathToPsiRoot.set("/ksp/kos/ideaplugin/psi")
purgeOldFiles.set(true)
Expand All @@ -85,7 +104,7 @@ project(":") {
getByName<KotlinCompile>(it) {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = listOf("-Xjvm-default=enable")
freeCompilerArgs = listOf("-Xjvm-default=all")
}
}
}
Expand All @@ -106,7 +125,6 @@ tasks.test {
allprojects {
gradle.projectsEvaluated {
tasks.withType<JavaCompile> {
options.compilerArgs.add("-Werror")
options.compilerArgs.add("-Xlint:all")
options.compilerArgs.add("-Xlint:-serial")
}
Expand Down
2 changes: 1 addition & 1 deletion IDEA/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.intellij.psi.tree.IElementType;
import ksp.kos.ideaplugin.KerboScriptFile;
import ksp.kos.ideaplugin.psi.KerboScriptIfStmt;
import ksp.kos.ideaplugin.psi.KerboScriptInstruction;
import ksp.kos.ideaplugin.psi.KerboScriptInstructionBlock;
import ksp.kos.ideaplugin.psi.KerboScriptTypes;
import org.jetbrains.annotations.NotNull;
Expand All @@ -18,6 +17,7 @@
import java.util.*;

import static ksp.kos.ideaplugin.psi.KerboScriptTypes.CURLYCLOSE;
import static ksp.kos.ideaplugin.psi.KerboScriptTypes.CURLYOPEN;

/**
* Created on 17/01/16.
Expand Down Expand Up @@ -55,7 +55,7 @@ public Indent getIndent() {
if (psi.getParent() == null || psi.getParent() instanceof KerboScriptFile) {
return Indent.getNoneIndent();
} else if (psi.getParent() instanceof KerboScriptInstructionBlock) {
if (psi.getNode().getElementType() == CURLYCLOSE) {
if (psi.getNode().getElementType() == CURLYCLOSE || psi.getNode().getElementType() == CURLYOPEN) {
return Indent.getNoneIndent();
}
return Indent.getNormalIndent();
Expand Down
3 changes: 1 addition & 2 deletions IDEA/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<idea-plugin url="https://github.com/KSP-KOS/EditorTools/tree/develop/IDEA">
<id>kos-ksp.idea-plugin</id>
<name>KerboScript(kOS)</name>
<version>1.4</version>
<vendor email="[email protected]" url="https://github.com/valery-labuzhsky">Valery Labuzhsky
</vendor>

Expand Down Expand Up @@ -77,7 +76,7 @@ kOS version supported: 1.4
</change-notes>

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

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