diff --git a/.github/workflows/sdk-size-checks.yml b/.github/workflows/sdk-size-checks.yml index 34a623865c9..fb8629d1d40 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-baseline:assemble :metrics:$module-stream:assemble" + modules+=" :metrics:$module-metrics-baseline:assemble :metrics:$module-metrics-stream:assemble" done ./gradlew $modules @@ -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-baseline/build/outputs/apk/debug/$module-baseline-debug.apk" - streamFile="metrics/$module-stream/build/outputs/apk/debug/$module-stream-debug.apk" + 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}') diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index 7f5e155ba17..2cc0f95956d 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -33,7 +33,7 @@ jobs: - name: Assemble SDKs run: | for module in $MODULES; do - modules+=" :metrics:$module-baseline:assemble :metrics:$module-stream:assemble" + modules+=" :metrics:$module-metrics-baseline:assemble :metrics:$module-metrics-stream:assemble" done ./gradlew $modules @@ -45,8 +45,8 @@ jobs: # Calculate sizes for module in $MODULES; do for variant in $VARIANTS; do - baselineFile="metrics/$module-baseline/build/outputs/apk/$variant/$module-baseline-$variant.apk" - streamFile="metrics/$module-stream/build/outputs/apk/$variant/$module-stream-$variant.apk" + 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 diff --git a/build.gradle b/build.gradle index 51bb7230cba..3f4888d85a0 100644 --- a/build.gradle +++ b/build.gradle @@ -127,8 +127,8 @@ apiValidation { 'stream-chat-android-test', 'stream-chat-android-compose-sample', 'stream-chat-android-ui-guides', - 'stream-chat-android-compose-baseline', - 'stream-chat-android-compose-stream', + 'stream-chat-android-compose-metrics-baseline', + 'stream-chat-android-compose-metrics-stream', ] nonPublicMarkers += [ 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-baseline/src/main/AndroidManifest.xml b/metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml similarity index 100% rename from metrics/stream-chat-android-compose-baseline/src/main/AndroidManifest.xml rename to metrics/stream-chat-android-compose-metrics-baseline/src/main/AndroidManifest.xml 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-baseline/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/metrics/stream-chat-android-compose-metrics-baseline/src/main/res/mipmap-xxxhdpi/ic_launcher.webp similarity index 100% rename from metrics/stream-chat-android-compose-baseline/src/main/res/mipmap-xxxhdpi/ic_launcher.webp rename to metrics/stream-chat-android-compose-metrics-baseline/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/metrics/stream-chat-android-compose-baseline/src/main/res/values/strings.xml b/metrics/stream-chat-android-compose-metrics-baseline/src/main/res/values/strings.xml similarity index 100% rename from metrics/stream-chat-android-compose-baseline/src/main/res/values/strings.xml rename to metrics/stream-chat-android-compose-metrics-baseline/src/main/res/values/strings.xml diff --git a/metrics/stream-chat-android-compose-stream/build.gradle.kts b/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts similarity index 93% rename from metrics/stream-chat-android-compose-stream/build.gradle.kts rename to metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts index 656d5a34b77..3272742c4fe 100644 --- a/metrics/stream-chat-android-compose-stream/build.gradle.kts +++ b/metrics/stream-chat-android-compose-metrics-stream/build.gradle.kts @@ -9,7 +9,7 @@ plugins { apply(from = "$rootDir/scripts/android.gradle") android { - namespace = "io.getstream.metrics.compose.stream" + namespace = "io.getstream.chat.android.compose.metrics.stream" buildFeatures.compose = true buildTypes { release { diff --git a/metrics/stream-chat-android-compose-stream/src/main/AndroidManifest.xml b/metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml similarity index 100% rename from metrics/stream-chat-android-compose-stream/src/main/AndroidManifest.xml rename to metrics/stream-chat-android-compose-metrics-stream/src/main/AndroidManifest.xml diff --git a/metrics/stream-chat-android-compose-baseline/src/main/kotlin/io/getstream/metrics/compose/baseline/MainActivity.kt b/metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt similarity index 92% rename from metrics/stream-chat-android-compose-baseline/src/main/kotlin/io/getstream/metrics/compose/baseline/MainActivity.kt rename to metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt index 48717d68e21..7e9bf936ed9 100644 --- a/metrics/stream-chat-android-compose-baseline/src/main/kotlin/io/getstream/metrics/compose/baseline/MainActivity.kt +++ b/metrics/stream-chat-android-compose-metrics-stream/src/main/kotlin/io/getstream/chat/android/compose/metrics/stream/MainActivity.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.getstream.metrics.compose.baseline +package io.getstream.chat.android.compose.metrics.stream import androidx.activity.ComponentActivity diff --git a/metrics/stream-chat-android-compose-stream/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/metrics/stream-chat-android-compose-metrics-stream/src/main/res/mipmap-xxxhdpi/ic_launcher.webp similarity index 100% rename from metrics/stream-chat-android-compose-stream/src/main/res/mipmap-xxxhdpi/ic_launcher.webp rename to metrics/stream-chat-android-compose-metrics-stream/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/metrics/stream-chat-android-compose-stream/src/main/res/values/strings.xml b/metrics/stream-chat-android-compose-metrics-stream/src/main/res/values/strings.xml similarity index 100% rename from metrics/stream-chat-android-compose-stream/src/main/res/values/strings.xml rename to metrics/stream-chat-android-compose-metrics-stream/src/main/res/values/strings.xml diff --git a/settings.gradle b/settings.gradle index c3eace98dbb..eb74f384672 100644 --- a/settings.gradle +++ b/settings.gradle @@ -23,8 +23,8 @@ include ( ':stream-chat-android-ui-uitests', ':stream-chat-android-benchmark', ':stream-chat-android-ai-assistant', - ':metrics:stream-chat-android-compose-baseline', - ':metrics:stream-chat-android-compose-stream' + ':metrics:stream-chat-android-compose-metrics-baseline', + ':metrics:stream-chat-android-compose-metrics-stream' ) dependencyResolutionManagement {