Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add demo app to CI builds #365

Merged
merged 13 commits into from
May 17, 2024
Merged
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
15 changes: 14 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,21 @@
{
// somehow renovate gets confused by the android property in gradle.properties,
// so let's just exclude it and hopefully clean up the dashboard
"matchPackageNames": ["string:rum.version"],
"matchPackageNames": [
"string:rum.version"
],
"enabled": false
},
{
// Try and force the demo app's kotlin and compose compilers to be in lockstep
// See https://github.com/renovatebot/renovate/issues/18354
"includePaths": ["demo-app/"],
"matchPackagePatterns": [
"^org.jetbrains.kotlin",
"^com.google.devtools.ksp",
"^androidx.compose.compiler"
],
"groupName": "kotlin"
}
]
}
5 changes: 5 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ jobs:
with:
distribution: temurin
java-version: 17
- name: touch local props
run: touch demo-app/local.properties
- name: run gradle check
run: ./gradlew check
- name: build demo app
working-directory: ./demo-app
run: ./gradlew check assemble
- name: publish snapshot
run: ./gradlew publishToSonatype
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
java-version: 17

- name: touch local props
run: touch local.properties
run: touch demo-app/local.properties

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ jobs:
distribution: temurin
java-version: 17
- name: touch local props
run: touch local.properties
run: touch demo-app/local.properties
- name: run gradle
run: ./gradlew check
- name: build demo app
working-directory: ./demo-app
run: ./gradlew check assemble

required-status-check:
needs:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea
.gradle
/local.properties
demo-app/local.properties
.DS_Store
**/build/
**/build/
1 change: 0 additions & 1 deletion android-agent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ dependencies {
implementation(project(":instrumentation:crash"))
implementation(project(":instrumentation:network"))
implementation(project(":instrumentation:slowrendering"))
implementation(libs.androidx.appcompat)
implementation(libs.androidx.core)
implementation(libs.androidx.navigation.fragment)

Expand Down
13 changes: 8 additions & 5 deletions demo-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import java.util.Properties

plugins {
id("com.android.application") version "8.4.0"
id("org.jetbrains.kotlin.android") version "1.9.23"
id("org.jetbrains.kotlin.android") version "1.9.24"
}

val localProperties = Properties()
Expand All @@ -12,11 +12,11 @@ localProperties.load(FileInputStream(rootProject.file("local.properties")))
android {
namespace = "io.opentelemetry.android.demo"
compileSdk = 34
targetSdk = 34
breedx-splk marked this conversation as resolved.
Show resolved Hide resolved

defaultConfig {
applicationId = "io.opentelemetry.android.demo"
minSdk = 21
targetSdk = 34
versionCode = 1
versionName = "1.0"

Expand Down Expand Up @@ -44,8 +44,9 @@ android {
viewBinding = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.13"
kotlinCompilerExtensionVersion = "1.5.14"
}
val javaVersion = JavaVersion.VERSION_11
compileOptions {
sourceCompatibility(javaVersion)
targetCompatibility(javaVersion)
Expand All @@ -65,9 +66,10 @@ dependencies {
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)

coreLibraryDesugaring(libs.desugarJdkLibs)

implementation("io.opentelemetry.android:android-agent")
implementation("io.opentelemetry.android:android-agent") //parent dir
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
Expand All @@ -76,8 +78,9 @@ dependencies {
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.opentelemetry.sdk)

implementation(libs.opentelemetry.exporter.otlp)

testImplementation(libs.bundles.junit)
androidTestImplementation(libs.androidx.junit)
debugImplementation(libs.androidx.ui.tooling)
Expand Down
43 changes: 43 additions & 0 deletions demo-app/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[versions]
opentelemetry = "1.38.0"
junit = "5.10.2"
spotless = "6.25.0"
kotlin = "1.9.24"

[libraries]
androidx-appcompat = "androidx.appcompat:appcompat:1.6.1"
opentelemetry-exporter-otlp = { module = "io.opentelemetry:opentelemetry-exporter-otlp", version.ref = "opentelemetry" }

#Test tools
androidx-junit = "androidx.test.ext:junit:1.1.5"
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit" }

#Compilation tools
desugarJdkLibs = "com.android.tools:desugar_jdk_libs:2.0.4"

# demo-app
androidx-core-ktx = "androidx.core:core-ktx:1.13.1"
androidx-lifecycle-runtime-ktx = "androidx.lifecycle:lifecycle-runtime-ktx:2.8.0"
androidx-compose-bom = "androidx.compose:compose-bom:2024.05.00"
androidx-activity-compose = "androidx.activity:activity-compose:1.9.0"
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version = "2.1.4" }
material = { group = "com.google.android.material", name = "material", version = "1.12.0" }
androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version = "2.8.0" }
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version = "2.8.0" }
androidx-navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version = "2.7.7" }
androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version = "2.7.7" }

