2020-08-24 12:24:10 +00:00
|
|
|
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase()
|
2020-12-14 16:20:32 +00:00
|
|
|
def isFoss = taskRequests.contains("foss")
|
2020-08-24 12:24:10 +00:00
|
|
|
|
2017-08-03 18:23:43 +00:00
|
|
|
apply plugin: "com.android.application"
|
2024-03-19 20:58:31 +00:00
|
|
|
apply plugin: "org.jetbrains.kotlin.android"
|
|
|
|
apply plugin: "com.facebook.react"
|
2020-08-24 12:24:10 +00:00
|
|
|
|
2020-12-14 16:20:32 +00:00
|
|
|
if (!isFoss) {
|
2020-08-24 12:24:10 +00:00
|
|
|
apply plugin: 'com.google.firebase.crashlytics'
|
|
|
|
apply plugin: 'com.bugsnag.android.gradle'
|
|
|
|
}
|
2017-08-03 18:23:43 +00:00
|
|
|
|
|
|
|
/**
|
2024-03-19 20:58:31 +00:00
|
|
|
* 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.
|
2017-08-03 18:23:43 +00:00
|
|
|
*/
|
2024-03-19 20:58:31 +00:00
|
|
|
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"
|
2024-04-01 18:59:24 +00:00
|
|
|
hermesFlags = ["-O", "-output-source-map"]
|
2024-03-19 20:58:31 +00:00
|
|
|
}
|
2017-08-03 18:23:43 +00:00
|
|
|
|
|
|
|
/**
|
2024-03-19 20:58:31 +00:00
|
|
|
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
2017-08-03 18:23:43 +00:00
|
|
|
*/
|
2018-04-27 04:09:16 +00:00
|
|
|
def enableProguardInReleaseBuilds = false
|
2017-08-03 18:23:43 +00:00
|
|
|
|
2019-08-07 13:51:34 +00:00
|
|
|
/**
|
2024-03-19 20:58:31 +00:00
|
|
|
* The preferred build flavor of JavaScriptCore (JSC)
|
2019-08-07 13:51:34 +00:00
|
|
|
*
|
|
|
|
* For example, to use the international variant, you can use:
|
|
|
|
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
|
|
*
|
|
|
|
* The international variant includes ICU i18n library and necessary data
|
|
|
|
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
2024-03-19 20:58:31 +00:00
|
|
|
* give correct results when using with locales other than en-US. Note that
|
2019-08-07 13:51:34 +00:00
|
|
|
* this variant is about 6MiB larger per architecture than default.
|
|
|
|
*/
|
|
|
|
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
|
|
|
2024-03-19 20:58:31 +00:00
|
|
|
project.ext.react = [
|
|
|
|
// bundleAssetName: "app.bundle",
|
|
|
|
iconFontNames: [ 'custom.ttf' ]
|
|
|
|
]
|
2022-08-08 21:02:08 +00:00
|
|
|
|
2017-08-03 18:23:43 +00:00
|
|
|
android {
|
2022-08-08 21:02:08 +00:00
|
|
|
ndkVersion rootProject.ext.ndkVersion
|
2024-03-19 20:58:31 +00:00
|
|
|
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
|
|
compileSdk rootProject.ext.compileSdkVersion
|
2019-05-22 20:15:35 +00:00
|
|
|
|
2024-03-19 20:58:31 +00:00
|
|
|
namespace "chat.rocket.reactnative"
|
2017-08-03 18:23:43 +00:00
|
|
|
defaultConfig {
|
2020-12-04 16:17:29 +00:00
|
|
|
applicationId APPLICATION_ID
|
2019-05-22 20:15:35 +00:00
|
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
2017-11-07 16:58:33 +00:00
|
|
|
versionCode VERSIONCODE as Integer
|
2024-03-12 14:14:47 +00:00
|
|
|
versionName "4.48.0"
|
2024-03-19 20:58:31 +00:00
|
|
|
vectorDrawables.useSupportLibrary = true // need this?
|
2020-12-14 16:20:32 +00:00
|
|
|
if (!isFoss) {
|
2020-08-24 12:24:10 +00:00
|
|
|
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
|
2020-11-09 20:14:35 +00:00
|
|
|
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" // See note below!
|
2020-08-24 12:24:10 +00:00
|
|
|
}
|
2020-11-12 16:06:48 +00:00
|
|
|
resValue "string", "rn_config_reader_custom_package", "chat.rocket.reactnative"
|
2021-12-02 13:19:15 +00:00
|
|
|
testBuildType System.getProperty('testBuildType', 'debug')
|
|
|
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
2017-08-03 18:23:43 +00:00
|
|
|
}
|
2023-08-18 17:48:33 +00:00
|
|
|
|
2017-08-15 13:21:20 +00:00
|
|
|
signingConfigs {
|
|
|
|
release {
|
2017-11-06 23:45:48 +00:00
|
|
|
if (project.hasProperty('KEYSTORE')) {
|
|
|
|
storeFile file(KEYSTORE)
|
|
|
|
storePassword KEYSTORE_PASSWORD
|
|
|
|
keyAlias KEY_ALIAS
|
|
|
|
keyPassword KEY_PASSWORD
|
2017-08-15 13:21:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-08-03 18:23:43 +00:00
|
|
|
buildTypes {
|
|
|
|
release {
|
2018-04-27 04:09:16 +00:00
|
|
|
signingConfig signingConfigs.release
|
2024-03-19 20:58:31 +00:00
|
|
|
minifyEnabled enableProguardInReleaseBuilds
|
|
|
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
2020-12-14 16:20:32 +00:00
|
|
|
if (!isFoss) {
|
2020-08-24 12:24:10 +00:00
|
|
|
firebaseCrashlytics {
|
|
|
|
nativeSymbolUploadEnabled true
|
2022-08-08 21:02:08 +00:00
|
|
|
strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
|
|
|
|
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
|
2020-08-24 12:24:10 +00:00
|
|
|
}
|
2020-07-24 13:19:17 +00:00
|
|
|
}
|
2018-04-27 04:09:16 +00:00
|
|
|
}
|
2017-08-03 18:23:43 +00:00
|
|
|
}
|
2020-05-08 16:37:49 +00:00
|
|
|
|
2023-08-18 17:48:33 +00:00
|
|
|
// packagingOptions {
|
|
|
|
// pickFirst '**/armeabi-v7a/libc++_shared.so'
|
|
|
|
// pickFirst '**/x86/libc++_shared.so'
|
|
|
|
// pickFirst '**/arm64-v8a/libc++_shared.so'
|
|
|
|
// pickFirst '**/x86_64/libc++_shared.so'
|
|
|
|
// }
|
|
|
|
|
|
|
|
// FIXME: Remove when we update RN
|
2024-03-19 20:58:31 +00:00
|
|
|
// packagingOptions {
|
|
|
|
// pickFirst '**/*.so'
|
|
|
|
// }
|
2023-08-18 17:48:33 +00:00
|
|
|
|
2017-08-03 18:23:43 +00:00
|
|
|
// applicationVariants are e.g. debug, release
|
2020-08-24 12:24:10 +00:00
|
|
|
|
2020-12-14 16:20:32 +00:00
|
|
|
flavorDimensions "app", "type"
|
2020-08-24 12:24:10 +00:00
|
|
|
productFlavors {
|
2020-12-14 16:20:32 +00:00
|
|
|
official {
|
|
|
|
dimension = "app"
|
|
|
|
buildConfigField "boolean", "IS_OFFICIAL", "true"
|
|
|
|
}
|
|
|
|
experimental {
|
|
|
|
dimension = "app"
|
|
|
|
buildConfigField "boolean", "IS_OFFICIAL", "false"
|
|
|
|
}
|
2020-08-24 12:24:10 +00:00
|
|
|
foss {
|
|
|
|
dimension = "type"
|
|
|
|
buildConfigField "boolean", "FDROID_BUILD", "true"
|
|
|
|
}
|
|
|
|
play {
|
|
|
|
dimension = "type"
|
|
|
|
buildConfigField "boolean", "FDROID_BUILD", "false"
|
|
|
|
}
|
|
|
|
}
|
2020-11-09 20:14:35 +00:00
|
|
|
sourceSets {
|
2020-12-14 16:20:32 +00:00
|
|
|
// TODO: refactor making sure notifications are working properly both on debug and release
|
|
|
|
experimentalPlayDebug {
|
|
|
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
|
|
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
|
|
|
}
|
|
|
|
experimentalPlayRelease {
|
|
|
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
|
|
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
|
|
|
}
|
|
|
|
officialPlayDebug {
|
2020-11-09 20:14:35 +00:00
|
|
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
|
|
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
|
|
|
}
|
2020-12-14 16:20:32 +00:00
|
|
|
officialPlayRelease {
|
2020-11-09 20:14:35 +00:00
|
|
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
|
|
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
|
|
|
}
|
|
|
|
}
|
2020-08-24 12:24:10 +00:00
|
|
|
|
2024-03-19 20:58:31 +00:00
|
|
|
// need this?
|
|
|
|
// bundle {
|
|
|
|
// language {
|
|
|
|
// enableSplit = false
|
|
|
|
// }
|
|
|
|
// density {
|
|
|
|
// enableSplit = true
|
|
|
|
// }
|
|
|
|
// abi {
|
|
|
|
// enableSplit = true
|
|
|
|
// }
|
|
|
|
// }
|
2017-08-03 18:23:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-03-19 20:58:31 +00:00
|
|
|
// The version of react-native is set by the React Native Gradle Plugin
|
|
|
|
implementation("com.facebook.react:react-android")
|
|
|
|
implementation("com.facebook.react:flipper-integration")
|
2023-08-18 17:48:33 +00:00
|
|
|
|
2024-03-19 20:58:31 +00:00
|
|
|
if (hermesEnabled.toBoolean()) {
|
|
|
|
implementation("com.facebook.react:hermes-android")
|
2023-08-18 17:48:33 +00:00
|
|
|
} else {
|
2024-03-19 20:58:31 +00:00
|
|
|
implementation jscFlavor
|
2023-08-18 17:48:33 +00:00
|
|
|
}
|
2023-05-18 21:09:33 +00:00
|
|
|
|
2024-03-19 20:58:31 +00:00
|
|
|
implementation project(':@react-native-community_viewpager')
|
|
|
|
// implementation "androidx.core:core-splashscreen:1.0.0"
|
|
|
|
playImplementation project(':react-native-notifications')
|
|
|
|
// playImplementation 'com.google.firebase:firebase-core:16.0.0'
|
2024-03-20 18:33:34 +00:00
|
|
|
playImplementation project(':@react-native-firebase_app')
|
|
|
|
playImplementation project(':@react-native-firebase_analytics')
|
|
|
|
playImplementation project(':@react-native-firebase_crashlytics')
|
2024-03-19 20:58:31 +00:00
|
|
|
|
2022-08-08 21:02:08 +00:00
|
|
|
implementation "com.google.code.gson:gson:2.8.9"
|
2019-12-17 16:27:13 +00:00
|
|
|
implementation "com.github.bumptech.glide:glide:4.9.0"
|
|
|
|
annotationProcessor "com.github.bumptech.glide:compiler:4.9.0"
|
2022-08-08 21:02:08 +00:00
|
|
|
implementation "com.tencent:mmkv-static:1.2.10"
|
2023-03-07 12:28:51 +00:00
|
|
|
androidTestImplementation('com.wix:detox:+')
|
|
|
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
|
|
|
implementation 'com.facebook.soloader:soloader:0.10.4'
|
2024-03-19 20:58:31 +00:00
|
|
|
implementation("com.facebook.fresco:animated-gif:2.5.0")
|
|
|
|
|
|
|
|
// need this?
|
2024-01-22 20:37:43 +00:00
|
|
|
// react-native-screens was pointing to a newer version of this lib that is currently not supported in our app
|
2024-03-19 20:58:31 +00:00
|
|
|
// implementation ('com.google.android.material:material:1.6.0') {
|
|
|
|
// version {
|
|
|
|
// strictly '1.6.0'
|
|
|
|
// }
|
|
|
|
// }
|
2023-08-18 17:48:33 +00:00
|
|
|
}
|
|
|
|
|
2020-08-24 12:24:10 +00:00
|
|
|
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
2020-12-14 16:20:32 +00:00
|
|
|
if (!isFoss) {
|
2020-08-24 12:24:10 +00:00
|
|
|
apply plugin: 'com.google.gms.google-services'
|
|
|
|
}
|