Skip to content

Commit 8641e92

Browse files
committed
Revert "trying to simplify where this gitlab condition is actually needed..."
This reverts commit 1a102de.
1 parent 1a102de commit 8641e92

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

agent-csa-bundle/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ dependencies {
4747
tasks {
4848
// This exists purely to get the extension jar into our build dir
4949
val copyCsaJar by registering(Jar::class) {
50+
onlyIf("csa is only built from gitlab") {
51+
System.getenv("GITLAB_CI") != null
52+
}
5053
archiveFileName.set("oss-agent-mtagent-extension-deployment.jar")
5154
doFirst {
5255
from(zipTree(csaReleases.singleFile))
@@ -55,13 +58,19 @@ tasks {
5558

5659
// Extract and rename extension classes
5760
val extractExtensionClasses by registering(Copy::class) {
61+
onlyIf("csa is only built from gitlab") {
62+
System.getenv("GITLAB_CI") != null
63+
}
5864
dependsOn(copyCsaJar)
5965
from(zipTree(copyCsaJar.get().archiveFile))
6066
into("build/ext-exploded")
6167
}
6268

6369
// Rename class to classdata
6470
val renameClasstoClassdata by registering(Copy::class) {
71+
onlyIf("csa is only built from gitlab") {
72+
System.getenv("GITLAB_CI") != null
73+
}
6574
dependsOn(extractExtensionClasses)
6675
from("build/ext-exploded/com/cisco/mtagent/adaptors/")
6776
into("build/ext-exploded/com/cisco/mtagent/adaptors/")
@@ -72,12 +81,18 @@ tasks {
7281

7382
// Copy service file so path on disk matches path in jar
7483
val copyServiceFile by registering(Copy::class) {
84+
onlyIf("csa is only built from gitlab") {
85+
System.getenv("GITLAB_CI") != null
86+
}
7587
dependsOn(extractExtensionClasses)
7688
from("build/ext-exploded/META-INF/services/")
7789
into("build/ext-exploded/inst/META-INF/services/")
7890
}
7991

8092
val shadowCsaClasses by registering(ShadowJar::class) {
93+
onlyIf("csa is only built from gitlab") {
94+
System.getenv("GITLAB_CI") != null
95+
}
8196
archiveFileName.set("shadow-csa-classes.jar")
8297
dependsOn(copyServiceFile, renameClasstoClassdata, splunkAgent)
8398

0 commit comments

Comments
 (0)