diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc7d268..b0eeef2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,7 @@ jobs: - name: Download OPA run: | - OPA_VERSION=v0.47.4 + OPA_VERSION=v0.59.0 mkdir -p /tmp/opa_bin curl -L -o /tmp/opa_bin/opa https://github.com/open-policy-agent/opa/releases/download/$OPA_VERSION/opa_linux_amd64 chmod +x /tmp/opa_bin/opa @@ -96,10 +96,10 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Verify plugin binany compatibility + - name: Verify plugin binary compatibility run: ./gradlew :plugin:runPluginVerifier - # This job is successful if all depend jobs are successful. To be able to merge the PR, this job must be successful + # This job is successful if all dependent jobs are successful. To be able to merge the PR, this job must be successful all-checks: needs: [build, check-license, check-gradle-wrapper, verify] runs-on: ubuntu-latest diff --git a/build.gradle.kts b/build.gradle.kts index f88218d..3e141f6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -43,9 +43,9 @@ idea { plugins { idea - kotlin("jvm") version "1.9.0" - id("org.jetbrains.intellij") version "1.15.0" - id("org.jetbrains.grammarkit") version "2021.2.2" + kotlin("jvm") version "1.9.21" + id("org.jetbrains.intellij") version "1.16.1" + id("org.jetbrains.grammarkit") version "2022.3.1" } allprojects { @@ -176,7 +176,7 @@ project(":") { } val generateRegoLexer = task("generateRegoLexer") { - source.set("src/main/grammar/RegoLexer.flex") + sourceFile.set(file("src/main/grammar/RegoLexer.flex")) targetDir.set("src/main/gen/org/openpolicyagent/ideaplugin/lang/lexer") targetClass.set("_RegoLexer") purgeOldFiles.set(true) @@ -184,7 +184,7 @@ project(":") { val generateRegoParser = task("generateRegoParser") { - source.set("src/main/grammar/Rego.bnf") + sourceFile.set(file("src/main/grammar/Rego.bnf")) targetRoot.set("src/main/gen") pathToParser.set("/org/openpolicyagent/ideaplugin/lang/parser/RegoParser.java") pathToPsiRoot.set("/org/openpolicyagent/ideaplugin/lang/psi") diff --git a/gradle.properties b/gradle.properties index 38f2328..1f4bc2d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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.1 -pycharmCommunityVersion=PC-2023.1 -psiViewerPluginVersion=231-SNAPSHOT +ideaVersion=IC-2023.2 +pycharmCommunityVersion=PC-2023.2 +psiViewerPluginVersion=232.2 # see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for more information -sinceBuild=231 -untilBuild=232.* +sinceBuild=232 +untilBuild=233.* # these two variables will be overwritten by the release process (i.e. the GitHub action) thanks to the env variables: # - ORG_GRADLE_PROJECT_publishToken diff --git a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/OpaEvalRunConfiguration.kt b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/OpaEvalRunConfiguration.kt index 25525bd..1e2f054 100644 --- a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/OpaEvalRunConfiguration.kt +++ b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/OpaEvalRunConfiguration.kt @@ -11,7 +11,6 @@ import com.intellij.execution.runners.ExecutionEnvironment import com.intellij.openapi.options.SettingsEditor import com.intellij.openapi.project.Project import com.intellij.util.execution.ParametersListUtil -import com.intellij.util.io.isFile import org.jdom.Element import org.openpolicyagent.ideaplugin.ide.runconfig.ui.OpaEvalRunCommandEditor import org.openpolicyagent.ideaplugin.openapiext.readPath @@ -19,12 +18,13 @@ import org.openpolicyagent.ideaplugin.openapiext.readString import org.openpolicyagent.ideaplugin.openapiext.writePath import org.openpolicyagent.ideaplugin.openapiext.writeString import java.nio.file.Path +import kotlin.io.path.isRegularFile /** * the opa eval configuration * - * we don't use the options mechanism to persist configuration like in tutorial because its create another class a bit - * painful to maintain and we had some problems on the restore of parameters + * we don't use the options mechanism to persist configuration like in tutorial because it creates another class a bit + * painful to maintain, and we had some problems on the restore of parameters * * @link https://www.jetbrains.org/intellij/sdk/docs/basics/run_configurations.html */ @@ -75,7 +75,7 @@ class OpaEvalRunConfiguration( throw RuntimeConfigurationError("Query can not be empty") } - if (input == null || !input!!.isFile()) { + if (input == null || !input!!.isRegularFile()) { throw RuntimeConfigurationError("Input must be a path to a file") } @@ -90,7 +90,7 @@ class OpaEvalRunConfiguration( } bundleDir?.let { - if (it.isFile()) { + if (it.isRegularFile()) { throw RuntimeConfigurationError("Bundle directory must be a directory") } } diff --git a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/test/OpaTestRunConfiguration.kt b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/test/OpaTestRunConfiguration.kt index e5084c4..6867e08 100644 --- a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/test/OpaTestRunConfiguration.kt +++ b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/test/OpaTestRunConfiguration.kt @@ -11,7 +11,7 @@ import com.intellij.execution.runners.ExecutionEnvironment import com.intellij.openapi.options.SettingsEditor import com.intellij.openapi.project.Project import com.intellij.util.execution.ParametersListUtil -import com.intellij.util.io.isFile +import kotlin.io.path.isRegularFile import org.jdom.Element import org.openpolicyagent.ideaplugin.ide.runconfig.test.ui.OpaTestRunCommandEditor import org.openpolicyagent.ideaplugin.openapiext.readPath @@ -23,8 +23,8 @@ import java.nio.file.Path /** * the opa test configuration * - * we don't use the options mechanism to persist configuration like in tutorial because its create another class a bit - * painful to maintain and we had some problems on the restore of parameters + * we don't use the options mechanism to persist configuration like in tutorial because it creates another class a bit + * painful to maintain, and we had some problems on the restore of parameters * * @link https://www.jetbrains.org/intellij/sdk/docs/basics/run_configurations.html */ @@ -63,7 +63,7 @@ class OpaTestRunConfiguration( throw RuntimeConfigurationError("Only format option (-f or --format) = pretty is handle by plugin") } - if (bundleDir == null || bundleDir!!.isFile()) { + if (bundleDir == null || bundleDir!!.isRegularFile()) { throw RuntimeConfigurationError("Bundle directory must be a directory") } } diff --git a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/test/ui/OpaTestRunCommandEditor.kt b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/test/ui/OpaTestRunCommandEditor.kt index e6286d5..812f710 100644 --- a/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/test/ui/OpaTestRunCommandEditor.kt +++ b/src/main/kotlin/org/openpolicyagent/ideaplugin/ide/runconfig/test/ui/OpaTestRunCommandEditor.kt @@ -18,8 +18,8 @@ import com.intellij.openapi.roots.ProjectRootManager import com.intellij.openapi.ui.TextBrowseFolderListener import com.intellij.openapi.ui.TextFieldWithBrowseButton import com.intellij.ui.RawCommandLineEditor +import com.intellij.ui.dsl.builder.AlignX import com.intellij.ui.dsl.builder.panel -import com.intellij.ui.dsl.gridLayout.HorizontalAlign import com.intellij.util.text.nullize import org.openpolicyagent.ideaplugin.ide.runconfig.test.OpaTestRunConfiguration import java.nio.file.Path @@ -42,15 +42,15 @@ class OpaTestRunCommandEditor(private val project: Project) : SettingsEditor