Skip to content

Commit

Permalink
Update gradle script
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelldi committed Nov 24, 2023
1 parent a9880d7 commit 09761bb
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 13 deletions.
File renamed without changes.
47 changes: 36 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)

plugins {
id("java") // Java support
alias(libs.plugins.kotlin) // Kotlin support
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
}

group = properties("pluginGroup").get()
Expand All @@ -19,6 +17,7 @@ version = properties("pluginVersion").get()
// Configure project's dependencies
repositories {
mavenCentral()
maven { setUrl("https://cache-redirector.jetbrains.com/maven-central") }
}

// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
Expand Down Expand Up @@ -59,20 +58,46 @@ qodana {
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
}

// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
koverReport {
defaults {
xml {
onCheck = true
}
}
}

tasks {
wrapper {
gradleVersion = properties("gradleVersion").get()
}

val dotnetBuildConfiguration = properties("dotnetBuildConfiguration").get()
val compileDotNet by registering {
doLast {
exec {
executable("dotnet")
args("build", "-c", dotnetBuildConfiguration, "aspire-plugin.sln")
}
}
}

buildPlugin {
dependsOn(compileDotNet)
}

prepareSandbox {
dependsOn(compileDotNet)

val outputFolder = file("$projectDir/src/dotnet/aspire-plugin/bin/$dotnetBuildConfiguration")
val dllFiles = listOf(
"$outputFolder/aspire-plugin.dll",
"$outputFolder/aspire-plugin.pdb"
)

for (f in dllFiles) {
from(f) { into("${rootProject.name}/dotnet") }
}

doLast {
for (f in dllFiles) {
val file = file(f)
if (!file.exists()) throw RuntimeException("File \"$file\" does not exist")
}
}
}

patchPluginXml {
version = properties("pluginVersion")
sinceBuild = properties("pluginSinceBuild")
Expand Down
7 changes: 7 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ pluginUntilBuild = 233.*
platformType = RD
platformVersion = 2023.3-EAP7-SNAPSHOT

# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions.
# RD-2023.3
pluginVerifierIdeVersions = RD-2023.3-EAP7

dotnetBuildConfiguration=Debug

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins =
Expand Down
2 changes: 0 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ kotlin = "1.9.10"
changelog = "2.2.0"
gradleIntelliJPlugin = "1.16.0"
qodana = "0.1.13"
kover = "0.7.3"

[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
Expand All @@ -16,5 +15,4 @@ annotations = { group = "org.jetbrains", name = "annotations", version.ref = "an
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }

0 comments on commit 09761bb

Please sign in to comment.