Skip to content

Commit

Permalink
rewrite build.gradle with build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
izhangzhihao committed May 1, 2021
1 parent 06dc2df commit 80940e5
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 169 deletions.
106 changes: 0 additions & 106 deletions build.gradle

This file was deleted.

98 changes: 98 additions & 0 deletions build.gradle.kts
@@ -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 changes: 6 additions & 0 deletions settings.gradle.kts
@@ -0,0 +1,6 @@
pluginManagement {
repositories {
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
gradlePluginPortal()
}
}

This file was deleted.

0 comments on commit 80940e5

Please sign in to comment.