diff --git a/binding/android/CheetahTestApp/cheetah-test-app/build.gradle b/binding/android/CheetahTestApp/cheetah-test-app/build.gradle index cffc2c63..d6509098 100644 --- a/binding/android/CheetahTestApp/cheetah-test-app/build.gradle +++ b/binding/android/CheetahTestApp/cheetah-test-app/build.gradle @@ -59,7 +59,7 @@ android { buildTypes { debug { - // signingConfig signingConfigs.release + signingConfig signingConfigs.release } release { minifyEnabled false @@ -72,6 +72,44 @@ android { testBuildType("release") } + def testDataFile = file('../../../../resources/.test/test_data.json') + def parsedJson = new groovy.json.JsonSlurper().parseText(testDataFile.text) + def languages = [] + parsedJson.tests.parameters.each { a -> + languages.add(a.language) + } + + flavorDimensions "language" + productFlavors { + en { + getIsDefault().set(true) + } + + languages.each { language -> + "$language" { + applicationIdSuffix ".$language" + + } + } + + all { flavor -> + delete fileTree("$projectDir/src/main/assets") { + exclude '**/.gitkeep' + } + String suffix = (flavor.name != "en") ? "_${flavor.name}" : "" + task("${flavor.name}CopyParams", type: Copy) { + from("$projectDir/../../../../lib/common/") + include("cheetah_params${suffix}.pv") + into("$projectDir/src/main/assets/models") + } + task("${flavor.name}CopyAudio", type: Copy) { + description = "Copy ${flavor.name} audio resources" + from("$projectDir/../../../../resources/audio_samples/") + include("test${suffix}.wav") + into("$projectDir/src/main/assets/audio_samples") + } + } + } sourceSets { androidTest { java { @@ -118,3 +156,17 @@ dependencies { }) androidTestImplementation('androidx.test.espresso:espresso-intents:3.5.1') } + +afterEvaluate { + android.productFlavors.all { + flavor -> + tasks."merge${flavor.name.capitalize()}DebugAssets".dependsOn "${flavor.name}CopyParams" + tasks."merge${flavor.name.capitalize()}ReleaseAssets".dependsOn "${flavor.name}CopyParams" + tasks."generate${flavor.name.capitalize()}ReleaseLintVitalReportModel".dependsOn "${flavor.name}CopyParams" + tasks."lintVitalAnalyze${flavor.name.capitalize()}Release".dependsOn "${flavor.name}CopyParams" + tasks."merge${flavor.name.capitalize()}DebugAssets".dependsOn "${flavor.name}CopyAudio" + tasks."merge${flavor.name.capitalize()}ReleaseAssets".dependsOn "${flavor.name}CopyAudio" + tasks."generate${flavor.name.capitalize()}ReleaseLintVitalReportModel".dependsOn "${flavor.name}CopyAudio" + tasks."lintVitalAnalyze${flavor.name.capitalize()}Release".dependsOn "${flavor.name}CopyAudio" + } +}