Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flavor support #21551

Merged
merged 65 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7bcbb8b
add flavors
staszekscp Apr 11, 2023
b84fefe
support flavors on android
staszekscp Apr 13, 2023
c2189e4
fix name
staszekscp Apr 13, 2023
991ed02
improve android splashscreen
staszekscp Apr 13, 2023
f9f7a9a
fix android script in package.json
staszekscp Apr 13, 2023
6e6c1ff
fix last lines
staszekscp Apr 13, 2023
6274443
fix fastfile
staszekscp Apr 13, 2023
fc4f72a
Merge branch 'main' into flavor-support
staszekscp Apr 18, 2023
4c4ae64
add basic scheme support for ios
staszekscp Apr 18, 2023
d5e9a41
add icon to schemes
staszekscp Apr 18, 2023
a2bd8a0
fix package.json
staszekscp Apr 18, 2023
70545fe
add .env detection
staszekscp Apr 18, 2023
2d23f8a
Merge branch 'main' into flavor-support
staszekscp Apr 20, 2023
3aa64ff
Merge branch 'main' into flavor-support
staszekscp Apr 26, 2023
13f8dd5
merge
staszekscp Apr 26, 2023
e0449f9
Merge branch 'main' into flavor-support
mczernek May 25, 2023
f4f3113
Remove unnecesary buildTypes and flavors, add e2e flavor.
mczernek May 25, 2023
71dbe1e
Remove Staging from iOS.
mczernek May 25, 2023
3e3b345
Remove staging from some leftovers.
mczernek May 25, 2023
e353839
Fix Fastlane according to new flavors/buildTypes configuration.
mczernek May 25, 2023
aa383d6
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Jun 12, 2023
047adac
Add icons based on flavour to splash screen
kowczarz Jun 14, 2023
097adf4
Disable unused android build variants
kowczarz Jun 15, 2023
ca982f1
Fix splash screen icon based on app flavour
kowczarz Jun 21, 2023
26470c2
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Jun 26, 2023
4c0b60f
Update env configuration
kowczarz Jun 26, 2023
ca85783
Update env configuration for e2e flavor
kowczarz Jun 26, 2023
dfa2d9c
Typo
kowczarz Jun 26, 2023
6cea881
Remove unused assets
kowczarz Jun 26, 2023
2c5174a
Fix lint issues
kowczarz Jun 26, 2023
df78bfb
Fix build gradle
kowczarz Jun 26, 2023
8397672
Fix podfile issues
kowczarz Jun 26, 2023
e85a760
Move bootsplash files to specific directories
kowczarz Jun 26, 2023
8b77667
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Jun 27, 2023
defc4b9
Add xcode selection for iOS fastlane
kowczarz Jun 27, 2023
768c27d
Fix filename typo
kowczarz Jun 28, 2023
30a30a1
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Jun 29, 2023
7df7319
Change signing config for non-production flavors on android
kowczarz Jun 30, 2023
84d015c
Force latest xcode version in GitHub Action
kowczarz Jun 30, 2023
0cba771
Bump up xcode
kowczarz Jul 3, 2023
c0e604e
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Jul 18, 2023
d43e1ed
Update Fastfile for ad-hoc provisioning
kowczarz Jul 21, 2023
746ac8a
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Jul 21, 2023
fd8e2a6
Updated podfile lock
kowczarz Jul 21, 2023
23ba779
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Jul 25, 2023
b4e0aef
Fix pbxproj issues
kowczarz Jul 25, 2023
04406ea
Fix dev and adhoc icon sets
kowczarz Jul 25, 2023
3b0d03e
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Jul 25, 2023
5e19ef7
Add flavor indication on AboutPage.js
kowczarz Jul 25, 2023
b4dd6fe
Fix android icons
kowczarz Jul 26, 2023
93fbc24
Fix android round icons
kowczarz Jul 26, 2023
c873052
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Jul 27, 2023
2b6f665
Update bundle id and provisioning profile for dev builds
kowczarz Jul 27, 2023
ae49ac2
Add app id suffix for android e2e build
kowczarz Jul 27, 2023
282105f
Fix production logo flashing
kowczarz Aug 1, 2023
aee92d4
Revert different splash screens on Android
kowczarz Aug 2, 2023
8035662
Revert "Remove unused assets"
kowczarz Aug 2, 2023
24724fe
Fix lint issue
kowczarz Aug 2, 2023
291ec29
Remove unused file
kowczarz Aug 2, 2023
667b9b1
Merge remote-tracking branch 'expensify/main' into flavor-support
kowczarz Aug 9, 2023
9b9ae17
Fix pods
kowczarz Aug 9, 2023
b1a8f74
Small nits in build.gradle
kowczarz Aug 9, 2023
d6ccac1
Fix logo issue
kowczarz Aug 10, 2023
69923ac
Update missing setup in build.gradle
kowczarz Aug 11, 2023
ffc1db5
Typo
kowczarz Aug 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
branches: ['*ci-test/**']

