From 8d8b0141e24b398e391a6fd676e619053db9f224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Wed, 18 Dec 2024 13:42:16 +0000 Subject: [PATCH 01/18] Compare APKs to calculate SDK sizes --- .github/workflows/sdk-size-checks.yml | 126 ++++++++++++++++++ .github/workflows/sdk-size-updates.yml | 98 ++++++++++++++ README.md | 9 ++ metrics/size.json | 14 ++ .../build.gradle.kts | 24 ++++ .../src/main/AndroidManifest.xml | 33 +++++ .../client/metrics/baseline/MainActivity.kt | 21 +++ .../build.gradle.kts | 26 ++++ .../src/main/AndroidManifest.xml | 33 +++++ .../client/metrics/stream/MainActivity.kt | 21 +++ .../build.gradle.kts | 35 +++++ .../src/main/AndroidManifest.xml | 33 +++++ .../compose/metrics/baseline/MainActivity.kt | 21 +++ .../build.gradle.kts | 37 +++++ .../src/main/AndroidManifest.xml | 33 +++++ .../compose/metrics/stream/MainActivity.kt | 21 +++ .../build.gradle.kts | 24 ++++ .../src/main/AndroidManifest.xml | 33 +++++ .../offline/metrics/baseline/MainActivity.kt | 21 +++ .../build.gradle.kts | 26 ++++ .../src/main/AndroidManifest.xml | 33 +++++ .../offline/metrics/stream/MainActivity.kt | 21 +++ .../build.gradle.kts | 24 ++++ .../src/main/AndroidManifest.xml | 33 +++++ .../metrics/baseline/MainActivity.kt | 21 +++ .../build.gradle.kts | 26 ++++ .../src/main/AndroidManifest.xml | 33 +++++ .../components/metrics/stream/MainActivity.kt | 21 +++ 28 files changed, 901 insertions(+) create mode 100644 .github/workflows/sdk-size-checks.yml create mode 100644 .github/workflows/sdk-size-updates.yml create mode 100644 metrics/size.json create mode 100644 metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts create mode 100644 metrics/stream-chat-android-client-metrics-baseline/src/main/AndroidManifest.xml create mode 100644 metrics/stream-chat-android-client-metrics-baseline/src/main/kotlin/io/getstream/chat/android/client/metrics/baseline/MainActivity.kt create mode 100644 metrics/stream-chat-android-client-metrics-stream/build.gradle.kts create mode 100644 metrics/stream-chat-android-client-metrics-stream/src/main/AndroidManifest.xml create mode 100644 metrics/stream-chat-android-client-metrics-stream/src/main/kotlin/io/getstream/chat/android/client/metrics/stream/MainActivity.kt create mode 100644 metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts create mode 100644 metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml create mode 100644 metrics/stream-chat-android-compose-metrics-baseline/src/main/kotlin/io/getstream/chat/android/compose/metrics/baseline/MainActivity.kt create mode 100644 metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts create mode 100644 metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml create mode 100644 metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt create mode 100644 metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts create mode 100644 metrics/stream-chat-android-offline-metrics-baseline/src/main/AndroidManifest.xml create mode 100644 metrics/stream-chat-android-offline-metrics-baseline/src/main/kotlin/io/getstream/chat/android/offline/metrics/baseline/MainActivity.kt create mode 100644 metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts create mode 100644 metrics/stream-chat-android-offline-metrics-stream/src/main/AndroidManifest.xml create mode 100644 metrics/stream-chat-android-offline-metrics-stream/src/main/kotlin/io/getstream/chat/android/offline/metrics/stream/MainActivity.kt create mode 100644 metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts create mode 100644 metrics/stream-chat-android-ui-components-metrics-baseline/src/main/AndroidManifest.xml create mode 100644 metrics/stream-chat-android-ui-components-metrics-baseline/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/baseline/MainActivity.kt create mode 100644 metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts create mode 100644 metrics/stream-chat-android-ui-components-metrics-stream/src/main/AndroidManifest.xml create mode 100644 metrics/stream-chat-android-ui-components-metrics-stream/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/stream/MainActivity.kt diff --git a/.github/workflows/sdk-size-checks.yml b/.github/workflows/sdk-size-checks.yml new file mode 100644 index 00000000000..e915aaa71bc --- /dev/null +++ b/.github/workflows/sdk-size-checks.yml @@ -0,0 +1,126 @@ +name: SDK size checks + +on: + pull_request: + +env: + MODULES: "stream-chat-android-client stream-chat-android-offline stream-chat-android-ui-components stream-chat-android-compose" + METRICS_FILE: "metrics/size.json" + MAX_TOLERANCE: 500 + FINE_TOLERANCE: 250 + +jobs: + compare-sdk-sizes: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + - uses: ./.github/actions/setup-java + - uses: ./.github/actions/gradle-cache + with: + key-prefix: gradle-build + + - name: Assemble SDKs + run: | + for module in $MODULES; do + modules+=" :metrics:$module-metrics-baseline:assemble :metrics:$module-metrics-stream:assemble" + done + ./gradlew $modules + + - name: Get current SDK sizes + run: | + # Reads current SDK sizes from the metrics file + # and define to a variable using a compact JSON format + # so it can be exported for the next job step + CURRENT_SDK_SIZES=$(jq -c .debug $METRICS_FILE) + echo "CURRENT_SDK_SIZES=$CURRENT_SDK_SIZES" >> $GITHUB_ENV + + - name: Calculate PR branch SDK sizes + run: | + echo '{}' > pr_sdk_sizes.json + + # Calculate sizes from the .apk files and save them into a temporary JSON file + # so it can be exported for the next job step + for module in $MODULES; do + baselineFile="metrics/$module-metrics-baseline/build/outputs/apk/debug/$module-metrics-baseline-debug.apk" + streamFile="metrics/$module-metrics-stream/build/outputs/apk/debug/$module-metrics-stream-debug.apk" + + baselineSize=$(du -k "$baselineFile" | awk '{print $1}') + streamSize=$(du -k "$streamFile" | awk '{print $1}') + size=$((streamSize - baselineSize)) + + jq -c --arg sdk "$module" --arg size "$size" '. + {($sdk): ($size | tonumber)}' pr_sdk_sizes.json > temp.json && mv temp.json pr_sdk_sizes.json + done + + echo "PR_SDK_SIZES=$(cat pr_sdk_sizes.json)" >> $GITHUB_ENV + + - name: Post comment on PR + uses: actions/github-script@v6 + with: + script: | + const maxTolerance = process.env.MAX_TOLERANCE + const fineTolerance = process.env.FINE_TOLERANCE + const currentSdkSizes = process.env.CURRENT_SDK_SIZES ? JSON.parse(process.env.CURRENT_SDK_SIZES) : {}; + const prSdkSizes = JSON.parse(process.env.PR_SDK_SIZES); + const commentHeader = '## SDK Size Comparison * 📏'; + + // Prepare the comparison table + + let commentBody = ` + ${commentHeader} + + | SDK | Before | After | Difference | Status | + |-|-|-|-|-| + `; + + Object.keys(prSdkSizes).forEach(sdk => { + const currentSize = currentSdkSizes[sdk] || 0; + const prSize = prSdkSizes[sdk]; + const diff = prSize - currentSize; + const currentSizeInMb = (currentSize / 1024).toFixed(2); + const prSizeInMb = (prSize / 1024).toFixed(2); + const diffInMb = (diff / 1024).toFixed(2); + + let status = "🟢"; + if (diff < 0) { + status = "🚀"; + } else if (diff >= maxTolerance) { + status = "🔴"; + } else if (diff >= fineTolerance) { + status = "🟡"; + } + + commentBody += `| ${sdk} | ${currentSizeInMb} MB | ${prSizeInMb} MB | ${diffInMb} MB | ${status} |\n`; + }); + + commentBody += `\* Based on debug builds\n`; + + // Post or update the PR comment + + // Find existing comment + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + }); + + const comment = comments.find(c => c.body.includes(commentHeader)); + + if (comment) { + // Update the existing comment + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: comment.id, + body: commentBody, + }); + } else { + // Create a new comment + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + body: commentBody, + }); + } diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml new file mode 100644 index 00000000000..8882d39a53f --- /dev/null +++ b/.github/workflows/sdk-size-updates.yml @@ -0,0 +1,98 @@ +name: SDK size updates + +on: +# push: +# branches: +# - develop + pull_request: + + workflow_dispatch: + +#concurrency: +# group: ${{ github.ref }} +# cancel-in-progress: true + +env: + MODULES: "stream-chat-android-client stream-chat-android-offline stream-chat-android-ui-components stream-chat-android-compose" + VARIANTS: "debug release" + METRICS_FILE: "metrics/size.json" + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + +jobs: + update-sdk-sizes: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + - uses: ./.github/actions/setup-java + - uses: ./.github/actions/gradle-cache + with: + key-prefix: gradle-build + + - name: Assemble SDKs + run: | + for module in $MODULES; do + modules+=" :metrics:$module-metrics-baseline:assemble :metrics:$module-metrics-stream:assemble" + done + ./gradlew $modules + + - name: Update size metrics + run: | + # Create temporary JSON file + echo '{}' > metrics.json + + # Calculate sizes + for module in $MODULES; do + for variant in $VARIANTS; do + baselineFile="metrics/$module-metrics-baseline/build/outputs/apk/$variant/$module-metrics-baseline-$variant.apk" + streamFile="metrics/$module-metrics-stream/build/outputs/apk/$variant/$module-metrics-stream-$variant.apk" + + # Ensure files exist + if [[ -f "$baselineFile" && -f "$streamFile" ]]; then + baselineSize=$(du -k "$baselineFile" | awk '{print $1}') + streamSize=$(du -k "$streamFile" | awk '{print $1}') + size=$((streamSize - baselineSize)) + else + echo "Warning: $baselineFile or $streamFile not found. Setting size to 0." + size=0 + fi + + # Update JSON + jq --arg module "$module" --arg variant "$variant" --argjson size "$size" \ + ".\"$variant\".\"$module\" = $size" metrics.json > temp.json && mv temp.json metrics.json + done + done + + # Validate Generated JSON + jq . metrics.json + + # Move temporary JSON file to the final file + mv metrics.json $METRICS_FILE + + - name: Update size badges + run: | + for module in $MODULES; do + size=$(jq --arg module "$module" ".release.\"$module\"" $METRICS_FILE) + sizeInMb=$(echo "scale=2; $size / 1024" | bc) + badgeUrl="https://img.shields.io/badge/${module//-/--}-$sizeInMb%20MB-lightgreen" + sed -i "s|!\[$module\](.*)|![$module](${badgeUrl})|" README.md + done + + - name: Commit and Push JSON + run: | + git fetch origin $BRANCH_NAME + git checkout $BRANCH_NAME + + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + # Add and commit updated metrics file + git add $METRICS_FILE + git commit -m "Update SDK size metrics" || echo "No metrics changes to commit" + + # Add and commit updated README file + git add README.md + git commit -m "Update SDK size badges" || echo "No README changes to commit" + + git push origin HEAD:$BRANCH_NAME diff --git a/README.md b/README.md index 88ee120d48e..c3b17f759a6 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,15 @@

