-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle.kts
151 lines (130 loc) · 5.36 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
plugins {
id("java") // Java support
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
id("jacoco") // Code coverage
id("maven-publish")
alias(libs.plugins.gradleNexusPublishPlugin)
}
group = "com.redhat.devtools.intellij"
version = providers.gradleProperty("projectVersion").get() // Plugin version
val platformVersion = providers.gradleProperty("ideaVersion").get()
// Set the JVM language level used to build the project.
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}
repositories {
mavenLocal()
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
create(IntelliJPlatformType.IntellijIdeaCommunity, platformVersion)
// Bundled Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
// for local plugin -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin-faq.html#how-to-add-a-dependency-on-a-plugin-available-in-the-file-system
//plugins.set(listOf(file("/path/to/plugin/")))
instrumentationTools()
testFramework(TestFrameworkType.Platform)
}
implementation(libs.kubernetes.client)
implementation(libs.openshift.client)
implementation(libs.kubernetes.httpclient.okhttp)
implementation(libs.jackson.core)
implementation(libs.commons.exec)
implementation(libs.commons.lang3)
implementation(libs.common.lang)
// for unit tests
testImplementation(libs.junit)
testImplementation(libs.assertj.core)
testImplementation(libs.mockito.core)
testImplementation(libs.opentest4j) // known issue: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#missing-opentest4j-dependency-in-test-framework
}
tasks {
wrapper {
gradleVersion = providers.gradleProperty("gradleVersion").get()
}
test {
useJUnit()
systemProperty("tools.dl.path", temporaryDir)
jvmArgs("-Djava.awt.headless=true")
testLogging {
exceptionFormat = TestExceptionFormat.FULL
}
}
withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}
register("packageTests", Jar::class) {
from(sourceSets.test.get().output)
archiveClassifier.set("test")
}
printProductsReleases {
channels = listOf(ProductRelease.Channel.EAP)
types = listOf(IntelliJPlatformType.IntellijIdeaCommunity)
untilBuild = provider { null }
}
}
nexusPublishing {
packageGroup.set("JBoss Releases Staging Profile")
repositories {
create("jbossNexus") {
nexusUrl.set(uri("https://repository.jboss.org/nexus/service/local/"))
snapshotRepositoryUrl.set(uri("https://repository.jboss.org/nexus/content/repositories/snapshots/"))
username.set(project.properties["nexusUser"].toString()) // defaults to project.properties["myNexusUsername"]
password.set(project.properties["nexusPassword"].toString()) // defaults to project.properties["myNexusPassword"]
}
}
}
val testJarFile = file("${layout.buildDirectory.get().asFile.absolutePath}/libs/intellij-common-${version}-test.jar")
val testArtifact = artifacts.add("archives", testJarFile) {
type = "test"
classifier = "test"
builtBy("packageTests")
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["intellijPlatform"])
artifact(tasks.named("sourcesJar"))
artifact(tasks.named("javadocJar"))
artifact(testArtifact)
pom {
name.set("IntelliJ Common")
description.set("Common utilities for IntelliJ plugins")
url.set("https://github.com/redhat-developer/intellij-common")
licenses {
license {
name.set("Eclipse Public License 2.0")
url.set("https://www.eclipse.org/legal/epl-v20.html")
}
}
developers {
developer {
name.set("Red Hat Developer")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/redhat-developer/intellij-common.git")
developerConnection.set("scm:git:ssh://[email protected]:redhat-developer/intellij-common.git")
url.set("https://github.com/redhat-developer/intellij-common/")
}
}
}
}
}