2022-05-18 13:06:32 +05:30

100 lines
2.8 KiB
Plaintext

// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License-AGPL.txt in the project root for license information.
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
fun properties(key: String) = project.findProperty(key).toString()
plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.5.10"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "1.0"
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
id("io.gitlab.arturbosch.detekt") version "1.17.1"
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
}
group = properties("pluginGroup")
version = properties("version")
// Configure project's dependencies
repositories {
mavenCentral()
}
dependencies {
implementation(project(":supervisor-api")) {
artifact {
type = "jar"
}
}
implementation(project(":gitpod-protocol")) {
artifact {
type = "jar"
}
}
implementation("io.prometheus:simpleclient_pushgateway:0.15.0")
compileOnly("javax.websocket:javax.websocket-api:1.1")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.18.1")
testImplementation(kotlin("test"))
}
// Configure gradle-intellij-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
type.set(properties("platformType"))
instrumentCode.set(false)
downloadSources.set(properties("platformDownloadSources").toBoolean())
updateSinceUntilBuild.set(true)
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}
// Configure detekt plugin.
// Read more: https://detekt.github.io/detekt/kotlindsl.html
detekt {
autoCorrect = true
buildUponDefaultConfig = true
reports {
html.enabled = false
xml.enabled = false
txt.enabled = false
}
}
tasks {
withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
withType<Detekt> {
jvmTarget = "11"
}
buildSearchableOptions {
enabled = false
}
test {
useJUnitPlatform()
}
runPluginVerifier {
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty))
}
}