+
+ +![stream-chat-android-client](https://img.shields.io/badge/stream--chat--android--client-3.01%20MB-lightgreen) +![stream-chat-android-offline](https://img.shields.io/badge/stream--chat--android--offline-3.22%20MB-lightgreen) +![stream-chat-android-ui-components](https://img.shields.io/badge/stream--chat--android--ui--components-7.88%20MB-lightgreen) +![stream-chat-android-compose](https://img.shields.io/badge/stream--chat--android--compose-9.70%20MB-lightgreen) + +
+ This is the official Android SDK for [Stream Chat](https://getstream.io/chat/sdk/android/), a service for building chat and messaging applications. This library includes both a low-level chat SDK and a set of reusable UI components. Most users start with the UI components, and fall back to the lower level API when they want to customize things. We're proud to say that we're the first Android Chat SDK that supports Jetpack Compose! We [released](https://github.com/GetStream/stream-chat-android/releases/tag/4.15.0) our Compose UI Components one day after the official Jetpack Compose 1.0 release and our team members have been working hard on it since then. diff --git a/metrics/size.json b/metrics/size.json new file mode 100644 index 00000000000..6881646be6d --- /dev/null +++ b/metrics/size.json @@ -0,0 +1,14 @@ +{ + "debug": { + "stream-chat-android-client": 15036, + "stream-chat-android-offline": 15336, + "stream-chat-android-ui-components": 21028, + "stream-chat-android-compose": 23484 + }, + "release": { + "stream-chat-android-client": 3092, + "stream-chat-android-offline": 3300, + "stream-chat-android-ui-components": 8072, + "stream-chat-android-compose": 9940 + } +} diff --git a/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts new file mode 100644 index 00000000000..5f9357ded16 --- /dev/null +++ b/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts @@ -0,0 +1,24 @@ +import io.getstream.chat.android.Dependencies + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +apply(from = "$rootDir/scripts/android.gradle") + +android { + namespace = "io.getstream.chat.android.client.metrics.baseline" + buildTypes { + release { + signingConfig = signingConfigs.findByName("debug") + } + } +} + +dependencies { + detektPlugins(Dependencies.detektFormatting) + + implementation(Dependencies.coroutinesCore) + implementation(Dependencies.androidxAppCompat) +} diff --git a/metrics/stream-chat-android-client-metrics-baseline/src/main/AndroidManifest.xml b/metrics/stream-chat-android-client-metrics-baseline/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..0b34f9b8797 --- /dev/null +++ b/metrics/stream-chat-android-client-metrics-baseline/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/metrics/stream-chat-android-client-metrics-baseline/src/main/kotlin/io/getstream/chat/android/client/metrics/baseline/MainActivity.kt b/metrics/stream-chat-android-client-metrics-baseline/src/main/kotlin/io/getstream/chat/android/client/metrics/baseline/MainActivity.kt new file mode 100644 index 00000000000..e18cd699e70 --- /dev/null +++ b/metrics/stream-chat-android-client-metrics-baseline/src/main/kotlin/io/getstream/chat/android/client/metrics/baseline/MainActivity.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.client.metrics.baseline + +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts new file mode 100644 index 00000000000..43698f3759f --- /dev/null +++ b/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts @@ -0,0 +1,26 @@ +import io.getstream.chat.android.Dependencies + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +apply(from = "$rootDir/scripts/android.gradle") + +android { + namespace = "io.getstream.chat.android.client.metrics.stream" + buildTypes { + release { + signingConfig = signingConfigs.findByName("debug") + } + } +} + +dependencies { + detektPlugins(Dependencies.detektFormatting) + + implementation(Dependencies.coroutinesCore) + implementation(Dependencies.androidxAppCompat) + + implementation(project(":stream-chat-android-client")) +} diff --git a/metrics/stream-chat-android-client-metrics-stream/src/main/AndroidManifest.xml b/metrics/stream-chat-android-client-metrics-stream/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..0b34f9b8797 --- /dev/null +++ b/metrics/stream-chat-android-client-metrics-stream/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/metrics/stream-chat-android-client-metrics-stream/src/main/kotlin/io/getstream/chat/android/client/metrics/stream/MainActivity.kt b/metrics/stream-chat-android-client-metrics-stream/src/main/kotlin/io/getstream/chat/android/client/metrics/stream/MainActivity.kt new file mode 100644 index 00000000000..5439ca4bbdd --- /dev/null +++ b/metrics/stream-chat-android-client-metrics-stream/src/main/kotlin/io/getstream/chat/android/client/metrics/stream/MainActivity.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.client.metrics.stream + +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts new file mode 100644 index 00000000000..409285525ba --- /dev/null +++ b/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts @@ -0,0 +1,35 @@ +import io.getstream.chat.android.Dependencies + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("org.jetbrains.kotlin.plugin.compose") +} + +apply(from = "$rootDir/scripts/android.gradle") + +android { + namespace = "io.getstream.chat.android.compose.metrics.baseline" + buildFeatures.compose = true + buildTypes { + release { + signingConfig = signingConfigs.findByName("debug") + } + } +} + +dependencies { + detektPlugins(Dependencies.detektFormatting) + + implementation(Dependencies.composeUi) + implementation(Dependencies.composeUiTooling) + implementation(Dependencies.composeFoundation) + implementation(Dependencies.composeMaterial) + implementation(Dependencies.composeMaterialIcons) + + implementation(Dependencies.composeActivity) + implementation(Dependencies.composeAndroidLifecycle) + implementation(Dependencies.composeViewModel) + implementation(Dependencies.composeAccompanistPermissions) + implementation(Dependencies.composeAccompanistPager) +} diff --git a/metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml b/metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..0b34f9b8797 --- /dev/null +++ b/metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/metrics/stream-chat-android-compose-metrics-baseline/src/main/kotlin/io/getstream/chat/android/compose/metrics/baseline/MainActivity.kt b/metrics/stream-chat-android-compose-metrics-baseline/src/main/kotlin/io/getstream/chat/android/compose/metrics/baseline/MainActivity.kt new file mode 100644 index 00000000000..9f61eef3f4a --- /dev/null +++ b/metrics/stream-chat-android-compose-metrics-baseline/src/main/kotlin/io/getstream/chat/android/compose/metrics/baseline/MainActivity.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.compose.metrics.baseline + +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts new file mode 100644 index 00000000000..3272742c4fe --- /dev/null +++ b/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts @@ -0,0 +1,37 @@ +import io.getstream.chat.android.Dependencies + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("org.jetbrains.kotlin.plugin.compose") +} + +apply(from = "$rootDir/scripts/android.gradle") + +android { + namespace = "io.getstream.chat.android.compose.metrics.stream" + buildFeatures.compose = true + buildTypes { + release { + signingConfig = signingConfigs.findByName("debug") + } + } +} + +dependencies { + detektPlugins(Dependencies.detektFormatting) + + implementation(Dependencies.composeUi) + implementation(Dependencies.composeUiTooling) + implementation(Dependencies.composeFoundation) + implementation(Dependencies.composeMaterial) + implementation(Dependencies.composeMaterialIcons) + + implementation(Dependencies.composeActivity) + implementation(Dependencies.composeAndroidLifecycle) + implementation(Dependencies.composeViewModel) + implementation(Dependencies.composeAccompanistPermissions) + implementation(Dependencies.composeAccompanistPager) + + implementation(project(":stream-chat-android-compose")) +} diff --git a/metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml b/metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..0b34f9b8797 --- /dev/null +++ b/metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt b/metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt new file mode 100644 index 00000000000..7e9bf936ed9 --- /dev/null +++ b/metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.compose.metrics.stream + +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts new file mode 100644 index 00000000000..a21d97d0551 --- /dev/null +++ b/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts @@ -0,0 +1,24 @@ +import io.getstream.chat.android.Dependencies + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +apply(from = "$rootDir/scripts/android.gradle") + +android { + namespace = "io.getstream.chat.android.offline.metrics.baseline" + buildTypes { + release { + signingConfig = signingConfigs.findByName("debug") + } + } +} + +dependencies { + detektPlugins(Dependencies.detektFormatting) + + implementation(Dependencies.coroutinesCore) + implementation(Dependencies.androidxAppCompat) +} diff --git a/metrics/stream-chat-android-offline-metrics-baseline/src/main/AndroidManifest.xml b/metrics/stream-chat-android-offline-metrics-baseline/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..0b34f9b8797 --- /dev/null +++ b/metrics/stream-chat-android-offline-metrics-baseline/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/metrics/stream-chat-android-offline-metrics-baseline/src/main/kotlin/io/getstream/chat/android/offline/metrics/baseline/MainActivity.kt b/metrics/stream-chat-android-offline-metrics-baseline/src/main/kotlin/io/getstream/chat/android/offline/metrics/baseline/MainActivity.kt new file mode 100644 index 00000000000..0e63ac5b550 --- /dev/null +++ b/metrics/stream-chat-android-offline-metrics-baseline/src/main/kotlin/io/getstream/chat/android/offline/metrics/baseline/MainActivity.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.offline.metrics.baseline + +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts new file mode 100644 index 00000000000..88c3d1474ce --- /dev/null +++ b/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts @@ -0,0 +1,26 @@ +import io.getstream.chat.android.Dependencies + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +apply(from = "$rootDir/scripts/android.gradle") + +android { + namespace = "io.getstream.chat.android.offline.metrics.baseline" + buildTypes { + release { + signingConfig = signingConfigs.findByName("debug") + } + } +} + +dependencies { + detektPlugins(Dependencies.detektFormatting) + + implementation(Dependencies.coroutinesCore) + implementation(Dependencies.androidxAppCompat) + + implementation(project(":stream-chat-android-offline")) +} diff --git a/metrics/stream-chat-android-offline-metrics-stream/src/main/AndroidManifest.xml b/metrics/stream-chat-android-offline-metrics-stream/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..0b34f9b8797 --- /dev/null +++ b/metrics/stream-chat-android-offline-metrics-stream/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/metrics/stream-chat-android-offline-metrics-stream/src/main/kotlin/io/getstream/chat/android/offline/metrics/stream/MainActivity.kt b/metrics/stream-chat-android-offline-metrics-stream/src/main/kotlin/io/getstream/chat/android/offline/metrics/stream/MainActivity.kt new file mode 100644 index 00000000000..5b2df008d32 --- /dev/null +++ b/metrics/stream-chat-android-offline-metrics-stream/src/main/kotlin/io/getstream/chat/android/offline/metrics/stream/MainActivity.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.offline.metrics.stream + +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts new file mode 100644 index 00000000000..76331c69876 --- /dev/null +++ b/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts @@ -0,0 +1,24 @@ +import io.getstream.chat.android.Dependencies + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +apply(from = "$rootDir/scripts/android.gradle") + +android { + namespace = "io.getstream.chat.android.ui.components.metrics.baseline" + buildTypes { + release { + signingConfig = signingConfigs.findByName("debug") + } + } +} + +dependencies { + detektPlugins(Dependencies.detektFormatting) + + implementation(Dependencies.coroutinesCore) + implementation(Dependencies.androidxAppCompat) +} diff --git a/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/AndroidManifest.xml b/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..0b34f9b8797 --- /dev/null +++ b/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/baseline/MainActivity.kt b/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/baseline/MainActivity.kt new file mode 100644 index 00000000000..2f5e2095fae --- /dev/null +++ b/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/baseline/MainActivity.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.ui.components.metrics.baseline + +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts new file mode 100644 index 00000000000..4960bce1210 --- /dev/null +++ b/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts @@ -0,0 +1,26 @@ +import io.getstream.chat.android.Dependencies + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +apply(from = "$rootDir/scripts/android.gradle") + +android { + namespace = "io.getstream.chat.android.ui.components.metrics.stream" + buildTypes { + release { + signingConfig = signingConfigs.findByName("debug") + } + } +} + +dependencies { + detektPlugins(Dependencies.detektFormatting) + + implementation(Dependencies.coroutinesCore) + implementation(Dependencies.androidxAppCompat) + + implementation(project(":stream-chat-android-ui-components")) +} diff --git a/metrics/stream-chat-android-ui-components-metrics-stream/src/main/AndroidManifest.xml b/metrics/stream-chat-android-ui-components-metrics-stream/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..0b34f9b8797 --- /dev/null +++ b/metrics/stream-chat-android-ui-components-metrics-stream/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/metrics/stream-chat-android-ui-components-metrics-stream/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/stream/MainActivity.kt b/metrics/stream-chat-android-ui-components-metrics-stream/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/stream/MainActivity.kt new file mode 100644 index 00000000000..1737f1141b7 --- /dev/null +++ b/metrics/stream-chat-android-ui-components-metrics-stream/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/stream/MainActivity.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.ui.components.metrics.stream + +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() From 75754ba363ee79b9b01c74d9d5d960c8b97db324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Tue, 31 Dec 2024 14:01:15 +0000 Subject: [PATCH 02/18] Use release to build the comparison table --- .github/workflows/sdk-size-checks.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sdk-size-checks.yml b/.github/workflows/sdk-size-checks.yml index e915aaa71bc..52bdb026072 100644 --- a/.github/workflows/sdk-size-checks.yml +++ b/.github/workflows/sdk-size-checks.yml @@ -24,7 +24,7 @@ jobs: - name: Assemble SDKs run: | for module in $MODULES; do - modules+=" :metrics:$module-metrics-baseline:assemble :metrics:$module-metrics-stream:assemble" + modules+=" :metrics:$module-metrics-baseline:assembleRelease :metrics:$module-metrics-stream:assembleRelease" done ./gradlew $modules @@ -33,7 +33,7 @@ jobs: # Reads current SDK sizes from the metrics file # and define to a variable using a compact JSON format # so it can be exported for the next job step - CURRENT_SDK_SIZES=$(jq -c .debug $METRICS_FILE) + CURRENT_SDK_SIZES=$(jq -c .release $METRICS_FILE) echo "CURRENT_SDK_SIZES=$CURRENT_SDK_SIZES" >> $GITHUB_ENV - name: Calculate PR branch SDK sizes @@ -43,8 +43,8 @@ jobs: # Calculate sizes from the .apk files and save them into a temporary JSON file # so it can be exported for the next job step for module in $MODULES; do - baselineFile="metrics/$module-metrics-baseline/build/outputs/apk/debug/$module-metrics-baseline-debug.apk" - streamFile="metrics/$module-metrics-stream/build/outputs/apk/debug/$module-metrics-stream-debug.apk" + baselineFile="metrics/$module-metrics-baseline/build/outputs/apk/release/$module-metrics-baseline-release.apk" + streamFile="metrics/$module-metrics-stream/build/outputs/apk/release/$module-metrics-stream-release.apk" baselineSize=$(du -k "$baselineFile" | awk '{print $1}') streamSize=$(du -k "$streamFile" | awk '{print $1}') @@ -63,7 +63,7 @@ jobs: const fineTolerance = process.env.FINE_TOLERANCE const currentSdkSizes = process.env.CURRENT_SDK_SIZES ? JSON.parse(process.env.CURRENT_SDK_SIZES) : {}; const prSdkSizes = JSON.parse(process.env.PR_SDK_SIZES); - const commentHeader = '## SDK Size Comparison * 📏'; + const commentHeader = '## SDK Size Comparison 📏'; // Prepare the comparison table @@ -94,8 +94,6 @@ jobs: commentBody += `| ${sdk} | ${currentSizeInMb} MB | ${prSizeInMb} MB | ${diffInMb} MB | ${status} |\n`; }); - commentBody += `\* Based on debug builds\n`; - // Post or update the PR comment // Find existing comment From ba78516b9448897cff9ea33affbfae65bcf31fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Tue, 31 Dec 2024 14:14:27 +0000 Subject: [PATCH 03/18] Trigger updates on merging to develop --- .github/workflows/sdk-size-updates.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index 8882d39a53f..e1716360e62 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -1,16 +1,15 @@ name: SDK size updates on: -# push: -# branches: -# - develop - pull_request: + push: + branches: + - develop workflow_dispatch: -#concurrency: -# group: ${{ github.ref }} -# cancel-in-progress: true +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true env: MODULES: "stream-chat-android-client stream-chat-android-offline stream-chat-android-ui-components stream-chat-android-compose" From 54a6e54f7136668f8d6fa55d8dbc8734797aabd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 09:10:18 +0000 Subject: [PATCH 04/18] changes after rebasing from develop which contains version catalog and kts refactoring --- build.gradle.kts | 8 +++++++ .../build.gradle.kts | 8 +++---- .../build.gradle.kts | 8 +++---- .../build.gradle.kts | 24 +++++++++---------- .../build.gradle.kts | 24 +++++++++---------- .../build.gradle.kts | 8 +++---- .../build.gradle.kts | 8 +++---- .../build.gradle.kts | 8 +++---- .../build.gradle.kts | 8 +++---- settings.gradle.kts | 8 +++++++ 10 files changed, 56 insertions(+), 56 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a2af8c4bc4d..19410166c7e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -95,6 +95,14 @@ apiValidation { "stream-chat-android-test", "stream-chat-android-compose-sample", "stream-chat-android-ui-guides", + "stream-chat-android-client-metrics-baseline", + "stream-chat-android-client-metrics-stream", + "stream-chat-android-offline-metrics-baseline", + "stream-chat-android-offline-metrics-stream", + "stream-chat-android-ui-components-metrics-baseline", + "stream-chat-android-ui-components-metrics-stream", + "stream-chat-android-compose-metrics-baseline", + "stream-chat-android-compose-metrics-stream", ) nonPublicMarkers += listOf( diff --git a/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts index 5f9357ded16..f6eb35614cc 100644 --- a/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts +++ b/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts @@ -1,5 +1,3 @@ -import io.getstream.chat.android.Dependencies - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -17,8 +15,8 @@ android { } dependencies { - detektPlugins(Dependencies.detektFormatting) + detektPlugins(libs.detekt.formatting) - implementation(Dependencies.coroutinesCore) - implementation(Dependencies.androidxAppCompat) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.androidx.appcompat) } diff --git a/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts index 43698f3759f..021d07ebc51 100644 --- a/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts +++ b/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts @@ -1,5 +1,3 @@ -import io.getstream.chat.android.Dependencies - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -17,10 +15,10 @@ android { } dependencies { - detektPlugins(Dependencies.detektFormatting) + detektPlugins(libs.detekt.formatting) - implementation(Dependencies.coroutinesCore) - implementation(Dependencies.androidxAppCompat) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.androidx.appcompat) implementation(project(":stream-chat-android-client")) } diff --git a/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts index 409285525ba..1a037af4369 100644 --- a/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts +++ b/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts @@ -1,5 +1,3 @@ -import io.getstream.chat.android.Dependencies - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -19,17 +17,17 @@ android { } dependencies { - detektPlugins(Dependencies.detektFormatting) + detektPlugins(libs.detekt.formatting) - implementation(Dependencies.composeUi) - implementation(Dependencies.composeUiTooling) - implementation(Dependencies.composeFoundation) - implementation(Dependencies.composeMaterial) - implementation(Dependencies.composeMaterialIcons) + implementation(libs.androidx.compose.ui) + implementation(libs.androidx.compose.ui.tooling) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.compose.material.icons.core) - implementation(Dependencies.composeActivity) - implementation(Dependencies.composeAndroidLifecycle) - implementation(Dependencies.composeViewModel) - implementation(Dependencies.composeAccompanistPermissions) - implementation(Dependencies.composeAccompanistPager) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.lifecycle.runtime.compose) + implementation(libs.androidx.lifecycle.viewmodel.compose) + implementation(libs.google.accompanist.permissions) + implementation(libs.google.accompanist.pager) } diff --git a/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts index 3272742c4fe..3243a6e8e3d 100644 --- a/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts +++ b/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts @@ -1,5 +1,3 @@ -import io.getstream.chat.android.Dependencies - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -19,19 +17,19 @@ android { } dependencies { - detektPlugins(Dependencies.detektFormatting) + detektPlugins(libs.detekt.formatting) - implementation(Dependencies.composeUi) - implementation(Dependencies.composeUiTooling) - implementation(Dependencies.composeFoundation) - implementation(Dependencies.composeMaterial) - implementation(Dependencies.composeMaterialIcons) + implementation(libs.androidx.compose.ui) + implementation(libs.androidx.compose.ui.tooling) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.compose.material.icons.core) - implementation(Dependencies.composeActivity) - implementation(Dependencies.composeAndroidLifecycle) - implementation(Dependencies.composeViewModel) - implementation(Dependencies.composeAccompanistPermissions) - implementation(Dependencies.composeAccompanistPager) + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.lifecycle.runtime.compose) + implementation(libs.androidx.lifecycle.viewmodel.compose) + implementation(libs.google.accompanist.permissions) + implementation(libs.google.accompanist.pager) implementation(project(":stream-chat-android-compose")) } diff --git a/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts index a21d97d0551..20353627d7c 100644 --- a/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts +++ b/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts @@ -1,5 +1,3 @@ -import io.getstream.chat.android.Dependencies - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -17,8 +15,8 @@ android { } dependencies { - detektPlugins(Dependencies.detektFormatting) + detektPlugins(libs.detekt.formatting) - implementation(Dependencies.coroutinesCore) - implementation(Dependencies.androidxAppCompat) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.androidx.appcompat) } diff --git a/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts index 88c3d1474ce..839aadf9f26 100644 --- a/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts +++ b/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts @@ -1,5 +1,3 @@ -import io.getstream.chat.android.Dependencies - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -17,10 +15,10 @@ android { } dependencies { - detektPlugins(Dependencies.detektFormatting) + detektPlugins(libs.detekt.formatting) - implementation(Dependencies.coroutinesCore) - implementation(Dependencies.androidxAppCompat) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.androidx.appcompat) implementation(project(":stream-chat-android-offline")) } diff --git a/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts index 76331c69876..ae0bfb0856d 100644 --- a/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts +++ b/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts @@ -1,5 +1,3 @@ -import io.getstream.chat.android.Dependencies - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -17,8 +15,8 @@ android { } dependencies { - detektPlugins(Dependencies.detektFormatting) + detektPlugins(libs.detekt.formatting) - implementation(Dependencies.coroutinesCore) - implementation(Dependencies.androidxAppCompat) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.androidx.appcompat) } diff --git a/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts index 4960bce1210..cc46663eaba 100644 --- a/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts +++ b/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts @@ -1,5 +1,3 @@ -import io.getstream.chat.android.Dependencies - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -17,10 +15,10 @@ android { } dependencies { - detektPlugins(Dependencies.detektFormatting) + detektPlugins(libs.detekt.formatting) - implementation(Dependencies.coroutinesCore) - implementation(Dependencies.androidxAppCompat) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.androidx.appcompat) implementation(project(":stream-chat-android-ui-components")) } diff --git a/settings.gradle.kts b/settings.gradle.kts index c31a5dd3d0a..6910cb27af9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -67,6 +67,14 @@ include ( ":stream-chat-android-ui-uitests", ":stream-chat-android-benchmark", ":stream-chat-android-ai-assistant", + ":metrics:stream-chat-android-client-metrics-baseline", + ":metrics:stream-chat-android-client-metrics-stream", + ":metrics:stream-chat-android-offline-metrics-baseline", + ":metrics:stream-chat-android-offline-metrics-stream", + ":metrics:stream-chat-android-ui-components-metrics-baseline", + ":metrics:stream-chat-android-ui-components-metrics-stream", + ":metrics:stream-chat-android-compose-metrics-baseline", + ":metrics:stream-chat-android-compose-metrics-stream", ) dependencyResolutionManagement { From 994d4bf20599d409a7554f9dc2b339eb647d17fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 10:40:22 +0000 Subject: [PATCH 05/18] add a single android application project for metrics --- build.gradle.kts | 1 + .../build.gradle.kts | 78 +++++++++++++++++++ .../src/main/AndroidManifest.xml | 33 ++++++++ .../chat/android/metrics/MainActivity.kt | 21 +++++ settings.gradle.kts | 1 + 5 files changed, 134 insertions(+) create mode 100644 metrics/stream-chat-android-metrics/build.gradle.kts create mode 100644 metrics/stream-chat-android-metrics/src/main/AndroidManifest.xml create mode 100644 metrics/stream-chat-android-metrics/src/main/kotlin/io/getstream/chat/android/metrics/MainActivity.kt diff --git a/build.gradle.kts b/build.gradle.kts index 19410166c7e..8b3931f6098 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -95,6 +95,7 @@ apiValidation { "stream-chat-android-test", "stream-chat-android-compose-sample", "stream-chat-android-ui-guides", + "stream-chat-android-metrics", "stream-chat-android-client-metrics-baseline", "stream-chat-android-client-metrics-stream", "stream-chat-android-offline-metrics-baseline", diff --git a/metrics/stream-chat-android-metrics/build.gradle.kts b/metrics/stream-chat-android-metrics/build.gradle.kts new file mode 100644 index 00000000000..2fe76217b7a --- /dev/null +++ b/metrics/stream-chat-android-metrics/build.gradle.kts @@ -0,0 +1,78 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) +} + +apply(from = "$rootDir/scripts/android.gradle") + +android { + namespace = "io.getstream.chat.android.metrics" + buildTypes { + release { + signingConfig = signingConfigs.findByName("debug") + } + } + + flavorDimensions += "sdk" + + productFlavors { + create("clientBaseline") { + dimension = "sdk" + } + create("clientStream") { + dimension = "sdk" + } + create("offlineBaseline") { + dimension = "sdk" + } + create("offlineStream") { + dimension = "sdk" + } + create("composeBaseline") { + dimension = "sdk" + } + create("composeStream") { + dimension = "sdk" + } + create("uiComponentsBaseline") { + dimension = "sdk" + } + create("uiComponentsStream") { + dimension = "sdk" + } + } +} + +afterEvaluate { + android.productFlavors.forEach { flavor -> + val flavorName = flavor.name + // For compose flavors, we apply the compose plugin, + // set up build features and add common compose dependencies. + if (flavorName.startsWith("compose")) { + val composePlugin = libs.plugins.kotlin.compose.get() + plugins.apply(composePlugin.pluginId) + android.buildFeatures.compose = true + val configurationName = "${flavorName}Implementation" + dependencies.add(configurationName, libs.androidx.compose.ui) + dependencies.add(configurationName, libs.androidx.compose.ui.tooling) + dependencies.add(configurationName, libs.androidx.compose.foundation) + dependencies.add(configurationName, libs.androidx.activity.compose) + dependencies.add(configurationName, libs.androidx.lifecycle.runtime.compose) + dependencies.add(configurationName, libs.androidx.lifecycle.viewmodel.compose) + } + } +} + +dependencies { + detektPlugins(libs.detekt.formatting) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.androidx.appcompat) + + "clientStreamImplementation"(project(":stream-chat-android-client")) + + "offlineStreamImplementation"(project(":stream-chat-android-offline")) + + "uiComponentsStreamImplementation"(project(":stream-chat-android-ui-components")) + + "composeStreamImplementation"(project(":stream-chat-android-compose")) +} diff --git a/metrics/stream-chat-android-metrics/src/main/AndroidManifest.xml b/metrics/stream-chat-android-metrics/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..0b34f9b8797 --- /dev/null +++ b/metrics/stream-chat-android-metrics/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + diff --git a/metrics/stream-chat-android-metrics/src/main/kotlin/io/getstream/chat/android/metrics/MainActivity.kt b/metrics/stream-chat-android-metrics/src/main/kotlin/io/getstream/chat/android/metrics/MainActivity.kt new file mode 100644 index 00000000000..a5ecb2c9143 --- /dev/null +++ b/metrics/stream-chat-android-metrics/src/main/kotlin/io/getstream/chat/android/metrics/MainActivity.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.metrics + +import androidx.activity.ComponentActivity + +class MainActivity : ComponentActivity() diff --git a/settings.gradle.kts b/settings.gradle.kts index 6910cb27af9..17c0c973c7e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -67,6 +67,7 @@ include ( ":stream-chat-android-ui-uitests", ":stream-chat-android-benchmark", ":stream-chat-android-ai-assistant", + ":metrics:stream-chat-android-metrics", ":metrics:stream-chat-android-client-metrics-baseline", ":metrics:stream-chat-android-client-metrics-stream", ":metrics:stream-chat-android-offline-metrics-baseline", From f40061a6cc1c75c31514aae72898763ca8e46826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 11:07:20 +0000 Subject: [PATCH 06/18] rename build flavors to simplify logic in the CI script --- .../build.gradle.kts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/metrics/stream-chat-android-metrics/build.gradle.kts b/metrics/stream-chat-android-metrics/build.gradle.kts index 2fe76217b7a..e7661abedeb 100644 --- a/metrics/stream-chat-android-metrics/build.gradle.kts +++ b/metrics/stream-chat-android-metrics/build.gradle.kts @@ -16,28 +16,28 @@ android { flavorDimensions += "sdk" productFlavors { - create("clientBaseline") { + create("stream-chat-android-client-baseline") { dimension = "sdk" } - create("clientStream") { + create("stream-chat-android-client-stream") { dimension = "sdk" } - create("offlineBaseline") { + create("stream-chat-android-offline-baseline") { dimension = "sdk" } - create("offlineStream") { + create("stream-chat-android-offline-stream") { dimension = "sdk" } - create("composeBaseline") { + create("stream-chat-android-compose-baseline") { dimension = "sdk" } - create("composeStream") { + create("stream-chat-android-compose-stream") { dimension = "sdk" } - create("uiComponentsBaseline") { + create("stream-chat-android-ui-components-baseline") { dimension = "sdk" } - create("uiComponentsStream") { + create("stream-chat-android-ui-components-stream") { dimension = "sdk" } } @@ -48,7 +48,7 @@ afterEvaluate { val flavorName = flavor.name // For compose flavors, we apply the compose plugin, // set up build features and add common compose dependencies. - if (flavorName.startsWith("compose")) { + if (flavorName.contains("compose")) { val composePlugin = libs.plugins.kotlin.compose.get() plugins.apply(composePlugin.pluginId) android.buildFeatures.compose = true @@ -68,11 +68,11 @@ dependencies { implementation(libs.kotlinx.coroutines.core) implementation(libs.androidx.appcompat) - "clientStreamImplementation"(project(":stream-chat-android-client")) + "stream-chat-android-client-streamImplementation"(project(":stream-chat-android-client")) - "offlineStreamImplementation"(project(":stream-chat-android-offline")) + "stream-chat-android-offline-streamImplementation"(project(":stream-chat-android-offline")) - "uiComponentsStreamImplementation"(project(":stream-chat-android-ui-components")) + "stream-chat-android-ui-components-streamImplementation"(project(":stream-chat-android-ui-components")) - "composeStreamImplementation"(project(":stream-chat-android-compose")) + "stream-chat-android-compose-streamImplementation"(project(":stream-chat-android-compose")) } From a849498baad18cd44194acc30e26cb846838f0b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 11:07:49 +0000 Subject: [PATCH 07/18] check sizes using the single metrics android project --- .github/workflows/sdk-size-checks.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sdk-size-checks.yml b/.github/workflows/sdk-size-checks.yml index 52bdb026072..0b10cb9ea58 100644 --- a/.github/workflows/sdk-size-checks.yml +++ b/.github/workflows/sdk-size-checks.yml @@ -21,12 +21,8 @@ jobs: with: key-prefix: gradle-build - - name: Assemble SDKs - run: | - for module in $MODULES; do - modules+=" :metrics:$module-metrics-baseline:assembleRelease :metrics:$module-metrics-stream:assembleRelease" - done - ./gradlew $modules + - name: Assemble release for metrics + run: ./gradlew :metrics:stream-chat-android-metrics:assembleRelease - name: Get current SDK sizes run: | @@ -43,8 +39,8 @@ jobs: # Calculate sizes from the .apk files and save them into a temporary JSON file # so it can be exported for the next job step for module in $MODULES; do - baselineFile="metrics/$module-metrics-baseline/build/outputs/apk/release/$module-metrics-baseline-release.apk" - streamFile="metrics/$module-metrics-stream/build/outputs/apk/release/$module-metrics-stream-release.apk" + baselineFile="metrics/stream-chat-android-metrics/build/outputs/apk/$module-baseline/release/stream-chat-android-metrics-$module-baseline-release.apk" + streamFile="metrics/stream-chat-android-metrics/build/outputs/apk/$module-stream/release/stream-chat-android-metrics-$module-stream-release.apk" baselineSize=$(du -k "$baselineFile" | awk '{print $1}') streamSize=$(du -k "$streamFile" | awk '{print $1}') From 59b0e7e65851b8e825c853397cb5102912d92ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 11:21:45 +0000 Subject: [PATCH 08/18] update sizes using the single metrics android project --- .github/workflows/sdk-size-checks.yml | 7 ++++--- .github/workflows/sdk-size-updates.yml | 26 ++++++++++++-------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/sdk-size-checks.yml b/.github/workflows/sdk-size-checks.yml index 0b10cb9ea58..85c67f01e59 100644 --- a/.github/workflows/sdk-size-checks.yml +++ b/.github/workflows/sdk-size-checks.yml @@ -4,6 +4,7 @@ on: pull_request: env: + METRICS_PROJECT: "stream-chat-android-metrics" MODULES: "stream-chat-android-client stream-chat-android-offline stream-chat-android-ui-components stream-chat-android-compose" METRICS_FILE: "metrics/size.json" MAX_TOLERANCE: 500 @@ -22,7 +23,7 @@ jobs: key-prefix: gradle-build - name: Assemble release for metrics - run: ./gradlew :metrics:stream-chat-android-metrics:assembleRelease + run: ./gradlew :metrics:$METRICS_PROJECT:assembleRelease - name: Get current SDK sizes run: | @@ -39,8 +40,8 @@ jobs: # Calculate sizes from the .apk files and save them into a temporary JSON file # so it can be exported for the next job step for module in $MODULES; do - baselineFile="metrics/stream-chat-android-metrics/build/outputs/apk/$module-baseline/release/stream-chat-android-metrics-$module-baseline-release.apk" - streamFile="metrics/stream-chat-android-metrics/build/outputs/apk/$module-stream/release/stream-chat-android-metrics-$module-stream-release.apk" + baselineFile="metrics/$METRICS_PROJECT/build/outputs/apk/$module-baseline/release/$METRICS_PROJECT-$module-baseline-release.apk" + streamFile="metrics/$METRICS_PROJECT/build/outputs/apk/$module-stream/release/$METRICS_PROJECT-$module-stream-release.apk" baselineSize=$(du -k "$baselineFile" | awk '{print $1}') streamSize=$(du -k "$streamFile" | awk '{print $1}') diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index e1716360e62..8052a2c8a45 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -1,17 +1,19 @@ name: SDK size updates on: - push: - branches: - - develop + pull_request: +# push: +# branches: +# - develop workflow_dispatch: -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true +#concurrency: +# group: ${{ github.ref }} +# cancel-in-progress: true env: + METRICS_PROJECT: "stream-chat-android-metrics" MODULES: "stream-chat-android-client stream-chat-android-offline stream-chat-android-ui-components stream-chat-android-compose" VARIANTS: "debug release" METRICS_FILE: "metrics/size.json" @@ -29,12 +31,8 @@ jobs: with: key-prefix: gradle-build - - name: Assemble SDKs - run: | - for module in $MODULES; do - modules+=" :metrics:$module-metrics-baseline:assemble :metrics:$module-metrics-stream:assemble" - done - ./gradlew $modules + - name: Assemble release and debug for metrics + run: ./gradlew :metrics:$METRICS_PROJECT:assemble - name: Update size metrics run: | @@ -44,8 +42,8 @@ jobs: # Calculate sizes for module in $MODULES; do for variant in $VARIANTS; do - baselineFile="metrics/$module-metrics-baseline/build/outputs/apk/$variant/$module-metrics-baseline-$variant.apk" - streamFile="metrics/$module-metrics-stream/build/outputs/apk/$variant/$module-metrics-stream-$variant.apk" + baselineFile="metrics/$METRICS_PROJECT/build/outputs/apk/$module-baseline/$variant/$METRICS_PROJECT-$module-baseline-$variant.apk" + streamFile="metrics/$METRICS_PROJECT/build/outputs/apk/$module-stream/$variant/$METRICS_PROJECT-$module-stream-$variant.apk" # Ensure files exist if [[ -f "$baselineFile" && -f "$streamFile" ]]; then From 628951671c645186c8bf59eabf2aca55728c946b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:30:50 +0000 Subject: [PATCH 09/18] Update SDK size metrics --- metrics/size.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/metrics/size.json b/metrics/size.json index 6881646be6d..5ea05dc55a9 100644 --- a/metrics/size.json +++ b/metrics/size.json @@ -3,12 +3,12 @@ "stream-chat-android-client": 15036, "stream-chat-android-offline": 15336, "stream-chat-android-ui-components": 21028, - "stream-chat-android-compose": 23484 + "stream-chat-android-compose": 22716 }, "release": { - "stream-chat-android-client": 3092, - "stream-chat-android-offline": 3300, - "stream-chat-android-ui-components": 8072, - "stream-chat-android-compose": 9940 + "stream-chat-android-client": 3116, + "stream-chat-android-offline": 3324, + "stream-chat-android-ui-components": 8096, + "stream-chat-android-compose": 9256 } } From a7b6ef3aba18a18e051d801ff82a44ac74a23963 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:30:50 +0000 Subject: [PATCH 10/18] Update SDK size badges --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c3b17f759a6..022978b9ff8 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,10 @@
-![stream-chat-android-client](https://img.shields.io/badge/stream--chat--android--client-3.01%20MB-lightgreen) -![stream-chat-android-offline](https://img.shields.io/badge/stream--chat--android--offline-3.22%20MB-lightgreen) -![stream-chat-android-ui-components](https://img.shields.io/badge/stream--chat--android--ui--components-7.88%20MB-lightgreen) -![stream-chat-android-compose](https://img.shields.io/badge/stream--chat--android--compose-9.70%20MB-lightgreen) +![stream-chat-android-client](https://img.shields.io/badge/stream--chat--android--client-3.04%20MB-lightgreen) +![stream-chat-android-offline](https://img.shields.io/badge/stream--chat--android--offline-3.24%20MB-lightgreen) +![stream-chat-android-ui-components](https://img.shields.io/badge/stream--chat--android--ui--components-7.90%20MB-lightgreen) +![stream-chat-android-compose](https://img.shields.io/badge/stream--chat--android--compose-9.03%20MB-lightgreen)
From 208f32caa86390e3a1b7ac81d8ec7ee4e56f0288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 12:06:25 +0000 Subject: [PATCH 11/18] Remove test setup --- .github/workflows/sdk-size-updates.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index 8052a2c8a45..51567f8ba12 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -1,16 +1,15 @@ name: SDK size updates on: - pull_request: -# push: -# branches: -# - develop + push: + branches: + - develop workflow_dispatch: -#concurrency: -# group: ${{ github.ref }} -# cancel-in-progress: true +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true env: METRICS_PROJECT: "stream-chat-android-metrics" @@ -84,12 +83,7 @@ jobs: git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - # Add and commit updated metrics file - git add $METRICS_FILE - git commit -m "Update SDK size metrics" || echo "No metrics changes to commit" - - # Add and commit updated README file - git add README.md - git commit -m "Update SDK size badges" || echo "No README changes to commit" + git add $METRICS_FILE README.md + git commit -m "Update SDK sizes" || echo "No changes to commit" git push origin HEAD:$BRANCH_NAME From 63995cce3c3b3e5e5dd6470388b1990220c5ee4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 12:41:01 +0000 Subject: [PATCH 12/18] Add a README note for the SDK sizes --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 022978b9ff8..5b39546c876 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ +> **Note:** The SDK sizes reflect the maximum possible addition if none of their internal dependencies are already in your app. In most cases, the actual impact will be smaller. + This is the official Android SDK for [Stream Chat](https://getstream.io/chat/sdk/android/), a service for building chat and messaging applications. This library includes both a low-level chat SDK and a set of reusable UI components. Most users start with the UI components, and fall back to the lower level API when they want to customize things. We're proud to say that we're the first Android Chat SDK that supports Jetpack Compose! We [released](https://github.com/GetStream/stream-chat-android/releases/tag/4.15.0) our Compose UI Components one day after the official Jetpack Compose 1.0 release and our team members have been working hard on it since then. From 891f5f2d9a0ef8cdcf9ce718e99c671fa1b43e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 12:47:52 +0000 Subject: [PATCH 13/18] Use GITHUB_TOKEN instead of the personal token --- .github/workflows/sdk-size-updates.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index 51567f8ba12..61638cb70bd 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -25,6 +25,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + persist-credentials: false - uses: ./.github/actions/setup-java - uses: ./.github/actions/gradle-cache with: From 0b4128e74d1a537c32a485e9e1a5e1754acb14e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 12:48:22 +0000 Subject: [PATCH 14/18] test --- .github/workflows/sdk-size-updates.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index 61638cb70bd..c4417b2beb1 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -1,15 +1,16 @@ name: SDK size updates on: - push: - branches: - - develop + pull-request: +# push: +# branches: +# - develop workflow_dispatch: -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true +#concurrency: +# group: ${{ github.ref }} +# cancel-in-progress: true env: METRICS_PROJECT: "stream-chat-android-metrics" From c7772f13fc15292042bb90d8c51f038c06f82729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 12:49:23 +0000 Subject: [PATCH 15/18] Fix --- .github/workflows/sdk-size-updates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index c4417b2beb1..4de95b8a6a7 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -1,7 +1,7 @@ name: SDK size updates on: - pull-request: + pull_request: # push: # branches: # - develop From d9c0f4ead1309fbcb1fe4f6e757876bb853e531b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 12:59:10 +0000 Subject: [PATCH 16/18] Push changes --- .github/workflows/sdk-size-updates.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index 4de95b8a6a7..fb245966659 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -78,7 +78,7 @@ jobs: sed -i "s|!\[$module\](.*)|![$module](${badgeUrl})|" README.md done - - name: Commit and Push JSON + - name: Commit sizes run: | git fetch origin $BRANCH_NAME git checkout $BRANCH_NAME @@ -89,4 +89,8 @@ jobs: git add $METRICS_FILE README.md git commit -m "Update SDK sizes" || echo "No changes to commit" - git push origin HEAD:$BRANCH_NAME + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }} + branch: ${{ env.BRANCH_NAME }} From e9ae7edbe8fffefd4e153010cf751ff980dfcfbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 13:10:27 +0000 Subject: [PATCH 17/18] Remove multiple metrics modules --- build.gradle.kts | 8 ----- .../build.gradle.kts | 22 ------------ .../src/main/AndroidManifest.xml | 33 ----------------- .../client/metrics/baseline/MainActivity.kt | 21 ----------- .../build.gradle.kts | 24 ------------- .../src/main/AndroidManifest.xml | 33 ----------------- .../client/metrics/stream/MainActivity.kt | 21 ----------- .../build.gradle.kts | 33 ----------------- .../src/main/AndroidManifest.xml | 33 ----------------- .../compose/metrics/baseline/MainActivity.kt | 21 ----------- .../build.gradle.kts | 35 ------------------- .../src/main/AndroidManifest.xml | 33 ----------------- .../compose/metrics/stream/MainActivity.kt | 21 ----------- .../build.gradle.kts | 22 ------------ .../src/main/AndroidManifest.xml | 33 ----------------- .../offline/metrics/baseline/MainActivity.kt | 21 ----------- .../build.gradle.kts | 24 ------------- .../src/main/AndroidManifest.xml | 33 ----------------- .../offline/metrics/stream/MainActivity.kt | 21 ----------- .../build.gradle.kts | 22 ------------ .../src/main/AndroidManifest.xml | 33 ----------------- .../metrics/baseline/MainActivity.kt | 21 ----------- .../build.gradle.kts | 24 ------------- .../src/main/AndroidManifest.xml | 33 ----------------- .../components/metrics/stream/MainActivity.kt | 21 ----------- settings.gradle.kts | 8 ----- 26 files changed, 654 deletions(-) delete mode 100644 metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts delete mode 100644 metrics/stream-chat-android-client-metrics-baseline/src/main/AndroidManifest.xml delete mode 100644 metrics/stream-chat-android-client-metrics-baseline/src/main/kotlin/io/getstream/chat/android/client/metrics/baseline/MainActivity.kt delete mode 100644 metrics/stream-chat-android-client-metrics-stream/build.gradle.kts delete mode 100644 metrics/stream-chat-android-client-metrics-stream/src/main/AndroidManifest.xml delete mode 100644 metrics/stream-chat-android-client-metrics-stream/src/main/kotlin/io/getstream/chat/android/client/metrics/stream/MainActivity.kt delete mode 100644 metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts delete mode 100644 metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml delete mode 100644 metrics/stream-chat-android-compose-metrics-baseline/src/main/kotlin/io/getstream/chat/android/compose/metrics/baseline/MainActivity.kt delete mode 100644 metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts delete mode 100644 metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml delete mode 100644 metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt delete mode 100644 metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts delete mode 100644 metrics/stream-chat-android-offline-metrics-baseline/src/main/AndroidManifest.xml delete mode 100644 metrics/stream-chat-android-offline-metrics-baseline/src/main/kotlin/io/getstream/chat/android/offline/metrics/baseline/MainActivity.kt delete mode 100644 metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts delete mode 100644 metrics/stream-chat-android-offline-metrics-stream/src/main/AndroidManifest.xml delete mode 100644 metrics/stream-chat-android-offline-metrics-stream/src/main/kotlin/io/getstream/chat/android/offline/metrics/stream/MainActivity.kt delete mode 100644 metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts delete mode 100644 metrics/stream-chat-android-ui-components-metrics-baseline/src/main/AndroidManifest.xml delete mode 100644 metrics/stream-chat-android-ui-components-metrics-baseline/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/baseline/MainActivity.kt delete mode 100644 metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts delete mode 100644 metrics/stream-chat-android-ui-components-metrics-stream/src/main/AndroidManifest.xml delete mode 100644 metrics/stream-chat-android-ui-components-metrics-stream/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/stream/MainActivity.kt diff --git a/build.gradle.kts b/build.gradle.kts index 8b3931f6098..6fe20b66dd8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -96,14 +96,6 @@ apiValidation { "stream-chat-android-compose-sample", "stream-chat-android-ui-guides", "stream-chat-android-metrics", - "stream-chat-android-client-metrics-baseline", - "stream-chat-android-client-metrics-stream", - "stream-chat-android-offline-metrics-baseline", - "stream-chat-android-offline-metrics-stream", - "stream-chat-android-ui-components-metrics-baseline", - "stream-chat-android-ui-components-metrics-stream", - "stream-chat-android-compose-metrics-baseline", - "stream-chat-android-compose-metrics-stream", ) nonPublicMarkers += listOf( diff --git a/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts deleted file mode 100644 index f6eb35614cc..00000000000 --- a/metrics/stream-chat-android-client-metrics-baseline/build.gradle.kts +++ /dev/null @@ -1,22 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") -} - -apply(from = "$rootDir/scripts/android.gradle") - -android { - namespace = "io.getstream.chat.android.client.metrics.baseline" - buildTypes { - release { - signingConfig = signingConfigs.findByName("debug") - } - } -} - -dependencies { - detektPlugins(libs.detekt.formatting) - - implementation(libs.kotlinx.coroutines.core) - implementation(libs.androidx.appcompat) -} diff --git a/metrics/stream-chat-android-client-metrics-baseline/src/main/AndroidManifest.xml b/metrics/stream-chat-android-client-metrics-baseline/src/main/AndroidManifest.xml deleted file mode 100644 index 0b34f9b8797..00000000000 --- a/metrics/stream-chat-android-client-metrics-baseline/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/metrics/stream-chat-android-client-metrics-baseline/src/main/kotlin/io/getstream/chat/android/client/metrics/baseline/MainActivity.kt b/metrics/stream-chat-android-client-metrics-baseline/src/main/kotlin/io/getstream/chat/android/client/metrics/baseline/MainActivity.kt deleted file mode 100644 index e18cd699e70..00000000000 --- a/metrics/stream-chat-android-client-metrics-baseline/src/main/kotlin/io/getstream/chat/android/client/metrics/baseline/MainActivity.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.chat.android.client.metrics.baseline - -import androidx.activity.ComponentActivity - -class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts deleted file mode 100644 index 021d07ebc51..00000000000 --- a/metrics/stream-chat-android-client-metrics-stream/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") -} - -apply(from = "$rootDir/scripts/android.gradle") - -android { - namespace = "io.getstream.chat.android.client.metrics.stream" - buildTypes { - release { - signingConfig = signingConfigs.findByName("debug") - } - } -} - -dependencies { - detektPlugins(libs.detekt.formatting) - - implementation(libs.kotlinx.coroutines.core) - implementation(libs.androidx.appcompat) - - implementation(project(":stream-chat-android-client")) -} diff --git a/metrics/stream-chat-android-client-metrics-stream/src/main/AndroidManifest.xml b/metrics/stream-chat-android-client-metrics-stream/src/main/AndroidManifest.xml deleted file mode 100644 index 0b34f9b8797..00000000000 --- a/metrics/stream-chat-android-client-metrics-stream/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/metrics/stream-chat-android-client-metrics-stream/src/main/kotlin/io/getstream/chat/android/client/metrics/stream/MainActivity.kt b/metrics/stream-chat-android-client-metrics-stream/src/main/kotlin/io/getstream/chat/android/client/metrics/stream/MainActivity.kt deleted file mode 100644 index 5439ca4bbdd..00000000000 --- a/metrics/stream-chat-android-client-metrics-stream/src/main/kotlin/io/getstream/chat/android/client/metrics/stream/MainActivity.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.chat.android.client.metrics.stream - -import androidx.activity.ComponentActivity - -class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts deleted file mode 100644 index 1a037af4369..00000000000 --- a/metrics/stream-chat-android-compose-metrics-baseline/build.gradle.kts +++ /dev/null @@ -1,33 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") -} - -apply(from = "$rootDir/scripts/android.gradle") - -android { - namespace = "io.getstream.chat.android.compose.metrics.baseline" - buildFeatures.compose = true - buildTypes { - release { - signingConfig = signingConfigs.findByName("debug") - } - } -} - -dependencies { - detektPlugins(libs.detekt.formatting) - - implementation(libs.androidx.compose.ui) - implementation(libs.androidx.compose.ui.tooling) - implementation(libs.androidx.compose.foundation) - implementation(libs.androidx.compose.material) - implementation(libs.androidx.compose.material.icons.core) - - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.runtime.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - implementation(libs.google.accompanist.permissions) - implementation(libs.google.accompanist.pager) -} diff --git a/metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml b/metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml deleted file mode 100644 index 0b34f9b8797..00000000000 --- a/metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/metrics/stream-chat-android-compose-metrics-baseline/src/main/kotlin/io/getstream/chat/android/compose/metrics/baseline/MainActivity.kt b/metrics/stream-chat-android-compose-metrics-baseline/src/main/kotlin/io/getstream/chat/android/compose/metrics/baseline/MainActivity.kt deleted file mode 100644 index 9f61eef3f4a..00000000000 --- a/metrics/stream-chat-android-compose-metrics-baseline/src/main/kotlin/io/getstream/chat/android/compose/metrics/baseline/MainActivity.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.chat.android.compose.metrics.baseline - -import androidx.activity.ComponentActivity - -class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts deleted file mode 100644 index 3243a6e8e3d..00000000000 --- a/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") -} - -apply(from = "$rootDir/scripts/android.gradle") - -android { - namespace = "io.getstream.chat.android.compose.metrics.stream" - buildFeatures.compose = true - buildTypes { - release { - signingConfig = signingConfigs.findByName("debug") - } - } -} - -dependencies { - detektPlugins(libs.detekt.formatting) - - implementation(libs.androidx.compose.ui) - implementation(libs.androidx.compose.ui.tooling) - implementation(libs.androidx.compose.foundation) - implementation(libs.androidx.compose.material) - implementation(libs.androidx.compose.material.icons.core) - - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.runtime.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - implementation(libs.google.accompanist.permissions) - implementation(libs.google.accompanist.pager) - - implementation(project(":stream-chat-android-compose")) -} diff --git a/metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml b/metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml deleted file mode 100644 index 0b34f9b8797..00000000000 --- a/metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt b/metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt deleted file mode 100644 index 7e9bf936ed9..00000000000 --- a/metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.chat.android.compose.metrics.stream - -import androidx.activity.ComponentActivity - -class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts deleted file mode 100644 index 20353627d7c..00000000000 --- a/metrics/stream-chat-android-offline-metrics-baseline/build.gradle.kts +++ /dev/null @@ -1,22 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") -} - -apply(from = "$rootDir/scripts/android.gradle") - -android { - namespace = "io.getstream.chat.android.offline.metrics.baseline" - buildTypes { - release { - signingConfig = signingConfigs.findByName("debug") - } - } -} - -dependencies { - detektPlugins(libs.detekt.formatting) - - implementation(libs.kotlinx.coroutines.core) - implementation(libs.androidx.appcompat) -} diff --git a/metrics/stream-chat-android-offline-metrics-baseline/src/main/AndroidManifest.xml b/metrics/stream-chat-android-offline-metrics-baseline/src/main/AndroidManifest.xml deleted file mode 100644 index 0b34f9b8797..00000000000 --- a/metrics/stream-chat-android-offline-metrics-baseline/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/metrics/stream-chat-android-offline-metrics-baseline/src/main/kotlin/io/getstream/chat/android/offline/metrics/baseline/MainActivity.kt b/metrics/stream-chat-android-offline-metrics-baseline/src/main/kotlin/io/getstream/chat/android/offline/metrics/baseline/MainActivity.kt deleted file mode 100644 index 0e63ac5b550..00000000000 --- a/metrics/stream-chat-android-offline-metrics-baseline/src/main/kotlin/io/getstream/chat/android/offline/metrics/baseline/MainActivity.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.chat.android.offline.metrics.baseline - -import androidx.activity.ComponentActivity - -class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts deleted file mode 100644 index 839aadf9f26..00000000000 --- a/metrics/stream-chat-android-offline-metrics-stream/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") -} - -apply(from = "$rootDir/scripts/android.gradle") - -android { - namespace = "io.getstream.chat.android.offline.metrics.baseline" - buildTypes { - release { - signingConfig = signingConfigs.findByName("debug") - } - } -} - -dependencies { - detektPlugins(libs.detekt.formatting) - - implementation(libs.kotlinx.coroutines.core) - implementation(libs.androidx.appcompat) - - implementation(project(":stream-chat-android-offline")) -} diff --git a/metrics/stream-chat-android-offline-metrics-stream/src/main/AndroidManifest.xml b/metrics/stream-chat-android-offline-metrics-stream/src/main/AndroidManifest.xml deleted file mode 100644 index 0b34f9b8797..00000000000 --- a/metrics/stream-chat-android-offline-metrics-stream/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/metrics/stream-chat-android-offline-metrics-stream/src/main/kotlin/io/getstream/chat/android/offline/metrics/stream/MainActivity.kt b/metrics/stream-chat-android-offline-metrics-stream/src/main/kotlin/io/getstream/chat/android/offline/metrics/stream/MainActivity.kt deleted file mode 100644 index 5b2df008d32..00000000000 --- a/metrics/stream-chat-android-offline-metrics-stream/src/main/kotlin/io/getstream/chat/android/offline/metrics/stream/MainActivity.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.chat.android.offline.metrics.stream - -import androidx.activity.ComponentActivity - -class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts b/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts deleted file mode 100644 index ae0bfb0856d..00000000000 --- a/metrics/stream-chat-android-ui-components-metrics-baseline/build.gradle.kts +++ /dev/null @@ -1,22 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") -} - -apply(from = "$rootDir/scripts/android.gradle") - -android { - namespace = "io.getstream.chat.android.ui.components.metrics.baseline" - buildTypes { - release { - signingConfig = signingConfigs.findByName("debug") - } - } -} - -dependencies { - detektPlugins(libs.detekt.formatting) - - implementation(libs.kotlinx.coroutines.core) - implementation(libs.androidx.appcompat) -} diff --git a/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/AndroidManifest.xml b/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/AndroidManifest.xml deleted file mode 100644 index 0b34f9b8797..00000000000 --- a/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/baseline/MainActivity.kt b/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/baseline/MainActivity.kt deleted file mode 100644 index 2f5e2095fae..00000000000 --- a/metrics/stream-chat-android-ui-components-metrics-baseline/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/baseline/MainActivity.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.chat.android.ui.components.metrics.baseline - -import androidx.activity.ComponentActivity - -class MainActivity : ComponentActivity() diff --git a/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts b/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts deleted file mode 100644 index cc46663eaba..00000000000 --- a/metrics/stream-chat-android-ui-components-metrics-stream/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") -} - -apply(from = "$rootDir/scripts/android.gradle") - -android { - namespace = "io.getstream.chat.android.ui.components.metrics.stream" - buildTypes { - release { - signingConfig = signingConfigs.findByName("debug") - } - } -} - -dependencies { - detektPlugins(libs.detekt.formatting) - - implementation(libs.kotlinx.coroutines.core) - implementation(libs.androidx.appcompat) - - implementation(project(":stream-chat-android-ui-components")) -} diff --git a/metrics/stream-chat-android-ui-components-metrics-stream/src/main/AndroidManifest.xml b/metrics/stream-chat-android-ui-components-metrics-stream/src/main/AndroidManifest.xml deleted file mode 100644 index 0b34f9b8797..00000000000 --- a/metrics/stream-chat-android-ui-components-metrics-stream/src/main/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/metrics/stream-chat-android-ui-components-metrics-stream/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/stream/MainActivity.kt b/metrics/stream-chat-android-ui-components-metrics-stream/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/stream/MainActivity.kt deleted file mode 100644 index 1737f1141b7..00000000000 --- a/metrics/stream-chat-android-ui-components-metrics-stream/src/main/kotlin/io/getstream/chat/android/ui/components/metrics/stream/MainActivity.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2014-2024 Stream.io Inc. All rights reserved. - * - * Licensed under the Stream License; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getstream.chat.android.ui.components.metrics.stream - -import androidx.activity.ComponentActivity - -class MainActivity : ComponentActivity() diff --git a/settings.gradle.kts b/settings.gradle.kts index 17c0c973c7e..ec1e49f2816 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -68,14 +68,6 @@ include ( ":stream-chat-android-benchmark", ":stream-chat-android-ai-assistant", ":metrics:stream-chat-android-metrics", - ":metrics:stream-chat-android-client-metrics-baseline", - ":metrics:stream-chat-android-client-metrics-stream", - ":metrics:stream-chat-android-offline-metrics-baseline", - ":metrics:stream-chat-android-offline-metrics-stream", - ":metrics:stream-chat-android-ui-components-metrics-baseline", - ":metrics:stream-chat-android-ui-components-metrics-stream", - ":metrics:stream-chat-android-compose-metrics-baseline", - ":metrics:stream-chat-android-compose-metrics-stream", ) dependencyResolutionManagement { From e9d2e587fbb8cd540d01693158c4278fb7af95f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mion?= Date: Thu, 2 Jan 2025 13:11:36 +0000 Subject: [PATCH 18/18] Remove test setup --- .github/workflows/sdk-size-updates.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index fb245966659..aa6914d1dd2 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -1,16 +1,15 @@ name: SDK size updates on: - pull_request: -# push: -# branches: -# - develop + push: + branches: + - develop workflow_dispatch: -#concurrency: -# group: ${{ github.ref }} -# cancel-in-progress: true +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true env: METRICS_PROJECT: "stream-chat-android-metrics" @@ -78,7 +77,7 @@ jobs: sed -i "s|!\[$module\](.*)|![$module](${badgeUrl})|" README.md done - - name: Commit sizes + - name: Commit changes run: | git fetch origin $BRANCH_NAME git checkout $BRANCH_NAME