|
| 1 | +import io.gitlab.arturbosch.detekt.Detekt |
| 2 | +import org.jetbrains.changelog.markdownToHTML |
| 3 | +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
| 4 | +import java.io.FileInputStream |
| 5 | +import java.util.* |
| 6 | + |
| 7 | +fun properties(key: String) = project.findProperty(key).toString() |
| 8 | + |
| 9 | +plugins { |
| 10 | + id("org.jetbrains.kotlin.jvm") version "1.5.10" |
| 11 | + // gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin |
| 12 | + id("org.jetbrains.intellij") version "1.0" |
| 13 | + // gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin |
| 14 | + id("org.jetbrains.changelog") version "1.1.2" |
| 15 | + // detekt linter - read more: https://detekt.github.io/detekt/gradle.html |
| 16 | + id("io.gitlab.arturbosch.detekt") version "1.17.1" |
| 17 | + // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle |
| 18 | + id("org.jlleitschuh.gradle.ktlint") version "10.0.0" |
| 19 | +} |
| 20 | +version = properties("pluginVersion") |
| 21 | +// Configure project's dependencies |
| 22 | +repositories { |
| 23 | + mavenCentral() |
| 24 | +} |
| 25 | +dependencies { |
| 26 | + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.17.1") |
| 27 | +} |
| 28 | + |
| 29 | +intellij { |
| 30 | + version.set("2019.2") |
| 31 | + pluginName.set("ServiceStackIDEA") |
| 32 | + plugins.set(listOf("maven","java")) |
| 33 | +} |
| 34 | + |
| 35 | +var pubNightly: String? = System.getenv("SERVICESTACKIDEA_PUBLISH_NIGHTLY") |
| 36 | +var buildNum: String? = System.getenv("BUILD_NUMBER") |
| 37 | + |
| 38 | + |
| 39 | +if(pubNightly != null && buildNum != null) { |
| 40 | + // Append build number to version for a new nightly build version to be published. |
| 41 | + version = "${version}.$buildNum" |
| 42 | +} |
| 43 | + |
| 44 | +var jbToken: String? = "" |
| 45 | + |
| 46 | +if (properties("jetbrains.plugins.user").isEmpty()) { |
| 47 | + val props = Properties() |
| 48 | + val fis = FileInputStream("local.properties") |
| 49 | + props.load(fis) |
| 50 | +} |
| 51 | +jbToken = properties("jetbrains.plugins.token") |
| 52 | + |
| 53 | +tasks { |
| 54 | + |
| 55 | + runPluginVerifier { |
| 56 | + ideVersions.set(listOf( |
| 57 | + "WS-2019.2", |
| 58 | + "WS-2020.2.4", |
| 59 | + "IIU-2020.1.1", |
| 60 | + "IIU-2021.1" |
| 61 | + )) |
| 62 | + } |
| 63 | + |
| 64 | + publishPlugin { |
| 65 | + token.set(jbToken) |
| 66 | + channels.set(listOf("beta")) |
| 67 | + } |
| 68 | + |
| 69 | + patchPluginXml { |
| 70 | + version.set(properties("pluginVersion")) |
| 71 | + sinceBuild.set(properties("pluginSinceBuild")) |
| 72 | + untilBuild.set(properties("pluginUntilBuild")) |
| 73 | + } |
| 74 | +} |
0 commit comments