env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer

jobs:
validateActor:
Expand Down Expand Up @@ -138,6 +138,9 @@ jobs:

- uses: Expensify/App/.github/actions/composite/setupNode@main

- name: Setup Xcode
run: sudo xcode-select -switch /Applications/Xcode_14.2.app

- uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7
with:
ruby-version: '2.7'
Expand All @@ -151,7 +154,7 @@ jobs:
command: cd ios && bundle exec pod install

- name: Decrypt profile
run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output chat_expensify_adhoc.mobileprovision chat_expensify_adhoc.mobileprovision.gpg
run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output expensify_chat_adhoc.mobileprovision expensify_chat_adhoc.mobileprovision.gpg
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

Expand Down
67 changes: 43 additions & 24 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ react {
}

project.ext.envConfigFiles = [
debug: ".env",
release: ".env.production",
productionDebug: ".env.production",
productionRelease: ".env.production",
adhocRelease: ".env.adhoc",
developmentRelease: ".env",
developmentDebug: ".env",
e2eRelease: ".env.production"
]

/**
Expand Down Expand Up @@ -90,14 +94,35 @@ android {
versionName "1.3.51-0"
}

flavorDimensions "default"
productFlavors {
// we need to define a production flavor but since it has default config, we can leave it empty
production
e2e {
// If are building a version that won't be uploaded to the play store, we don't have to use production keys
// applies all non-production flavors
applicationIdSuffix ".adhoc"
signingConfig signingConfigs.debug
resValue "string", "build_config_package", "com.expensify.chat"
}
adhoc {
applicationIdSuffix ".adhoc"
signingConfig signingConfigs.debug
resValue "string", "build_config_package", "com.expensify.chat"
}
development {
applicationIdSuffix ".dev"
signingConfig signingConfigs.debug
resValue "string", "build_config_package", "com.expensify.chat"
}
}

signingConfigs {
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword System.getenv('MYAPP_UPLOAD_STORE_PASSWORD')
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword System.getenv('MYAPP_UPLOAD_KEY_PASSWORD')
}
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword System.getenv('MYAPP_UPLOAD_STORE_PASSWORD')
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword System.getenv('MYAPP_UPLOAD_KEY_PASSWORD')
}
debug {
storeFile file('debug.keystore')
Expand All @@ -111,20 +136,17 @@ android {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
signingConfig signingConfigs.debug
productFlavors.production.signingConfig signingConfigs.release
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kowczarz, do you recall why line 140 is necessary? Is this doing something that the following code would not?

signingConfig signingConfigs.release

minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
// We need a custom build type, so we can allow http clear text traffic in a release build:
e2eRelease {
initWith release
matchingFallbacks = ['release']
signingConfig signingConfigs.debug
}
internalRelease {
initWith release
matchingFallbacks = ['release']
signingConfig signingConfigs.debug
}

// since we don't need variants adhocDebug and e2eDebug, we can force gradle to ignore them
variantFilter { variant ->
if (variant.name == "adhocDebug" || variant.name == "e2eDebug") {
setIgnore(true)
}
}
}
Expand Down Expand Up @@ -170,16 +192,13 @@ dependencies {
// Fixes a version conflict between airship and react-native-plaid-link-sdk
// This may be fixed by a newer version of the plaid SDK (not working as of 10.0.0)
implementation "androidx.work:work-runtime-ktx:2.8.0"

// This okhttp3 dependency prevents the app from crashing - See https://github.com/plaid/react-native-plaid-link-sdk/issues/74#issuecomment-648435002
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.+"

implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0")
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
def googleServicesFile = rootProject.file('app/google-services.json')
if (googleServicesFile.exists()) {
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
}
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
170 changes: 133 additions & 37 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,143 @@
{
"project_info": {
"project_number": "921154746561",
"firebase_url": "https://expensify-chat.firebaseio.com",
"project_id": "expensify-chat",
"storage_bucket": "expensify-chat.appspot.com"
"project_number": "921154746561",
"firebase_url": "https://expensify-chat.firebaseio.com",
"project_id": "expensify-chat",
"storage_bucket": "expensify-chat.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:921154746561:android:4f04268f25f84eaf027c40",
"android_client_info": {
"package_name": "com.expensify.chat"
}
},
"oauth_client": [
{
"client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCVwQb9lBI06bDIwHOw10AkdJyquXoMngk"
{
"client_info": {
"mobilesdk_app_id": "1:921154746561:android:4f04268f25f84eaf027c40",
"android_client_info": {
"package_name": "com.expensify.chat"
}
},
"oauth_client": [
{
"client_id": "921154746561-o0pgqgc84e3e97s9iljlmimcb5nesqad.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.expensify.chat",
"certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625"
}
},
{
"client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCVwQb9lBI06bDIwHOw10AkdJyquXoMngk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "921154746561-080fav7kvk6s70k6nd70mt50isubgff4.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.expensify.chat.adhoc"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "921154746561-s3uqn2oe4m85tufi6mqflbfbuajrm2i3.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.chat.expensify.chat"
}
}
]
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:921154746561:android:333e293a7fef83a8027c40",
"android_client_info": {
"package_name": "com.expensify.chat.adhoc"
}
},
"oauth_client": [
{
"client_id": "921154746561-cbegir0tnc2gan6k1gre5vtn75p60hom.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.expensify.chat.adhoc",
"certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625"
}
},
{
"client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCVwQb9lBI06bDIwHOw10AkdJyquXoMngk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "921154746561-080fav7kvk6s70k6nd70mt50isubgff4.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.expensify.chat.adhoc"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:921154746561:android:3b19fdbaedb5b586027c40",
"android_client_info": {
"package_name": "com.expensify.chat.dev"
}
},
"oauth_client": [
{
"client_id": "921154746561-svjnccrcn6vet45kn9o7sibb3jemipa6.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.expensify.chat.dev",
"certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625"
}
},
{
"client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCVwQb9lBI06bDIwHOw10AkdJyquXoMngk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "921154746561-080fav7kvk6s70k6nd70mt50isubgff4.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.expensify.chat.adhoc"
}
}
]
}
}
}
],
"configuration_version": "1"
}
}
5 changes: 5 additions & 0 deletions android/app/src/adhoc/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="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
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="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions android/app/src/adhoc/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">#3DDC84</color>
</resources>
3 changes: 3 additions & 0 deletions android/app/src/adhoc/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">New Expensify AdHoc</string>
</resources>
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="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
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="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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">#3DDC84</color>
</resources>
3 changes: 3 additions & 0 deletions android/app/src/development/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">New Expensify Dev</string>
</resources>

This file was deleted.

This file was deleted.

Loading
Loading