Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ import(test),com.jakewharton.android.repackaged,Apache-2.0,"Copyright (C) 2007 T
import(test),com.parse.bolts,"BSD License","Copyright (c) Facebook, Inc. and its affiliates."
import(test),com.squareup,Apache-2.0,"Copyright 2015 Square, Inc."
import(test),dev.drewhamilton.poko,Apache-2.0,Copyright 2020-Present Drew Hamilton
import(test),dev.zacsweers.kctfork,MPL-2.0,"Copyright (C) 2023 Thilo Schuchort"
import(test),greatest,ICT,"Copyright (c) 2011-2018 Scott Vokes <vokes.s@gmail.com>"
import(test),io.github.davidburstrom.contester,Apache-2.0,"Copyright 2022-2024 David Burström"
import(test),io.github.detekt.sarif4k,Apache-2.0,"Copyright 2021 Artur Bosch & Contributors"
Expand Down Expand Up @@ -185,7 +186,6 @@ build,com.fasterxml.jackson.dataformat,Apache-2.,"Copyright (c) 2007- Tatu Salor
build,com.fasterxml.jackson.module,Apache-2.0,"Copyright (c) 2007- Tatu Saloranta"
build,com.fasterxml.woodstox,Apache-2.0,"Copyright (c) 2007- Tatu Saloranta"
build,com.github.ajalt.clikt,Apache-2.0,"Copyright clikt authors"
build,com.github.tschuchortdev,MPL-2.0,"Copyright (C) 2023 Thilo Schuchort"
build,com.google.android,Apache-2.0,Copyright (C) 2013 The Android Open Source Project
build,com.google.api.grpc,Apache-2.0,Copyright 2020 Google LLC
build,com.google.auto,Apache-2.0,"Copyright 2014 Google LLC"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

