Skip to content

Commit

Permalink
compatibility IDE 243 and move new rego file action to lower division (
Browse files Browse the repository at this point in the history
…#181)

* compatibility 243
since grammarkit 2022.2.3.2, the targetClass of GenerateLexerTask has been removed because the generated lexerClass is set in the flex file

* move "Rego File" action to lower division

cf #178

Signed-off-by: Vincent Gramer <[email protected]>
  • Loading branch information
vgramer authored Nov 28, 2024
1 parent 1c48d21 commit 4d96493
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ plugins {
idea
kotlin("jvm") version "1.9.21"
id("org.jetbrains.intellij") version "1.17.0"
id("org.jetbrains.grammarkit") version "2022.3.2"
id("org.jetbrains.grammarkit") version "2022.3.2.2"
}

allprojects {
Expand Down Expand Up @@ -177,15 +177,14 @@ project(":") {

val generateRegoLexer = task<GenerateLexerTask>("generateRegoLexer") {
sourceFile.set(file("src/main/grammar/RegoLexer.flex"))
targetDir.set("src/main/gen/org/openpolicyagent/ideaplugin/lang/lexer")
targetClass.set("_RegoLexer")
targetOutputDir.set(file("src/main/gen/org/openpolicyagent/ideaplugin/lang/lexer"))
purgeOldFiles.set(true)
}


val generateRegoParser = task<GenerateParserTask>("generateRegoParser") {
sourceFile.set(file("src/main/grammar/Rego.bnf"))
targetRoot.set("src/main/gen")
targetRootOutputDir.set(file("src/main/gen"))
pathToParser.set("/org/openpolicyagent/ideaplugin/lang/parser/RegoParser.java")
pathToPsiRoot.set("/org/openpolicyagent/ideaplugin/lang/psi")
purgeOldFiles.set(true)
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ kotlin.code.style=official
baseIDE=idea

# if you change the version of ide, also change psiViewerPluginVersion accordingly (cf https://plugins.jetbrains.com/plugin/227-psiviewer/versions)
ideaVersion=IC-2023.3
pycharmCommunityVersion=PC-2023.3
psiViewerPluginVersion=233.2
ideaVersion=IC-2024.1
pycharmCommunityVersion=PC-2024.1
psiViewerPluginVersion=241-SNAPSHOT

# see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for more information
sinceBuild=233
untilBuild=242.*
sinceBuild=241
untilBuild=243.*

# these two variables will be overwritten by the release process (i.e. the GitHub action) thanks to the env variables:
# - ORG_GRADLE_PROJECT_publishToken
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/opa-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
class="org.openpolicyagent.ideaplugin.ide.actions.RegoCreateFileAction"
text="Rego File"
description="Create new Rego file">
<add-to-group group-id="NewGroup" anchor="before" relative-to-action="NewFile"/>
<add-to-group group-id="NewGroup" anchor="last" />
</action>
</actions>
</idea-plugin>

0 comments on commit 4d96493

Please sign in to comment.