Skip to content

Commit

Permalink
Merge pull request #320 from hossain-khan/319-debug-build-variants
Browse files Browse the repository at this point in the history
[ADDED] Product flavour to have debug vs prod build
  • Loading branch information
hossain-khan authored Feb 8, 2025
2 parents c62be69 + 53f4e3a commit 8b183cf
Show file tree
Hide file tree
Showing 21 changed files with 208 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: ./gradlew lintKotlin --parallel --daemon

- name: Run test
run: ./gradlew testDebugUnitTest --parallel --daemon
run: ./gradlew testInternalDebugUnitTest --parallel --daemon

- name: Build with Gradle
run: ./gradlew assembleDebug --parallel --daemon
2 changes: 1 addition & 1 deletion .github/workflows/kover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# - app/build/reports/kover/htmlDebug/index.html
# - app/build/reports/kover/reportDebug.xml
- name: Build and run tests
run: ./gradlew koverHtmlReportDebug koverXmlReportDebug
run: ./gradlew koverHtmlReportInternalDebug koverXmlReportInternalDebug

# https://github.com/actions/upload-artifact
- name: Upload Kover report
Expand Down
17 changes: 16 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ android {
}
}

// https://developer.android.com/build/build-variants
buildTypes {
release {
isMinifyEnabled = false
Expand All @@ -86,6 +87,20 @@ android {
}
}

// Creates flavor to have separate Application ID to install side-by-side.
// https://developer.android.com/build/build-variants#product-flavors
flavorDimensions += "appflavor"
productFlavors {
create("internal") {
dimension = "appflavor"
applicationIdSuffix = ".internal"
versionNameSuffix = "-internal"
}
create("prod") {
dimension = "appflavor"
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -138,7 +153,7 @@ kover {
}
}

variant("release") {
variant("prodRelease") {
// verification only for 'release' build variant
verify {
rule {
Expand Down
67 changes: 67 additions & 0 deletions app/src/internal/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"project_info": {
"project_number": "510701824725",
"project_id": "weather-alert-android",
"storage_bucket": "weather-alert-android.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:510701824725:android:3117d8d925e9b6504c905c",
"android_client_info": {
"package_name": "dev.hossain.weatheralert"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBQ6oIaBqba5A1wB8cgZujiHHmzx62HR28"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:510701824725:android:f036a9643a7750934c905c",
"android_client_info": {
"package_name": "dev.hossain.weatheralert.debug"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBQ6oIaBqba5A1wB8cgZujiHHmzx62HR28"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:510701824725:android:4d80395ceb23cb3d4c905c",
"android_client_info": {
"package_name": "dev.hossain.weatheralert.internal"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBQ6oIaBqba5A1wB8cgZujiHHmzx62HR28"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
54 changes: 54 additions & 0 deletions app/src/internal/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group android:scaleX="0.44"
android:scaleY="0.44"
android:translateX="6.72"
android:translateY="6.72">

<path
android:fillColor="#4382ff"
android:pathData="m14.967,15.304c3.2,0 6,-2.41 6,-5.5 0,-3.09 -2.6,-5.5 -5.8,-5.5 -3.2,0 -5.8,2.41 -5.8,5.5 -0.6,-1.45 -2.4,-2.51 -4.2,-2.51 -2.3,0 -4.2,1.74 -4.2,3.96 0,2.22 1.7,4.05 4,4.05" />

<path
android:fillColor="#8fe4ff"
android:fillType="evenOdd"
android:pathData="m9.428,14.51c-0.595,0 -1.062,0.3 -1.269,0.789 -0.215,0.509 -0.801,0.747 -1.31,0.532 -0.509,-0.215 -0.747,-0.801 -0.532,-1.31 0.554,-1.311 1.806,-2.011 3.111,-2.011 1.927,0 3.38,1.594 3.38,3.5 0,1.906 -1.453,3.5 -3.38,3.5h-7.62c-0.552,0 -1,-0.448 -1,-1 0,-0.552 0.448,-1 1,-1h7.62c0.733,0 1.38,-0.606 1.38,-1.5 0,-0.894 -0.647,-1.5 -1.38,-1.5z" />

<path
android:fillColor="#8fe4ff"
android:fillType="evenOdd"
android:pathData="m15.998,18.43c-0.538,0 -1.061,0.354 -1.287,0.829 -0.237,0.499 -0.834,0.711 -1.332,0.474 -0.499,-0.237 -0.711,-0.834 -0.474,-1.332 0.534,-1.125 1.731,-1.971 3.093,-1.971 1.927,0 3.38,1.594 3.38,3.5 0,1.906 -1.453,3.5 -3.38,3.5H5.378c-0.552,0 -1,-0.448 -1,-1 0,-0.552 0.448,-1 1,-1H15.998c0.733,0 1.38,-0.606 1.38,-1.5 0,-0.894 -0.647,-1.5 -1.38,-1.5z" />

<path
android:fillColor="#DD427EF5"
android:pathData="m18.146,10.914c2.761,0 5,-2.239 5,-5 0,-2.761 -2.239,-5 -5,-5 -2.761,0 -5,2.239 -5,5 0,2.761 2.239,5 5,5z"
android:strokeWidth="1"
android:strokeColor="#E2E43425"
android:strokeLineCap="round"
android:strokeLineJoin="round" />

<path
android:fillColor="#00000000"
android:pathData="m18.146,2.914v3"
android:strokeWidth="1"
android:strokeColor="#E2E43425"
android:strokeLineJoin="round" />

<path
android:fillColor="#00000000"
android:pathData="m18.146,7.914h0.01"
android:strokeWidth="1"
android:strokeColor="#E2E43425"
android:strokeLineCap="round"
android:strokeLineJoin="round" />

<!-- Debug badge -->
<path
android:fillColor="#FF9800"
android:pathData="M3,2 A1,1 0 1,1 3,1.999 Z" />

</group>
</vector>
49 changes: 49 additions & 0 deletions app/src/internal/res/drawable/weather_alert_icon_internal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#4382ff"
android:pathData="m14.967,15.304c3.2,0 6,-2.41 6,-5.5 0,-3.09 -2.6,-5.5 -5.8,-5.5 -3.2,0 -5.8,2.41 -5.8,5.5 -0.6,-1.45 -2.4,-2.51 -4.2,-2.51 -2.3,0 -4.2,1.74 -4.2,3.96 0,2.22 1.7,4.05 4,4.05" />

<path
android:fillColor="#8fe4ff"
android:fillType="evenOdd"
android:pathData="m9.428,14.51c-0.595,0 -1.062,0.3 -1.269,0.789 -0.215,0.509 -0.801,0.747 -1.31,0.532 -0.509,-0.215 -0.747,-0.801 -0.532,-1.31 0.554,-1.311 1.806,-2.011 3.111,-2.011 1.927,0 3.38,1.594 3.38,3.5 0,1.906 -1.453,3.5 -3.38,3.5h-7.62c-0.552,0 -1,-0.448 -1,-1 0,-0.552 0.448,-1 1,-1h7.62c0.733,0 1.38,-0.606 1.38,-1.5 0,-0.894 -0.647,-1.5 -1.38,-1.5z" />

<path
android:fillColor="#8fe4ff"
android:fillType="evenOdd"
android:pathData="m15.998,18.43c-0.538,0 -1.061,0.354 -1.287,0.829 -0.237,0.499 -0.834,0.711 -1.332,0.474 -0.499,-0.237 -0.711,-0.834 -0.474,-1.332 0.534,-1.125 1.731,-1.971 3.093,-1.971 1.927,0 3.38,1.594 3.38,3.5 0,1.906 -1.453,3.5 -3.38,3.5H5.378c-0.552,0 -1,-0.448 -1,-1 0,-0.552 0.448,-1 1,-1H15.998c0.733,0 1.38,-0.606 1.38,-1.5 0,-0.894 -0.647,-1.5 -1.38,-1.5z" />

<path
android:fillColor="#DD427EF5"
android:pathData="m18.146,10.914c2.761,0 5,-2.239 5,-5 0,-2.761 -2.239,-5 -5,-5 -2.761,0 -5,2.239 -5,5 0,2.761 2.239,5 5,5z"
android:strokeWidth="1"
android:strokeColor="#E2E43425"
android:strokeLineCap="round"
android:strokeLineJoin="round" />

<path
android:fillColor="#00000000"
android:pathData="m18.146,2.914v3"
android:strokeWidth="1"
android:strokeColor="#E2E43425"
android:strokeLineJoin="round" />

<path
android:fillColor="#00000000"
android:pathData="m18.146,7.914h0.01"
android:strokeWidth="1"
android:strokeColor="#E2E43425"
android:strokeLineCap="round"
android:strokeLineJoin="round" />

<!-- Debug badge -->
<path
android:fillColor="#FF9800"
android:pathData="M3,2 A1,1 0 1,1 3,1.999 Z" />

</vector>
5 changes: 5 additions & 0 deletions app/src/internal/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
5 changes: 5 additions & 0 deletions app/src/internal/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Binary file added app/src/internal/res/mipmap-hdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file added app/src/internal/res/mipmap-mdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions app/src/internal/res/values/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#3206B9</color>
</resources>
4 changes: 4 additions & 0 deletions app/src/internal/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Weather Alert - Internal</string>
</resources>
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:name=".WeatherAlertApp"
android:appComponentFactory=".di.WeatherAlertAppComponentFactory"
android:name="dev.hossain.weatheralert.WeatherAlertApp"
android:appComponentFactory="dev.hossain.weatheralert.di.WeatherAlertAppComponentFactory"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand Down

0 comments on commit 8b183cf

Please sign in to comment.