internal fun Project.kotlinConfig(
evaluateWarningsAsErrors: Boolean = true,
jvmBytecodeTarget: JvmTarget = JvmTarget.JVM_17
jvmBytecodeTarget: JvmTarget = JvmTarget.JVM_17,
kotlinApiVersion: KotlinVersion = KotlinVersion.KOTLIN_2_0,
kotlinLanguageVersion: KotlinVersion = KotlinVersion.KOTLIN_2_0
) {
taskConfig<KotlinJvmCompile> {
compilerOptions {
jvmTarget.set(jvmBytecodeTarget)
val isCI = System.getenv("CI").toBoolean()
allWarningsAsErrors.set(evaluateWarningsAsErrors && isCI)
apiVersion.set(KotlinVersion.KOTLIN_2_0)
languageVersion.set(KotlinVersion.KOTLIN_2_0)
apiVersion.set(kotlinApiVersion)
languageVersion.set(kotlinLanguageVersion)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ApiSurfacePlugin : Plugin<Project> {
private fun Project.createParserConfiguration(): Configuration {
val kotlinVersion = extensions.getByType<VersionCatalogsExtension>()
.named("libs")
.findVersion("kotlin")
.findVersion("kotlinBuildscript")
.orElseThrow { IllegalStateException("No `kotlin` version found in the version catalog") }
return configurations.create(CONFIGURATION_PARSER) {
isCanBeConsumed = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.datadog.gradle.config.kotlinConfig
import com.datadog.gradle.config.publishingConfig
import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import javax.inject.Inject

/**
Expand All @@ -29,9 +30,11 @@ abstract class DatadogBuildExtension @Inject constructor(
/** Aligns Kotlin compilation: bytecode target, API/language version and warning strictness. */
fun applyKotlinConfig(
evaluateWarningsAsErrors: Boolean = true,
jvmBytecodeTarget: JvmTarget = JvmTarget.JVM_17
jvmBytecodeTarget: JvmTarget = JvmTarget.JVM_17,
kotlinApiVersion: KotlinVersion = KotlinVersion.KOTLIN_2_0,
kotlinLanguageVersion: KotlinVersion = KotlinVersion.KOTLIN_2_0
) {
project.kotlinConfig(evaluateWarningsAsErrors, jvmBytecodeTarget)
project.kotlinConfig(evaluateWarningsAsErrors, jvmBytecodeTarget, kotlinApiVersion, kotlinLanguageVersion)
}

/** Applies the shared `com.android.library` setup: SDK levels, source sets, lint and packaging. */
Expand Down
4 changes: 2 additions & 2 deletions dd-sdk-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ android {
}

dependencies {
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)

// Network
implementation(libs.okHttp)
Expand Down Expand Up @@ -144,7 +144,7 @@ dependencies {
unmock(libs.robolectric)

// Test Fixtures
testFixturesImplementation(libs.kotlin)
testFixturesImplementation(libs.kotlinRuntime)
testFixturesImplementation(libs.bundles.jUnit5)
testFixturesImplementation(libs.okHttp)
testFixturesImplementation(libs.bundles.testTools)
Expand Down
4 changes: 2 additions & 2 deletions dd-sdk-android-internal/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {
}

dependencies {
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.androidXAnnotation)

// Generate NoOp implementations
Expand All @@ -65,7 +65,7 @@ dependencies {
)
}
}
testFixturesImplementation(libs.kotlin)
testFixturesImplementation(libs.kotlinRuntime)
testFixturesImplementation(libs.bundles.jUnit5)
testFixturesImplementation(libs.bundles.testTools)
testFixturesImplementation(project(":tools:unit")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies {
// OpenFeature SDK
api(libs.openFeatureKotlinSdk)

implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.coroutinesCore)
implementation(libs.androidXAnnotation)

Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-flags/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
implementation(project(":dd-sdk-android-internal"))

implementation(libs.gson)
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.okHttp)
implementation(libs.androidXAnnotation)
implementation(libs.androidXCollection)
Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-logs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ android {
dependencies {
api(project(":dd-sdk-android-core"))
implementation(project(":dd-sdk-android-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.gson)
implementation(libs.androidXAnnotation)

Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-ndk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ android {
dependencies {
implementation(project(":dd-sdk-android-internal"))
api(project(":dd-sdk-android-core"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.okHttp)

testImplementation(project(":tools:unit")) {
Expand Down
4 changes: 2 additions & 2 deletions features/dd-sdk-android-profiling/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ android {
dependencies {
api(project(":dd-sdk-android-core"))
implementation(project(":dd-sdk-android-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.androidXCore)
implementation(libs.androidXCoreKtx)
implementation(libs.gson)
Expand All @@ -78,7 +78,7 @@ dependencies {
unmock(libs.robolectric)

// Test Fixtures
testFixturesImplementation(libs.kotlin)
testFixturesImplementation(libs.kotlinRuntime)
testFixturesImplementation(project(":dd-sdk-android-internal"))
testFixturesImplementation(libs.androidXAnnotation)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
dependencies {
implementation(project(":dd-sdk-android-internal"))
implementation(project(":features:dd-sdk-android-rum"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)

// Android Instrumentation
implementation(libs.androidXFragment)
Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-rum-internal/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ android {
dependencies {
implementation(project(":dd-sdk-android-core"))
implementation(project(":dd-sdk-android-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)

testImplementation(project(":tools:unit")) {
attributes {
Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-rum-prelaunch/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ android {

dependencies {
implementation(project(":features:dd-sdk-android-rum-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)

testImplementation(project(":tools:unit")) {
attributes {
Expand Down
4 changes: 2 additions & 2 deletions features/dd-sdk-android-rum/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
api(project(":dd-sdk-android-core"))
implementation(project(":dd-sdk-android-internal"))
implementation(project(":features:dd-sdk-android-rum-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.gson)
implementation(libs.okHttp)

Expand Down Expand Up @@ -105,7 +105,7 @@ dependencies {
)
}
}
testFixturesImplementation(libs.kotlin)
testFixturesImplementation(libs.kotlinRuntime)
testFixturesImplementation(libs.bundles.jUnit5)
testFixturesImplementation(libs.okHttp)
testFixturesImplementation(libs.bundles.testTools)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ android {
dependencies {
api(project(":features:dd-sdk-android-session-replay"))
implementation(project(":dd-sdk-android-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.gson)

implementation(platform(libs.androidXComposeBom))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {

dependencies {
api(project(":features:dd-sdk-android-session-replay"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.gson)
implementation(libs.googleMaterial)

Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-session-replay/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
api(project(":dd-sdk-android-core"))
implementation(project(":dd-sdk-android-internal"))
implementation(libs.okHttp)
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.gson)
implementation(libs.androidXAppCompat)

Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-trace-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
api(project(":dd-sdk-android-core"))
implementation(project(":dd-sdk-android-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.gson)
implementation(libs.androidXAnnotation)
implementation(libs.bundles.traceCore)
Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-trace-internal/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
api(project(":dd-sdk-android-core"))
implementation(project(":dd-sdk-android-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.gson)
implementation(libs.androidXAnnotation)
implementation(libs.bundles.traceCore)
Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-trace-otel/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ android {

dependencies {
api(libs.openTelemetryApi)
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.androidXAnnotation)

api(project(":dd-sdk-android-core"))
Expand Down
4 changes: 2 additions & 2 deletions features/dd-sdk-android-trace/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencies {
api(project(":features:dd-sdk-android-trace-api"))
implementation(project(":dd-sdk-android-internal"))
implementation(project(":features:dd-sdk-android-trace-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.gson)
implementation(libs.androidXAnnotation)
implementation(libs.bundles.traceCore)
Expand All @@ -86,7 +86,7 @@ dependencies {

// Test Fixtures
testFixturesImplementation(libs.gson)
testFixturesImplementation(libs.kotlin)
testFixturesImplementation(libs.kotlinRuntime)
testFixturesImplementation(libs.okHttp)
testFixturesImplementation(libs.bundles.jUnit5)
testFixturesImplementation(libs.bundles.testTools)
Expand Down
2 changes: 1 addition & 1 deletion features/dd-sdk-android-webview/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
api(project(":dd-sdk-android-core"))
implementation(project(":dd-sdk-android-internal"))
implementation(libs.kotlin)
implementation(libs.kotlinRuntime)
implementation(libs.gson)
implementation(libs.androidXAnnotation)

Expand Down
40 changes: 17 additions & 23 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ apollo = "4.3.3"
cronetApi = "143.7445.0"
cronetPlayServices = "18.1.1"
gson = "2.10.1"
kotlin = "2.0.21"
# Deliberately not `version.ref = "kotlin"`: this must match the Kotlin Gradle Plugin that is actually
# loaded, which is AGP's. `androidToolsPlugin` (below) depends on KGP 2.2.10, and that outranks the
# `kotlin` version above in conflict resolution (`kotlin-gradle-plugin:2.0.21 -> 2.2.10`).
# The Compose *compiler* is always resolved at the loaded KGP's version and never at this one, so the
# two drift apart silently. An older plugin against a newer compiler passes options the compiler has
# since deprecated (RUM-18191, `generateFunctionKeyMetaClasses`), and the version also decides which
# options are sent at all — 2.2.10 turns on `sourceInformation`, which changes generated Compose code.
# Re-check this whenever `androidToolsPlugin` moves.
composeCompilerPlugin = "2.2.10"
kotlinSP = "2.0.21-1.0.28"
# We have 2 different versions of Kotlin: one is for the buildscript classpath - Gradle Plugin,
# Buildscript runtime dependency; another is for the SDK compile/runtime classpath.
kotlinBuildscript = "2.2.10"
kotlinRuntime = "2.0.21"
kotlinSP = "2.2.10-2.0.2"
kronosNTP = "0.0.1-alpha11"
kotlinxSerialization = "1.6.3"
okHttp = "4.12.0"
Expand Down Expand Up @@ -67,7 +61,7 @@ msgPackCore = "0.9.12"
protobufJava = "4.35.0"
sketchesJava = "0.8.3"
kover = "0.9.8"
kspTesting = "1.5.0"
kspTesting = "0.8.0"

# Tools
detekt = "1.23.8"
Expand All @@ -81,7 +75,7 @@ androidLint = "31.0.2"
nexusPublishGradlePlugin = "2.0.0"
datadogPlugin = "1.31.0"

kotlinPoet = "1.14.2"
kotlinPoet = "2.2.0"
jsonSchemaValidator = "1.14.6"
binaryCompatibility = "0.18.1"
dependencyLicense = "0.7.0"
Expand Down Expand Up @@ -122,7 +116,7 @@ material3Android = "1.1.2"
# Gradle version catalog doesn't allow names to end with plugin, that is why strange names
androidToolsGradlePluginApi = { module = "com.android.tools.build:gradle-api", version.ref = "androidToolsPlugin" }
apolloRuntime = { module = "com.apollographql.apollo:apollo-runtime", version.ref = "apollo" }
kotlinGradlePluginApi = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin-api", version.ref = "kotlin" }
kotlinGradlePluginApi = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin-api", version.ref = "kotlinBuildscript" }
dokkaGradlePlugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
detektGradlePlugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
unmockGradlePlugin = { module = "com.github.bjoernq:unmockplugin", version.ref = "unmock" }
Expand All @@ -133,7 +127,8 @@ roomCompiler = { module = "androidx.room:room-compiler", version.ref = "room" }

# Common

kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlinRuntime = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlinRuntime" }
kotlinBuildscript = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlinBuildscript" }
kotlinxSerializationJson = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" }

okHttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okHttp" }
Expand Down Expand Up @@ -215,8 +210,8 @@ mockitoKotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "m
msgPackCore = { module = "org.msgpack:msgpack-core", version.ref = "msgPackCore" }
protobufJava = { module = "com.google.protobuf:protobuf-java", version.ref = "protobufJava" }
sketchesJava = { module = "com.datadoghq:sketches-java", version.ref = "sketchesJava" }
kotlinReflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kspTesting = { module = "com.github.tschuchortdev:kotlin-compile-testing-ksp", version.ref = "kspTesting" }
kotlinReflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlinRuntime" }
kspTesting = { module = "dev.zacsweers.kctfork:ksp", version.ref = "kspTesting" }
androidLintTests = { module = "com.android.tools.lint:lint-tests", version.ref = "androidLint" }
systemStubsJupiter = { module = "uk.org.webcompere:system-stubs-jupiter", version.ref = "systemStubsJupiter" }

Expand All @@ -232,7 +227,7 @@ androidLintChecks = { module = "com.android.tools.lint:lint-checks", version.ref
kotlinPoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinPoet" }
kotlinPoetKsp = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlinPoet" }
kotlinSP = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "kotlinSP" }
kotlinCompilerEmbeddable = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable", version.ref = "kotlin" }
kotlinCompilerEmbeddable = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable", version.ref = "kotlinBuildscript" }
jsonSchemaValidator = { module = "com.github.erosb:everit-json-schema", version.ref = "jsonSchemaValidator" }
kotlinXmlBuilder = { module = "org.redundent:kotlin-xml-builder", version.ref = "kotlinXmlBuilder" }

Expand Down Expand Up @@ -308,8 +303,7 @@ testTools = [
"elmyrInject",
"elmyrJUnit5",
"elmyrJVM",
"mockitoKotlin",
"kotlinReflect"
"mockitoKotlin"
]

androidXNavigation = [
Expand Down Expand Up @@ -386,16 +380,16 @@ traceCore = [
[plugins]
nexusPublishGradlePlugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPublishGradlePlugin" }
datadogGradlePlugin = { id = "com.datadoghq.dd-sdk-android-gradle-plugin", version.ref = "datadogPlugin" }
composeCompilerPlugin = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "composeCompilerPlugin" }
composeCompilerPlugin = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinBuildscript" }
apolloPlugin = { id = "com.apollographql.apollo", version.ref = "apollo" }
dependencyLicenseGradlePlugin = { id = "com.datadoghq.dependency-license", version.ref = "dependencyLicense" }
kotlinAndroidPlugin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlinAndroidPlugin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinBuildscript" }
androidLibraryPlugin = { id = "com.android.library", version.ref = "androidToolsPlugin" }
kotlinSPGradlePlugin = { id = "com.google.devtools.ksp", version.ref = "kotlinSP" }
dokkaGradlePlugin = { id = "org.jetbrains.dokka", version.ref = "dokka" }
sqlDelightGradlePlugin = { id = "com.squareup.sqldelight", version.ref = "sqlDelight" }
binaryCompatibilityGradlePlugin = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibility" }
kotlinxSerializationPlugin = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinxSerializationPlugin = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinBuildscript" }
koverPlugin = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
ktlintGradlePlugin = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlintGradlePlugin" }
detektGradlePlugin = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
Loading
Loading