Skip to content

Commit

Permalink
Define the "mainlandChina" store flavour (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeerias committed Aug 4, 2023
1 parent 1d7da81 commit c59c3be
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ jobs:
strategy:
matrix:
flavour: [
assembleOculusvrArm64WorldGeckoGeneric,
assembleOculusvrArm64WorldGeckoMetaStore,
assembleHvrArm64WorldGeckoGeneric,
assemblePicoxrArm64WorldGeckoGeneric,
assembleLynxArm64WorldGeckoGeneric,
assembleSpacesArm64WorldGeckoGeneric
assembleOculusvrArm64GeckoMetaStore,
assembleHvrArm64GeckoGeneric,
assembleHvrArm64GeckoMainlandChina,
assemblePicoxrArm64GeckoGeneric,
assembleLynxArm64GeckoGeneric,
assembleSpacesArm64GeckoGeneric,
assembleAospX86_64GeckoGeneric
]

steps:
Expand Down
22 changes: 12 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,14 @@ android {
}
}
}

mainlandChina {
applicationId "com.cn.igalia.wolvic"
dimension "store"
buildConfigField "Boolean", "FXA_USE_CHINA_SERVER", "true"
buildConfigField "Boolean", "WEBVIEW_IN_PHONE_UI", "true"
buildConfigField "Boolean", "CN_FIRST_RUN_IN_PHONE_UI", "true"
}
}

variantFilter { variant ->
Expand All @@ -371,7 +379,7 @@ android {
variant.setIgnore(platform != 'noapi');

// Create variants for China only for HVR platforms
if (country == 'cn' && !platform.startsWith('hvr'))
if (store == 'mainlandChina' && !platform.startsWith('hvr'))
variant.setIgnore(true);

// Create variants for chromium/webkit, only when they are available
Expand Down Expand Up @@ -719,14 +727,8 @@ android.applicationVariants.all { variant ->
}

def platform = variant.productFlavors.get(0).name
def country = variant.productFlavors.get(2).name

// HVR packages for mainland china must only use HVR speech recognition system.
// HVR packages for overseas should have 2D phone UI enabled.
if (platform.toLowerCase().startsWith('hvr')) {
if (country != 'cn')
variant.buildConfigField "Boolean", "WEBVIEW_IN_PHONE_UI", "true"
else
variant.buildConfigField "String[]", "SPEECH_SERVICES", "{ com.igalia.wolvic.speech.SpeechServices.HUAWEI_ASR }"
def store = variant.productFlavors.get(3).name
if (platform.toLowerCase().startsWith('hvr') && store == "mainlandChina") {
variant.buildConfigField "String[]", "SPEECH_SERVICES", "{ com.igalia.wolvic.speech.SpeechServices.HUAWEI_ASR }"
}
}

0 comments on commit c59c3be

Please sign in to comment.