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

Upgrade the react native dependency to v0.71.2-alpha.3 #15130

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e95c79e
Initial changes to upgrade the react native dependency to v0.71.2-alp…
priyeshshah11 Feb 14, 2023
1872ad1
upgraded react-native-onyx version to use my (priyeshshah11's) fork
priyeshshah11 Feb 15, 2023
0894618
upgraded react-native version to v0.71.2-alpha-2 & to use react-nativ…
priyeshshah11 Feb 17, 2023
9e34845
Resolve merge conflicts with main
priyeshshah11 Feb 17, 2023
42bd0d8
removed jest preset
priyeshshah11 Feb 17, 2023
01360c7
Updated pusher-js to v7.4.0 & updated build.gradle to fix build issue…
priyeshshah11 Feb 18, 2023
17d4262
Upgraded react-native-onyx to v1.0.38
priyeshshah11 Feb 21, 2023
0c5bd25
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Feb 24, 2023
dc4c304
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Feb 26, 2023
a8877de
Putting jest preset back to test breaking tests
priyeshshah11 Mar 1, 2023
9c8b0d6
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Mar 1, 2023
133b58c
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Mar 1, 2023
17f37fa
upgraded react-native version to 0.71.2-alpha.3
priyeshshah11 Mar 22, 2023
b355b3c
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Mar 22, 2023
b62a444
updated podfile
priyeshshah11 Mar 22, 2023
2063018
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Mar 29, 2023
3336df1
pod update
priyeshshah11 Mar 29, 2023
27d3889
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Mar 29, 2023
3deb55f
upgraded react-native-community/cameraroll to latest version v5.3.1
priyeshshah11 Mar 31, 2023
ea1e0b3
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Mar 31, 2023
a13e022
updated cameraroll library source
priyeshshah11 Mar 31, 2023
eb89ec1
testing builds
priyeshshah11 Mar 31, 2023
5342ef5
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Apr 3, 2023
686eeae
adding ReactNativeFlipper file for internalRelease build version
priyeshshah11 Apr 5, 2023
a99f7c6
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Apr 5, 2023
25f1f5c
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Apr 5, 2023
6c83538
commented maintainVisibleContentPosition to fix tests
priyeshshah11 Apr 5, 2023
93e9b62
ran pod update
priyeshshah11 Apr 5, 2023
3407bad
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Apr 7, 2023
fbe8cba
defaulting numberOfLines in the composer to undefined to fix the comp…
priyeshshah11 Apr 7, 2023
4da4d3a
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Apr 7, 2023
bdf2820
setting alternateTextMaxLines to undefined on priority page to fix th…
priyeshshah11 Apr 7, 2023
c1540a2
Merge branch 'main' of https://github.com/priyeshshah11/App into priy…
priyeshshah11 Apr 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
255 changes: 56 additions & 199 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,96 +1,65 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: "com.google.firebase.firebase-perf"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os

/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/

project.ext.react = [
enableHermes: true, // clean and rebuild if changing
]
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
// codegenDir = file("../node_modules/react-native-codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]

/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []

/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
}

project.ext.envConfigFiles = [
debug: ".env",
release: ".env.production",
]

apply from: "../../node_modules/react-native/react.gradle"

/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
Expand Down Expand Up @@ -119,15 +88,6 @@ def enableProguardInReleaseBuilds = false
*/
def jscFlavor = 'org.webkit:android-jsc:+'

/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and that value will be read here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);

/**
* Architectures to build native code for.
*/
Expand All @@ -137,86 +97,18 @@ def reactNativeArchitectures() {
}

android {
compileSdkVersion rootProject.ext.compileSdkVersion

packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libjsc.so'
pickFirst 'lib/arm64-v8a/libjsc.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
ndkVersion rootProject.ext.ndkVersion

// Exclude generated files from APK, to fix 'More than one file was found with path' error
exclude 'META-INF/*'
}
compileSdkVersion rootProject.ext.compileSdkVersion

namespace "com.expensify.chat"
defaultConfig {
applicationId "com.expensify.chat"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001027101
versionName "1.2.71-1"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
// We configure the CMake build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
cmake {
arguments "-DPROJECT_BUILD_DIR=$buildDir",
"-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
"-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
"-DNODE_MODULES_DIR=$rootDir/../node_modules",
"-DANDROID_STL=c++_shared"
}
}
if (!enableSeparateBuildPerCPUArchitecture) {
ndk {
abiFilters (*reactNativeArchitectures())
}
}
}
}

if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
cmake {
path "$projectDir/src/main/jni/CMakeLists.txt"
}
}
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
afterEvaluate {
// If you wish to add a custom TurboModule or component locally,
// you should uncomment this line.
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
// Due to a bug inside AGP, we have to explicitly set a dependency
// between configureCMakeDebug* tasks and the preBuild tasks.
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
configureCMakeDebug.dependsOn(preDebugBuild)
reactNativeArchitectures().each { architecture ->
tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
dependsOn("preDebugBuild")
}
tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
dependsOn("preReleaseBuild")
}
}
}
versionCode 1001026000
versionName "1.2.60-0"
}

splits {
Expand Down Expand Up @@ -284,8 +176,8 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])

//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

Expand All @@ -306,11 +198,8 @@ dependencies {
exclude group:'com.facebook.flipper'
}

if (enableHermes) {
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
Expand All @@ -336,41 +225,9 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.+"
}

if (isNewArchitectureEnabled()) {
// If new architecture is enabled, we let you build RN from source
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
// This will be applied to all the imported transtitive dependency.
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("com.facebook.react:react-native"))
.using(project(":ReactAndroid"))
.because("On New Architecture we're building React Native from source")
substitute(module("com.facebook.react:hermes-engine"))
.using(project(":ReactAndroid:hermes-engine"))
.because("On New Architecture we're building Hermes from source")
}
}
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.implementation
into 'libs'
}

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.firebase.crashlytics'

def isNewArchitectureEnabled() {
// To opt-in for the New Architecture, you can either:
// - Set `newArchEnabled` to true inside the `gradle.properties` file
// - Invoke gradle with `-newArchEnabled=true`
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.reactnativechat;
package com.expensify.chat;

import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
Expand All @@ -17,21 +17,23 @@
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceEventListener;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;

/**
* Class responsible of loading Flipper inside your React Native application. This is the debug
* flavor of it. Here you can add your own plugins and customize the Flipper setup.
*/
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);

client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
Expand Down
Loading