Move product specific values to productFlavors

This commit is contained in:
Attila Uygun 2023-09-04 20:05:57 +02:00
parent 37afc006d2
commit e6d89add57
5 changed files with 15 additions and 13 deletions

View File

@ -103,7 +103,6 @@ android {
ndkVersion rootProject.ext.ndkVersion ndkVersion rootProject.ext.ndkVersion
defaultConfig { defaultConfig {
applicationId rootProject.ext.applicationId
minSdk rootProject.ext.minSdk minSdk rootProject.ext.minSdk
targetSdk rootProject.ext.targetSdk targetSdk rootProject.ext.targetSdk
ndk { ndk {
@ -127,12 +126,20 @@ android {
productFlavors { productFlavors {
helloWorld { helloWorld {
dimension 'game' dimension 'game'
applicationId 'com.kaliber.helloworld'
resValue "string", "provider_name", "${applicationId}.fileprovider"
resValue "string", "app_name", "Kaliber Hello World"
resValue "string", "interstitial_ad_unit_id", ""
ext { ext {
gnTarget = "hello_world" gnTarget = "hello_world"
} }
} }
demo { demo {
dimension 'game' dimension 'game'
applicationId 'com.kaliber.woom'
resValue "string", "provider_name", "${applicationId}.fileprovider"
resValue "string", "app_name", "Kaliber Demo"
resValue "string", "interstitial_ad_unit_id", "ca-app-pub-1321063817979967/8373182022"
ext { ext {
gnTarget = "demo" gnTarget = "demo"
} }
@ -155,7 +162,7 @@ android {
} }
} }
namespace rootProject.ext.applicationId namespace "com.kaliber.base"
} }
dependencies { dependencies {

View File

@ -36,7 +36,7 @@
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="com.woom.game.fileprovider" android:authorities="@string/provider_name"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">
<meta-data <meta-data

View File

@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">woom</string>
<string name="interstitial_ad_unit_id">ca-app-pub-1321063817979967/8373182022</string>
</resources> </resources>

View File

@ -21,19 +21,17 @@ task clean(type: Delete) {
} }
ext { ext {
ndkVersion = '25.2.9519653'
minSdk = 24
compileSdk = 33
targetSdk = 33
if (!project.hasProperty('targetArchs')) { if (!project.hasProperty('targetArchs')) {
targetArchs = ['Arm7', 'Arm8', 'X86_64', 'X86'] targetArchs = ['Arm7', 'Arm8', 'X86_64', 'X86']
} else { } else {
targetArchs = project.getProperty('targetArchs').split(',') targetArchs = project.getProperty('targetArchs').split(',')
} }
applicationId = 'com.woom.game'
ndkVersion = '25.2.9519653'
minSdk = 24
compileSdk = 33
targetSdk = 33
if (!project.hasProperty('gn')) { if (!project.hasProperty('gn')) {
gn = "gn" gn = "gn"
} }

View File

@ -24,7 +24,6 @@ import com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener; import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
import com.google.android.gms.ads.interstitial.InterstitialAd; import com.google.android.gms.ads.interstitial.InterstitialAd;
import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback; import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback;
import com.woom.game.R;
import java.io.File; import java.io.File;