Skip to content

Commit 87ac85e

Browse files
authored
Merge pull request #2230 from DataDog/yl/publish-benchmark-module
Publish benchmark module to sonatype
2 parents 572137a + 1037bf5 commit 87ac85e

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

.gitlab-ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,18 @@ publish:release-rum:
714714
- !reference [.snippets, set-publishing-credentials]
715715
- ./gradlew :features:dd-sdk-android-rum:publishToSonatype --stacktrace --no-daemon
716716

717+
publish:release-benchmark:
718+
tags: [ "arch:amd64" ]
719+
only:
720+
- tags
721+
- develop
722+
image: $CI_IMAGE_DOCKER
723+
stage: publish
724+
timeout: 30m
725+
script:
726+
- !reference [.snippets, set-publishing-credentials]
727+
- ./gradlew :tools:benchmark:publishToSonatype --stacktrace --no-daemon
728+
717729
# SLACK NOTIFICATIONS
718730

719731
notify:publish-develop-success:

tools/benchmark/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ import com.datadog.gradle.config.dependencyUpdateConfig
1010
import com.datadog.gradle.config.java17
1111
import com.datadog.gradle.config.junitConfig
1212
import com.datadog.gradle.config.kotlinConfig
13+
import com.datadog.gradle.config.publishingConfig
1314

1415
plugins {
1516
id("com.android.library")
1617
kotlin("android")
1718
id("com.github.ben-manes.versions")
19+
20+
`maven-publish`
21+
signing
1822
}
1923

2024
android {
@@ -55,3 +59,4 @@ kotlinConfig()
5559
junitConfig()
5660
dependencyUpdateConfig()
5761
androidLibraryConfig()
62+
publishingConfig("An internal benchmarking tool to measure the overhead of Datadog SDK")

tools/benchmark/generate_trace_models.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright 2016-Present Datadog, Inc.
55
*/
66

7+
import com.android.build.gradle.tasks.SourceJarTask
78
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
89

910
val generateTraceModelsTaskName = "generateTraceModelsFromJson"
@@ -20,4 +21,15 @@ afterEvaluate {
2021
tasks.withType(KotlinCompile::class.java).configureEach {
2122
dependsOn(generateTraceModelsTaskName)
2223
}
24+
25+
// need to add an explicit dependency, otherwise there is an error during publishing
26+
// Task ':tools:benchmark:sourceReleaseJar' uses this output of task
27+
// ':tools:benchmark:generateTraceModelsFromJson' without
28+
// declaring an explicit or implicit dependency
29+
//
30+
// it is not needed for other modules with similar model generation, because they use KSP,
31+
// and KSP plugin see to establish link between sourcesJar and "generated" folder in general
32+
tasks.withType(SourceJarTask::class.java) {
33+
dependsOn(generateTraceModelsTaskName)
34+
}
2335
}

0 commit comments

Comments
 (0)