-
-
Notifications
You must be signed in to change notification settings - Fork 461
feat(size-analysis): Integrate Size Analysis to measure SDK size overhead #4858
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8e7f9fd
feat(size-analysis): Integrate Size Analysis to measure SDK size over…
romtsn 8c1c7d7
newline
romtsn a5d5965
ignore test app
romtsn 641120b
formatting
romtsn 72fc335
exclude test app from spring-boot test matrix
romtsn 5d8a3bd
disable proguard mapping upload
romtsn d794abe
Add integrations
romtsn a1283e7
Merge branch 'main' into rz/feat/sdk-size-analysis
romtsn aa9791e
newline
romtsn cbc3217
Rename job
romtsn 646847f
Only upload for size analysis if auth token is present
romtsn 4cb0c72
Merge branch 'main' into rz/feat/sdk-size-analysis
romtsn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: SDK Size Analysis | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build and Analyze SDK Size | ||
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | ||
|
|
||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Java Version | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| distribution: "temurin" | ||
| java-version: "17" | ||
|
|
||
| # Workaround for https://github.com/gradle/actions/issues/21 to use config cache | ||
| - name: Cache buildSrc | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: buildSrc/build | ||
| key: build-logic-${{ hashFiles('buildSrc/src/**', 'buildSrc/build.gradle.kts','buildSrc/settings.gradle.kts') }} | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 | ||
| with: | ||
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | ||
|
|
||
| - name: Size Analysis | ||
| run: ./gradlew :sentry-android-integration-tests:test-app-size:bundleRelease | ||
| env: | ||
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /build |
60 changes: 60 additions & 0 deletions
60
sentry-android-integration-tests/test-app-size/build.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| plugins { | ||
| id("com.android.application") | ||
| id("io.sentry.android.gradle") | ||
| } | ||
|
|
||
| android { | ||
| namespace = "io.sentry.tests.size" | ||
| compileSdk = libs.versions.compileSdk.get().toInt() | ||
|
|
||
| defaultConfig { | ||
| applicationId = "io.sentry.tests.size" | ||
| minSdk = libs.versions.minSdk.get().toInt() | ||
| targetSdk = libs.versions.targetSdk.get().toInt() | ||
| versionCode = 1 | ||
| versionName = project.version.toString() | ||
| } | ||
|
|
||
| buildTypes { | ||
| release { | ||
| isMinifyEnabled = true | ||
| proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
| ndk { | ||
| abiFilters.clear() | ||
| abiFilters.add("arm64-v8a") | ||
| } | ||
| } | ||
| } | ||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| } | ||
| androidComponents.beforeVariants { | ||
| it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType) | ||
| } | ||
| } | ||
|
|
||
| configurations.configureEach { | ||
| exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8") | ||
| exclude(group = "androidx.core") | ||
| exclude(group = "androidx.lifecycle") | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(projects.sentryAndroidTimber) | ||
| implementation(projects.sentryAndroidSqlite) | ||
| implementation(projects.sentryOkhttp) | ||
| implementation(projects.sentryCompose) | ||
| implementation(projects.sentryAndroidFragment) | ||
| } | ||
|
|
||
| sentry { | ||
| org.set("sentry-sdks") | ||
| projectName.set("sentry-android") | ||
| authToken.set(System.getenv("SENTRY_AUTH_TOKEN")) | ||
| includeProguardMapping.set(false) | ||
| tracingInstrumentation.enabled.set(false) | ||
| includeDependenciesReport.set(false) | ||
| telemetry.set(false) | ||
| sizeAnalysis.enabled.set(true) | ||
| } | ||
51 changes: 51 additions & 0 deletions
51
sentry-android-integration-tests/test-app-size/proguard-rules.pro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Rules to not warn about missing classes. We use them, but we only want to measure the SDK size overhead and not run the app, so we keep it lean | ||
| # This is generated automatically by the Android Gradle plugin. | ||
| -dontwarn kotlin.Lazy | ||
| -dontwarn kotlin.LazyKt | ||
| -dontwarn kotlin.LazyThreadSafetyMode | ||
| -dontwarn kotlin.Metadata | ||
| -dontwarn kotlin.NoWhenBranchMatchedException | ||
| -dontwarn kotlin.Pair | ||
| -dontwarn kotlin.TuplesKt | ||
| -dontwarn kotlin.Unit | ||
| -dontwarn kotlin.collections.CollectionsKt | ||
| -dontwarn kotlin.comparisons.ComparisonsKt | ||
| -dontwarn kotlin.enums.EnumEntries | ||
| -dontwarn kotlin.enums.EnumEntriesKt | ||
| -dontwarn kotlin.io.CloseableKt | ||
| -dontwarn kotlin.io.FilesKt | ||
| -dontwarn kotlin.io.TextStreamsKt | ||
| -dontwarn kotlin.jdk7.AutoCloseableKt | ||
| -dontwarn kotlin.jvm.functions.Function0 | ||
| -dontwarn kotlin.jvm.functions.Function1 | ||
| -dontwarn kotlin.jvm.internal.DefaultConstructorMarker | ||
| -dontwarn kotlin.jvm.internal.Intrinsics | ||
| -dontwarn kotlin.jvm.internal.Lambda | ||
| -dontwarn kotlin.jvm.internal.MutablePropertyReference1 | ||
| -dontwarn kotlin.jvm.internal.MutablePropertyReference1Impl | ||
| -dontwarn kotlin.jvm.internal.Ref$ObjectRef | ||
| -dontwarn kotlin.jvm.internal.Reflection | ||
| -dontwarn kotlin.jvm.internal.SourceDebugExtension | ||
| -dontwarn kotlin.jvm.internal.TypeIntrinsics | ||
| -dontwarn kotlin.properties.ReadWriteProperty | ||
| -dontwarn kotlin.ranges.LongProgression | ||
| -dontwarn kotlin.ranges.LongRange | ||
| -dontwarn kotlin.ranges.RangesKt | ||
| -dontwarn kotlin.reflect.KMutableProperty1 | ||
| -dontwarn kotlin.reflect.KProperty | ||
| -dontwarn kotlin.sequences.Sequence | ||
| -dontwarn kotlin.text.Charsets | ||
| -dontwarn kotlin.text.Regex | ||
| -dontwarn kotlin.text.StringsKt | ||
| -dontwarn timber.log.Timber$Tree | ||
| -dontwarn kotlin.Deprecated | ||
| -dontwarn kotlin.Function | ||
| -dontwarn kotlin.jvm.JvmStatic | ||
| -dontwarn kotlin.jvm.functions.Function2 | ||
| -dontwarn kotlin.jvm.functions.Function3 | ||
| -dontwarn kotlin.jvm.internal.Ref$BooleanRef | ||
| -dontwarn kotlin.math.MathKt | ||
| -dontwarn okhttp3.EventListener | ||
| -dontwarn okhttp3.Interceptor | ||
| # Assume all classes are used to not strip them out, e.g. integrations like Compose or Sqlite | ||
| -keep class io.sentry.** |
6 changes: 6 additions & 0 deletions
6
sentry-android-integration-tests/test-app-size/src/main/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <manifest xmlns:tools="http://schemas.android.com/tools" | ||
| xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <application | ||
| android:label="SDK Size" | ||
| tools:ignore="MissingApplicationIcon" /> | ||
| </manifest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.