mirror of
https://github.com/chylex/IntelliJ-Rainbow-Brackets.git
synced 2025-04-23 16:15:42 +02:00
rewrite build.gradle with build.gradle.kts
This commit is contained in:
parent
06dc2df770
commit
80940e599a
build.gradlebuild.gradle.ktssettings.gradle.kts
src/test/kotlin/com/github/izhangzhihao/rainbow/brackets/settings
106
build.gradle
106
build.gradle
@ -1,106 +0,0 @@
|
||||
import static org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel.*
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
maven { url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
|
||||
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
classpath "de.undercouch:gradle-download-task:4.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "org.jetbrains.intellij" version "0.7.2"
|
||||
id "com.adarshr.test-logger" version "2.1.1"
|
||||
id "de.undercouch.download" version "4.1.1"
|
||||
id "org.jetbrains.kotlin.jvm" version "1.4.31"
|
||||
id "idea"
|
||||
}
|
||||
|
||||
testlogger {
|
||||
theme 'mocha'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
|
||||
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
|
||||
maven { url "https://repo.eclipse.org/content/groups/releases/" }
|
||||
maven { url "https://www.jetbrains.com/intellij-repository/releases" }
|
||||
maven { url "https://www.jetbrains.com/intellij-repository/snapshots" }
|
||||
}
|
||||
|
||||
def pluginsDependencies = ['java',
|
||||
'java-i18n',
|
||||
'JavaScriptLanguage',
|
||||
'DatabaseTools',
|
||||
'CSS',
|
||||
'platform-images',
|
||||
'Groovy',
|
||||
'properties',
|
||||
'yaml',
|
||||
"org.jetbrains.kotlin:203-$kotlinVersion-release-IJ5981.133-1",
|
||||
'org.intellij.scala:2020.3.21',
|
||||
'Dart:203.5981.155',
|
||||
'org.jetbrains.plugins.ruby:203.5981.155',
|
||||
'com.jetbrains.php:203.5981.155',
|
||||
'com.jetbrains.sh:203.5981.37',
|
||||
'com.jetbrains.plugins.jade:203.5981.155',
|
||||
'org.jetbrains.plugins.go-template:203.5981.155',
|
||||
]
|
||||
|
||||
intellij {
|
||||
pluginName name
|
||||
|
||||
version ideaVersion
|
||||
//localPath = '/Users/izhangzhihao/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/201.6668.121/IntelliJ IDEA 2020.1 EAP.app/Contents'
|
||||
//localPath = '/Users/izhangzhihao/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/201.6668.126/CLion.app/Contents'
|
||||
updateSinceUntilBuild = false
|
||||
|
||||
setPlugins(*pluginsDependencies)
|
||||
}
|
||||
|
||||
runIde {
|
||||
systemProperty "idea.auto.reload.plugins", false
|
||||
}
|
||||
|
||||
publishPlugin {
|
||||
def authenticationToken = "$System.env.token"
|
||||
token authenticationToken
|
||||
channels publishChannels
|
||||
}
|
||||
|
||||
idea {
|
||||
project {
|
||||
jdkName = javaVersion
|
||||
languageLevel = javaVersion
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.eclipse.mylyn.github:org.eclipse.egit.github.core:5.10.0.202012080955-r") {
|
||||
exclude module: "gson"
|
||||
}
|
||||
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
|
||||
testImplementation("io.kotlintest:kotlintest:2.0.7")
|
||||
}
|
||||
|
||||
sourceCompatibility = javaVersion
|
||||
targetCompatibility = javaVersion
|
||||
|
||||
[compileKotlin, compileTestKotlin]*.kotlinOptions {
|
||||
languageVersion = kotlinLanguageVersion
|
||||
apiVersion = kotlinTargetVersion
|
||||
jvmTarget = javaVersion
|
||||
freeCompilerArgs = ["-Xskip-runtime-version-check", "-Xjsr305=strict"]
|
||||
}
|
||||
|
||||
runPluginVerifier {
|
||||
ideVersions = "$pluginVerifierIdeVersions"
|
||||
failureLevel = COMPATIBILITY_PROBLEMS
|
||||
}
|
98
build.gradle.kts
Normal file
98
build.gradle.kts
Normal file
@ -0,0 +1,98 @@
|
||||
import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel.*
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
val name: String by project
|
||||
val ideaVersion: String by project
|
||||
val kotlinVersion: String by project
|
||||
val javaVersion: String by project
|
||||
val kotlinLanguageVersion: String by project
|
||||
val kotlinTargetVersion: String by project
|
||||
val pluginVerifierIdeVersions: String by project
|
||||
val publishChannels: String by project
|
||||
|
||||
plugins {
|
||||
id("org.jetbrains.intellij") version "1.0.0-SNAPSHOT"
|
||||
id("com.adarshr.test-logger") version "3.0.0"
|
||||
id("org.jetbrains.kotlin.jvm") version "1.4.32"
|
||||
id("idea")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven(url = "https://maven-central.storage-download.googleapis.com/repos/central/data/")
|
||||
maven(url = "https://maven.aliyun.com/nexus/content/groups/public/")
|
||||
maven(url = "https://repo.eclipse.org/content/groups/releases/")
|
||||
maven(url = "https://www.jetbrains.com/intellij-repository/releases")
|
||||
maven(url = "https://www.jetbrains.com/intellij-repository/snapshots")
|
||||
}
|
||||
|
||||
intellij {
|
||||
pluginName.set(name)
|
||||
|
||||
version.set(ideaVersion)
|
||||
//localPath = '/Users/izhangzhihao/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/201.6668.121/IntelliJ IDEA 2020.1 EAP.app/Contents'
|
||||
//localPath = '/Users/izhangzhihao/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/201.6668.126/CLion.app/Contents'
|
||||
updateSinceUntilBuild.set(false)
|
||||
|
||||
plugins.set(
|
||||
listOf(
|
||||
"java",
|
||||
"java-i18n",
|
||||
"JavaScriptLanguage",
|
||||
"DatabaseTools",
|
||||
"CSS",
|
||||
"platform-images",
|
||||
"Groovy",
|
||||
"properties",
|
||||
"yaml",
|
||||
"org.jetbrains.kotlin:203-$kotlinVersion-release-IJ5981.133-1",
|
||||
"org.intellij.scala:2020.3.21",
|
||||
"Dart:203.5981.155",
|
||||
"org.jetbrains.plugins.ruby:203.5981.155",
|
||||
"com.jetbrains.php:203.5981.155",
|
||||
"com.jetbrains.sh:203.5981.37",
|
||||
"com.jetbrains.plugins.jade:203.5981.155",
|
||||
"org.jetbrains.plugins.go-template:203.5981.155"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
tasks {
|
||||
runIde {
|
||||
systemProperties["idea.auto.reload.plugins"] = false
|
||||
}
|
||||
|
||||
publishPlugin {
|
||||
token.set(System.getenv("token"))
|
||||
channels.set(publishChannels.split(",").map { it.trim() }.toList())
|
||||
}
|
||||
|
||||
runPluginVerifier {
|
||||
ideVersions.set(pluginVerifierIdeVersions.split(",").map { it.trim() }.toList())
|
||||
failureLevel.set(listOf(COMPATIBILITY_PROBLEMS))
|
||||
}
|
||||
|
||||
testlogger {
|
||||
theme = com.adarshr.gradle.testlogger.theme.ThemeType.MOCHA
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.eclipse.mylyn.github:org.eclipse.egit.github.core:5.11.0.202103091610-r") {
|
||||
exclude("gson")
|
||||
}
|
||||
compileOnly(fileTree("libs"))
|
||||
testImplementation("io.kotlintest:kotlintest:2.0.7")
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.languageVersion = kotlinLanguageVersion
|
||||
kotlinOptions.apiVersion = kotlinTargetVersion
|
||||
kotlinOptions.jvmTarget = javaVersion
|
||||
kotlinOptions.freeCompilerArgs = listOf("-Xskip-runtime-version-check", "-Xjsr305=strict")
|
||||
}
|
6
settings.gradle.kts
Normal file
6
settings.gradle.kts
Normal file
@ -0,0 +1,6 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.github.izhangzhihao.rainbow.brackets.settings
|
||||
|
||||
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
|
||||
import io.kotlintest.matchers.shouldBe
|
||||
import io.kotlintest.matchers.shouldNotBe
|
||||
|
||||
class RainbowConfigurableTest : LightJavaCodeInsightFixtureTestCase() {
|
||||
|
||||
override fun tearDown() {
|
||||
super.tearDown()
|
||||
val rainbowSettings = RainbowSettings.instance
|
||||
rainbowSettings.isRainbowEnabled = true
|
||||
rainbowSettings.isEnableRainbowAngleBrackets = true
|
||||
rainbowSettings.isEnableRainbowRoundBrackets = true
|
||||
rainbowSettings.isEnableRainbowSquareBrackets = true
|
||||
rainbowSettings.isEnableRainbowSquigglyBrackets = true
|
||||
rainbowSettings.isDoNOTRainbowifyBracketsWithoutContent = false
|
||||
}
|
||||
|
||||
fun testSettings() {
|
||||
val rainbowConfigurable = RainbowConfigurable()
|
||||
rainbowConfigurable.isModified shouldBe false
|
||||
rainbowConfigurable.displayName shouldBe "Rainbow Brackets"
|
||||
rainbowConfigurable.createComponent()
|
||||
rainbowConfigurable.settingsForm.shouldNotBe(null)
|
||||
|
||||
rainbowConfigurable.settingsForm!!.isRainbowEnabled() shouldBe true
|
||||
rainbowConfigurable.settingsForm!!.isRainbowAngleBracketsEnabled() shouldBe true
|
||||
rainbowConfigurable.settingsForm!!.isRainbowRoundBracketsEnabled() shouldBe true
|
||||
rainbowConfigurable.settingsForm!!.isRainbowSquareBracketsEnabled() shouldBe true
|
||||
rainbowConfigurable.settingsForm!!.isRainbowSquigglyBracketsEnabled() shouldBe true
|
||||
rainbowConfigurable.settingsForm!!.isShowRainbowIndentGuides() shouldBe true
|
||||
rainbowConfigurable.settingsForm!!.isDoNOTRainbowifyBracketsWithoutContent() shouldBe false
|
||||
|
||||
rainbowConfigurable.disposeUIResources()
|
||||
rainbowConfigurable.settingsForm.shouldBe(null)
|
||||
}
|
||||
|
||||
fun testUpdateSettings() {
|
||||
|
||||
val rainbowSettings = RainbowSettings.instance
|
||||
rainbowSettings.isRainbowEnabled = false
|
||||
rainbowSettings.isEnableRainbowAngleBrackets = false
|
||||
rainbowSettings.isEnableRainbowRoundBrackets = false
|
||||
rainbowSettings.isEnableRainbowSquareBrackets = false
|
||||
rainbowSettings.isEnableRainbowSquigglyBrackets = false
|
||||
rainbowSettings.isDoNOTRainbowifyBracketsWithoutContent = true
|
||||
|
||||
val rainbowConfigurable = RainbowConfigurable()
|
||||
rainbowConfigurable.createComponent()
|
||||
rainbowConfigurable.apply()
|
||||
|
||||
rainbowConfigurable.settingsForm!!.isRainbowEnabled() shouldBe false
|
||||
rainbowConfigurable.settingsForm!!.isRainbowAngleBracketsEnabled() shouldBe false
|
||||
rainbowConfigurable.settingsForm!!.isRainbowRoundBracketsEnabled() shouldBe false
|
||||
rainbowConfigurable.settingsForm!!.isRainbowSquareBracketsEnabled() shouldBe false
|
||||
rainbowConfigurable.settingsForm!!.isRainbowSquigglyBracketsEnabled() shouldBe false
|
||||
rainbowConfigurable.settingsForm!!.isDoNOTRainbowifyBracketsWithoutContent() shouldBe true
|
||||
|
||||
rainbowConfigurable.disposeUIResources()
|
||||
rainbowConfigurable.settingsForm.shouldBe(null)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user