Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions agent-csa-bundle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

// This should be updated for every CSA release, eventually in dependencyManagement?

val csaVersion = "25.12.0-1409"
val csaVersion = "26.2.0-1416"
val otelInstrumentationVersion: String by rootProject.extra

base.archivesName.set("splunk-otel-javaagent-csa")
Expand All @@ -29,33 +29,27 @@ val splunkAgent: Configuration by configurations.creating {
}

repositories {
ivy {
// Required to source artifact directly from github release page
// https://github.com/signalfx/csa-releases/releases/download/<version>/oss-agent-mtagent-extension-deployment.jar
url = uri("https://github.com/")
metadataSources {
artifact()
}
patternLayout {
ivy("[organisation]/[module]/releases/download/[revision]/[artifact].[ext]")
artifact("[organisation]/[module]/releases/download/[revision]/[artifact].[ext]")
}
maven {
url = uri("https://artifactory.bare.appdynamics.com/artifactory/maven-releases/")
}
}

dependencies {
splunkAgent(project(":agent", configuration = "shadow"))
csaReleases("signalfx:csa-releases:$csaVersion") {
csaReleases("com.cisco.security:secureapp-otel-java-extension:$csaVersion") {
artifact {
name = "oss-agent-mtagent-extension-deployment"
extension = "jar"
name = "secureapp-otel-java-extension"
extension = "zip"
}
}
}

tasks {
// This exists purely to get the extension jar into our build dir
val copyCsaJar by registering(Jar::class) {
onlyIf("csa is only built from gitlab") {
System.getenv("GITLAB_CI") != null
}
archiveFileName.set("oss-agent-mtagent-extension-deployment.jar")
doFirst {
from(zipTree(csaReleases.singleFile))
Expand All @@ -64,13 +58,19 @@ tasks {

// Extract and rename extension classes
val extractExtensionClasses by registering(Copy::class) {
onlyIf("csa is only built from gitlab") {
System.getenv("GITLAB_CI") != null
}
dependsOn(copyCsaJar)
from(zipTree(copyCsaJar.get().archiveFile))
into("build/ext-exploded")
}

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

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

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

Expand Down Expand Up @@ -117,6 +123,9 @@ tasks {
}

jar {
onlyIf("csa is only built from gitlab") {
System.getenv("GITLAB_CI") != null
}
dependsOn(shadowCsaClasses)
from(zipTree(shadowCsaClasses.get().archiveFile.get()))
from(copyCsaJar.get().archiveFile.get())
Expand Down
1 change: 1 addition & 0 deletions instrumentation/nocode-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies {
exclude("io.opentelemetry.javaagent", "opentelemetry-javaagent-bootstrap")
}
testImplementation("org.snakeyaml:snakeyaml-engine")
testImplementation("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")
}

tasks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.splunk.opentelemetry.testing.declarativeconfig.DeclarativeConfigTestUtil;
import io.opentelemetry.api.incubator.config.ConfigProvider;
import io.opentelemetry.instrumentation.testing.internal.AutoCleanupExtension;
import io.opentelemetry.javaagent.extension.instrumentation.internal.AgentDistributionConfig;
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk;
import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -47,6 +48,7 @@ class NocodeInitializerTest {
void captureRules() {
previousRules = new ArrayList<>();
NocodeRules.getGlobalRules().forEach(previousRules::add);
AgentDistributionConfig.resetForTest();
}

@AfterEach
Expand Down