[bundles]
junit = ["junit-jupiter-api", "junit-jupiter-engine", "junit-vintage-engine"]

[plugins]
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
Binary file added demo-app/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions demo-app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-dontwarn com.fasterxml.jackson.core.JsonFactory
-dontwarn com.fasterxml.jackson.core.JsonGenerator
-dontwarn com.google.auto.value.AutoValue$Builder
-dontwarn com.google.auto.value.AutoValue
-dontwarn com.google.auto.value.extension.memoized.Memoized
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minification was failing without this.

7 changes: 2 additions & 5 deletions demo-app/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
rootProject.name = "opentelemetry-android-demo"

pluginManagement {
repositories {
mavenCentral()
Expand All @@ -11,10 +13,5 @@ dependencyResolutionManagement {
mavenCentral()
google()
}
versionCatalogs {
create("libs") {
breedx-splk marked this conversation as resolved.
Show resolved Hide resolved
from(files("../gradle/libs.versions.toml"))
}
}
}
includeBuild("..")
Binary file modified demo-app/src/main/res/drawable/otel_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 0 additions & 19 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ kotlin = "1.9.24"

[libraries]
opentelemetry-platform = { module = "io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom", version.ref = "opentelemetry-instrumentation" }
androidx-appcompat = "androidx.appcompat:appcompat:1.6.1"
androidx-navigation-fragment = "androidx.navigation:navigation-fragment:2.7.7"
androidx-core = "androidx.core:core:1.13.1"
findbugs-jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
Expand Down Expand Up @@ -61,24 +60,6 @@ android-plugin = "com.android.tools.build:gradle:8.4.0"
byteBuddy-plugin = { module = "net.bytebuddy:byte-buddy-gradle-plugin", version.ref = "byteBuddy" }
kotlin-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }

# demo-app
androidx-core-ktx = "androidx.core:core-ktx:1.13.0"
androidx-lifecycle-runtime-ktx = "androidx.lifecycle:lifecycle-runtime-ktx:2.7.0"
androidx-compose-bom = "androidx.compose:compose-bom:2024.05.00"
androidx-activity-compose = "androidx.activity:activity-compose:1.9.0"
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version = "2.1.4" }
material = { group = "com.google.android.material", name = "material", version = "1.12.0" }
androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version = "2.7.0" }
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version = "2.7.0" }
androidx-navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version = "2.7.7" }
androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version = "2.7.7" }

[bundles]
mocking = ["mockito-core", "mockito-junit-jupiter", "mockk"]
junit = ["junit-jupiter-api", "junit-jupiter-engine", "junit-vintage-engine"]
Expand Down
2 changes: 0 additions & 2 deletions instrumentation/volley/library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ android {
}

dependencies {
implementation(libs.androidx.appcompat)
implementation(libs.androidx.navigation.fragment)
implementation(libs.opentelemetry.instrumentation.api)
implementation(libs.opentelemetry.semconv.incubating)
compileOnly(libs.volley)
coreLibraryDesugaring(libs.desugarJdkLibs)

api(platform(libs.opentelemetry.platform))
api(libs.opentelemetry.api)
Expand Down