Aggiunge il flavor Android collaudo installabile accanto all'app di produzione.
Usa un applicationId distinto, icona con fascia gialla e API su collaudo.matchlivetv.it. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -30,6 +30,7 @@ android {
|
||||
val apiBaseUrl = project.findProperty("API_BASE_URL") as String?
|
||||
?: "https://www.matchlivetv.it"
|
||||
buildConfigField("String", "API_BASE_URL", "\"$apiBaseUrl\"")
|
||||
buildConfigField("boolean", "IS_COLLAUDO", "false")
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
// Anche in defaultConfig: AGP estrae simboli se le .so non sono già stripped.
|
||||
@@ -38,6 +39,23 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions += "env"
|
||||
productFlavors {
|
||||
create("prod") {
|
||||
dimension = "env"
|
||||
isDefault = true
|
||||
}
|
||||
create("collaudo") {
|
||||
dimension = "env"
|
||||
applicationId = "com.matchlivetv.match_live_tv.collaudo"
|
||||
versionNameSuffix = "-collaudo"
|
||||
val collaudoApi = project.findProperty("API_BASE_URL") as String?
|
||||
?: "https://collaudo.matchlivetv.it"
|
||||
buildConfigField("String", "API_BASE_URL", "\"$collaudoApi\"")
|
||||
buildConfigField("boolean", "IS_COLLAUDO", "true")
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
create("release") {
|
||||
@@ -138,31 +156,31 @@ fun findLlvmObjcopy(): File {
|
||||
|
||||
val injectNativeDebugSymbolsInReleaseBundle by tasks.registering {
|
||||
description = "Embed native-debug-symbols.zip (.so.sym) into the release AAB intermediary"
|
||||
val mergeNative = tasks.named("mergeReleaseNativeLibs")
|
||||
val packageBundle = tasks.named("packageReleaseBundle")
|
||||
val mergeNative = tasks.named("mergeProdReleaseNativeLibs")
|
||||
val packageBundle = tasks.named("packageProdReleaseBundle")
|
||||
dependsOn(mergeNative, packageBundle)
|
||||
inputs.dir(
|
||||
layout.buildDirectory.dir(
|
||||
"intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib",
|
||||
"intermediates/merged_native_libs/prodRelease/mergeProdReleaseNativeLibs/out/lib",
|
||||
),
|
||||
)
|
||||
inputs.file(
|
||||
layout.buildDirectory.file(
|
||||
"intermediates/intermediary_bundle/release/packageReleaseBundle/intermediary-bundle.aab",
|
||||
"intermediates/intermediary_bundle/prodRelease/packageProdReleaseBundle/intermediary-bundle.aab",
|
||||
),
|
||||
)
|
||||
outputs.file(
|
||||
layout.buildDirectory.file(
|
||||
"intermediates/intermediary_bundle/release/packageReleaseBundle/intermediary-bundle.aab",
|
||||
"intermediates/intermediary_bundle/prodRelease/packageProdReleaseBundle/intermediary-bundle.aab",
|
||||
),
|
||||
)
|
||||
doLast {
|
||||
val libsDir = layout.buildDirectory
|
||||
.dir("intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib")
|
||||
.dir("intermediates/merged_native_libs/prodRelease/mergeProdReleaseNativeLibs/out/lib")
|
||||
.get()
|
||||
.asFile
|
||||
val aabFile = layout.buildDirectory
|
||||
.file("intermediates/intermediary_bundle/release/packageReleaseBundle/intermediary-bundle.aab")
|
||||
.file("intermediates/intermediary_bundle/prodRelease/packageProdReleaseBundle/intermediary-bundle.aab")
|
||||
.get()
|
||||
.asFile
|
||||
require(libsDir.isDirectory) { "Native libs missing: $libsDir" }
|
||||
@@ -234,6 +252,6 @@ val injectNativeDebugSymbolsInReleaseBundle by tasks.registering {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.matching { it.name == "signReleaseBundle" }.configureEach {
|
||||
tasks.matching { it.name == "signProdReleaseBundle" }.configureEach {
|
||||
dependsOn(injectNativeDebugSymbolsInReleaseBundle)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application>
|
||||
<activity android:name=".MainActivity">
|
||||
<intent-filter android:autoVerify="true">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="collaudo.matchlivetv.it"
|
||||
android:pathPrefix="/join" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Match Live TV Collaudo</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Match Live TV Collaudo</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Match Live TV Collaudo</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Match Live TV Collaudo</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Match Live TV Collaudo</string>
|
||||
</resources>
|
||||
+19
@@ -1,5 +1,6 @@
|
||||
package com.matchlivetv.match_live_tv.ui.login
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
@@ -7,6 +8,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
@@ -31,6 +33,7 @@ import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.focus.FocusDirection
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalFocusManager
|
||||
@@ -38,6 +41,7 @@ import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.semantics.testTagsAsResourceId
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||
@@ -45,6 +49,7 @@ import androidx.compose.ui.text.input.VisualTransformation
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextDecoration
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.matchlivetv.match_live_tv.BuildConfig
|
||||
import com.matchlivetv.match_live_tv.R
|
||||
import com.matchlivetv.match_live_tv.data.AppContainer
|
||||
import com.matchlivetv.match_live_tv.ui.components.LanguagePickerDialog
|
||||
@@ -122,6 +127,20 @@ fun LoginScreen(
|
||||
.padding(horizontal = 24.dp, vertical = 16.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
if (BuildConfig.IS_COLLAUDO) {
|
||||
Text(
|
||||
text = stringResource(R.string.collaudo_banner),
|
||||
color = Color.Black,
|
||||
fontWeight = FontWeight.Bold,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.background(MatchColors.AccentYellow)
|
||||
.padding(vertical = 8.dp),
|
||||
)
|
||||
Spacer(Modifier.height(16.dp))
|
||||
}
|
||||
MatchLiveWordmark(showSlogan = true)
|
||||
Spacer(Modifier.height(48.dp))
|
||||
Text(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Match Live TV</string>
|
||||
<string name="collaudo_banner">AMBIENTE COLLAUDO</string>
|
||||
<string name="app_slogan">Ogni partita, ogni evento, per i tuoi tifosi.</string>
|
||||
<string name="language_label">Lingua</string>
|
||||
<string name="language_system">Sistema</string>
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
ANDROID_DIR="$ROOT/native/android"
|
||||
API_BASE_URL="${API_BASE_URL:-https://collaudo.matchlivetv.it}"
|
||||
|
||||
cd "$ANDROID_DIR"
|
||||
chmod +x gradlew
|
||||
./gradlew assembleCollaudoRelease -PAPI_BASE_URL="$API_BASE_URL"
|
||||
|
||||
APK="$ANDROID_DIR/app/build/outputs/apk/collaudo/release/app-collaudo-release.apk"
|
||||
echo "APK: $APK"
|
||||
echo "API_BASE_URL=$API_BASE_URL"
|
||||
echo "applicationId=com.matchlivetv.match_live_tv.collaudo"
|
||||
@@ -6,8 +6,8 @@ API_BASE_URL="${API_BASE_URL:-https://www.matchlivetv.it}"
|
||||
|
||||
cd "$ANDROID_DIR"
|
||||
chmod +x gradlew
|
||||
./gradlew assembleRelease -PAPI_BASE_URL="$API_BASE_URL"
|
||||
./gradlew assembleProdRelease -PAPI_BASE_URL="$API_BASE_URL"
|
||||
|
||||
APK="$ANDROID_DIR/app/build/outputs/apk/release/app-release.apk"
|
||||
APK="$ANDROID_DIR/app/build/outputs/apk/prod/release/app-prod-release.apk"
|
||||
echo "APK: $APK"
|
||||
echo "API_BASE_URL=$API_BASE_URL"
|
||||
|
||||
@@ -14,7 +14,7 @@ echo "==> Device: $DEVICE"
|
||||
cd "$ANDROID_DIR"
|
||||
chmod +x gradlew
|
||||
echo "==> Build debug + androidTest APK (API_BASE_URL=$API_BASE_URL)"
|
||||
./gradlew assembleDebug assembleDebugAndroidTest -PAPI_BASE_URL="$API_BASE_URL"
|
||||
./gradlew assembleProdDebug assembleProdDebugAndroidTest -PAPI_BASE_URL="$API_BASE_URL"
|
||||
|
||||
echo "==> Reset app state on $DEVICE"
|
||||
"$ADB" -s "$DEVICE" shell am force-stop com.matchlivetv.match_live_tv
|
||||
@@ -24,11 +24,11 @@ echo "==> Reset app state on $DEVICE"
|
||||
"$ADB" -s "$DEVICE" shell pm grant com.matchlivetv.match_live_tv android.permission.POST_NOTIFICATIONS
|
||||
|
||||
echo "==> Install on $DEVICE"
|
||||
"$ADB" -s "$DEVICE" install -r app/build/outputs/apk/debug/app-debug.apk
|
||||
"$ADB" -s "$DEVICE" install -r app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
|
||||
"$ADB" -s "$DEVICE" install -r app/build/outputs/apk/prod/debug/app-prod-debug.apk
|
||||
"$ADB" -s "$DEVICE" install -r app/build/outputs/apk/androidTest/prod/debug/app-prod-debug-androidTest.apk
|
||||
|
||||
echo "==> Run E2E tests"
|
||||
./gradlew connectedDebugAndroidTest \
|
||||
./gradlew connectedProdDebugAndroidTest \
|
||||
-Pandroid.testInstrumentationRunnerArguments.class=com.matchlivetv.match_live_tv.E2EWizardFlowTest \
|
||||
-PAPI_BASE_URL="$API_BASE_URL"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user