diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5e194789..8a207754 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,12 +8,12 @@ variables: CI_IMAGE_DOCKER: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/dd-sdk-android-gradle-plugin:$CURRENT_CI_IMAGE GIT_DEPTH: 5 - DD_AGENT_HOST: "$BUILDENV_HOST_IP" DD_SERVICE: "dd-sdk-android-gradle-plugin" DD_ENV_TESTS: "ci" DD_INTEGRATION_JUNIT_5_ENABLED: "true" DD_CIVISIBILITY_ENABLED: "true" DD_INSIDE_CI: "true" + DD_COMMON_AGENT_CONFIG: "dd.env=ci,dd.trace.enabled=false,dd.jmx.fetch.enabled=false" stages: - ci-image @@ -29,7 +29,7 @@ ci-image: stage: ci-image when: manual except: [ tags, schedules ] - tags: [ "runner:docker" ] + tags: [ "arch:amd64" ] image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:24.0.4-gbi-focal script: - docker build --tag $CI_IMAGE_DOCKER -f Dockerfile.gitlab . @@ -40,7 +40,7 @@ ci-image: create_key: stage: security when: manual - tags: [ "runner:docker" ] + tags: [ "arch:amd64" ] variables: PROJECT_NAME: "dd-sdk-android-gradle-plugin" EXPORT_TO_KEYSERVER: "true" @@ -63,7 +63,7 @@ static-analysis: strategy: depend analysis:licenses: - tags: [ "runner:main" ] + tags: [ "arch:amd64" ] image: $CI_IMAGE_DOCKER stage: analysis timeout: 30m @@ -72,7 +72,7 @@ analysis:licenses: - GRADLE_OPTS="-Xmx2560m" ./gradlew :dd-sdk-android-gradle-plugin:checkThirdPartyLicences --stacktrace --no-daemon analysis:woke: - tags: [ "runner:main" ] + tags: [ "arch:amd64" ] image: $CI_IMAGE_DOCKER stage: analysis timeout: 30m @@ -83,7 +83,7 @@ analysis:woke: # TESTS test:plugin: - tags: [ "runner:main" ] + tags: [ "arch:amd64" ] image: $CI_IMAGE_DOCKER stage: test timeout: 1h @@ -91,7 +91,8 @@ test:plugin: - git fetch --depth=1 origin main - rm -rf ~/.gradle/daemon/ - CODECOV_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android-gradle-plugin.codecov-token --with-decryption --query "Parameter.Value" --out text) - - GRADLE_OPTS="-Xmx2560m" ./gradlew :dd-sdk-android-gradle-plugin:test --stacktrace --no-daemon + - export DD_AGENT_HOST="$BUILDENV_HOST_IP" + - GRADLE_OPTS="-Xmx2560m" DD_TAGS="test.module:dd-sdk-android-gradle-plugin" ./gradlew :dd-sdk-android-gradle-plugin:test --stacktrace --no-daemon -Dorg.gradle.jvmargs=-javaagent:./libs/dd-java-agent-1.26.1.jar=$DD_COMMON_AGENT_CONFIG - bash <(cat ./codecov.sh) -t $CODECOV_TOKEN artifacts: reports: @@ -100,7 +101,7 @@ test:plugin: # PUBLISH ARTIFACTS publish:publish-sonatype: - tags: [ "runner:main" ] + tags: [ "arch:amd64" ] only: - tags image: $CI_IMAGE_DOCKER @@ -116,7 +117,7 @@ publish:publish-sonatype: - ./gradlew :dd-sdk-android-gradle-plugin:publishPluginMavenPublicationToMavenRepository --stacktrace --no-daemon publish:publish-gradle-portal: - tags: [ "runner:main" ] + tags: [ "arch:amd64" ] only: - tags image: $CI_IMAGE_DOCKER diff --git a/buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt b/buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt index a5ec87af..e06a3d5f 100644 --- a/buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt +++ b/buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt @@ -8,9 +8,7 @@ package com.datadog.gradle.config import org.gradle.api.JavaVersion import org.gradle.api.Project -import org.gradle.api.tasks.testing.Test import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import java.io.File fun Project.kotlinConfig() { taskConfig { @@ -19,22 +17,4 @@ fun Project.kotlinConfig() { jvmTarget = JavaVersion.VERSION_11.toString() } } - - val moduleName = this@kotlinConfig.name - val javaAgentJar = File(File(rootDir, "libs"), "dd-java-agent-0.98.1.jar") - taskConfig { - if (environment["DD_INTEGRATION_JUNIT_5_ENABLED"] == "true") { - // set the `env` tag for the test spans - environment("DD_ENV", "ci") - // add custom tags based on the module and variant (debug/release, flavors, …) - environment("DD_TAGS", "test.module:$moduleName") - - // disable other Datadog integrations that could interact with the Java Agent - environment("DD_INTEGRATIONS_ENABLED", "false") - // disable JMX integration - environment("DD_JMX_FETCH_ENABLED", "false") - - jvmArgs("-javaagent:${javaAgentJar.absolutePath}") - } - } } diff --git a/libs/dd-java-agent-0.98.1.jar b/libs/dd-java-agent-1.26.1.jar similarity index 59% rename from libs/dd-java-agent-0.98.1.jar rename to libs/dd-java-agent-1.26.1.jar index e09ce9f1..1fd391b0 100644 Binary files a/libs/dd-java-agent-0.98.1.jar and b/libs/dd-java-agent-1.26.1.jar differ