-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle.kts
113 lines (98 loc) · 3.63 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
// Environment settings
val isCI = System.getenv("CI") != null
plugins {
id("java") // Java support
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
alias(libs.plugins.kotlin) // Kotlin support
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
val baseIDE = providers.gradleProperty("baseIDE").get()
when (baseIDE) {
"IC" -> {
val version = providers.gradleProperty("baseVersion")
intellijIdeaCommunity(version, !version.get().contains("EAP"))
}
"CL" -> {
val version = providers.gradleProperty("clionVersion")
clion(version, !version.get().contains("EAP"))
}
else -> throw GradleException("Unexpected IDE type: $baseIDE")
}
instrumentationTools()
pluginModule(implementation(project(":core")))
pluginModule(runtimeOnly(project(":clion")))
pluginModule(runtimeOnly(project(":debugger")))
}
}
kotlin {
jvmToolchain(21)
}
intellijPlatform {
projectName = "fortran-plugin"
pluginConfiguration {
val pluginVersion = providers.gradleProperty("pluginVersion").get() + "." +
providers.gradleProperty("buildNumber").get()
id = "org.jetbrains.fortran"
name = "Fortran"
vendor {
name = "Semyon Atamas"
email = "[email protected]"
url = "https://github.com/satamas/fortran-plugin"
}
version = pluginVersion
val changelog = rootProject.changelog // local variable for configuration cache compatibility
// Get the latest available change notes from the changelog file
changeNotes = with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.PLAIN_TEXT,
)
}
description = providers.fileContents(rootProject.layout.projectDirectory.file("README.md")).asText.map {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"
with(it.lines()) {
if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
}
}
}
}
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
groups.empty()
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
}
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
qodana {
cachePath = provider { file(".qodana").canonicalPath }
reportPath = provider { file("build/reports/inspections").canonicalPath }
saveReport = true
showReport = providers.environmentVariable("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
}
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
kover {
reports {
total {
xml {
onCheck = true
}
}
}
}