diff --git a/README.md b/README.md index 6489817d4..16c8dd4db 100644 --- a/README.md +++ b/README.md @@ -37,13 +37,18 @@ channel in the [CNCF slack](https://slack.cncf.io/). Please join us there for fu ## Gradle -To use this android instrumentation library in your application, first add a dependency -in your gradle build script: +To use this android instrumentation library in your application, you will first need to add +a dependency in your application's `build.gradle.kts`. We publish a bill of materials (BOM) that +helps to coordinate versions of the opentelemetry-android components and the upstream +`opentelemetry-java-instrumentation` and `opentelemetry-java` dependencies. We recommend +using the bom as a platform dependency, and then omitting explicit version information +from all other opentelemetry dependencies: ```kotlin dependencies { //... - implementation("io.opentelemetry.android:android-agent:0.12.0-alpha") + api(platform("io.opentelemetry.android:opentelemetry-android-bom.12.0-alpha")) + implementation("io.opentelemetry.android:android-agent") // Version is resolved thru bom //... } ``` diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 66282d671..712ad8d6b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,6 +19,7 @@ compose = "1.5.4" [libraries] opentelemetry-platform-alpha = { module = "io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha", version.ref = "opentelemetry-instrumentation-alpha" } opentelemetry-platform = { module = "io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom" } +opentelemetry-core-bom = { module = "io.opentelemetry:opentelemetry-bom" } androidx-navigation-fragment = { group = "androidx.navigation", name = "navigation-fragment", version.ref = "androidx-navigation" } androidx-navigation-runtime-ktx = { group = "androidx.navigation", name = "navigation-runtime-ktx", version.ref = "androidx-navigation" } androidx-core = "androidx.core:core:1.16.0" diff --git a/opentelemetry-android-bom/build.gradle.kts b/opentelemetry-android-bom/build.gradle.kts index c94670a7b..2311d7c94 100644 --- a/opentelemetry-android-bom/build.gradle.kts +++ b/opentelemetry-android-bom/build.gradle.kts @@ -5,7 +5,12 @@ plugins { description = "OpenTelemetry Android Bill of Materials" +javaPlatform.allowDependencies() + dependencies { + api(platform(libs.opentelemetry.platform.alpha)) + api(platform(libs.opentelemetry.platform)) + api(platform(libs.opentelemetry.core.bom)) constraints { rootProject.subprojects.forEach { subproject -> if (subproject != project) {