-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update plugin to be compatible with 2021.3 (#119)
* update gradle to version 7.2 * update to idea 213 the update of the gradle plugin comes with breaking changes see https://lp.jetbrains.com/gradle-intellij-plugin/ for more information * update kokin and idea sdk call to be compatible with 213 some of the change are not compatible with 211, so code is splitted into platform version code update kotlin code: * Type mismatch: value of a nullable type T is used where non-nullable type is expected. This warning will become an error soon. See https://youtrack.jetbrains.com/issue/KT-36770 for details * 'toLong(): Long' is deprecated. Conversion of Char to Number is deprecated. Use Char.code property instead. update idea skd call: * 'getVirtualFilesByName(Project!, String, GlobalSearchScope): (Mutable)Collection<VirtualFile!>' is deprecated. Deprecated in Java Signed-off-by: Vincent Gramer <vgramer@gmail.com>
- Loading branch information
Showing
23 changed files
with
626 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
# | ||
# Use of this source code is governed by the MIT license that can be | ||
# found in the LICENSE file. | ||
# | ||
|
||
#Wed Mar 11 22:19:20 CET 2020 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions
36
src/211/test/kotlin/org/openpolicyagent/ideaplugin/OpaTestBase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Use of this source code is governed by the MIT license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
package org.openpolicyagent.ideaplugin | ||
|
||
import com.intellij.testFramework.fixtures.BasePlatformTestCase | ||
import org.openpolicyagent.ideaplugin.FileTree | ||
import org.openpolicyagent.ideaplugin.OpaTestCase | ||
import org.openpolicyagent.ideaplugin.TestProject | ||
|
||
abstract class OpaTestBase : BasePlatformTestCase(), OpaTestCase { | ||
|
||
open val dataPath: String = "" | ||
|
||
override fun getTestDataPath(): String = "${OpaTestCase.testResourcesPath}/${dataPath}" | ||
|
||
protected val fileName: String | ||
get() = "$testName.rego" | ||
|
||
protected val testName: String | ||
get() = camelOrWordsToSnake(getTestName(true)) | ||
|
||
companion object { | ||
@JvmStatic | ||
fun camelOrWordsToSnake(name: String): String { | ||
if (' ' in name) return name.trim().replace(" ", "_") | ||
|
||
return name.split("(?=[A-Z])".toRegex()).joinToString("_", transform = String::toLowerCase) | ||
} | ||
} | ||
|
||
protected fun FileTree.create(): TestProject = | ||
create(myFixture.project, myFixture.findFileInTempDir(".")) | ||
} |
Oops, something went wrong.