Co-authored-by: varnit goyal <github.cicd@navi.com> Co-authored-by: Varnit Goyal <varnit.goyal@navi.com>
258 lines
10 KiB
Groovy
258 lines
10 KiB
Groovy
apply plugin: "com.android.application"
|
|
apply plugin: "com.facebook.react"
|
|
|
|
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: []
|
|
* ]
|
|
*/
|
|
|
|
project.ext.react = [
|
|
enableHermes: true, // clean and rebuild if changing
|
|
enableNewArchitecture: true
|
|
]
|
|
|
|
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
|
|
|
|
/**
|
|
* Run Proguard to shrink the Java bytecode in release builds.
|
|
*/
|
|
def enableProguardInReleaseBuilds = true
|
|
|
|
/**
|
|
* The preferred build flavor of JavaScriptCore.
|
|
*
|
|
* 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
|
|
* give correct results when using with locales other than en-US. Note that
|
|
* this variant is about 6MiB larger per architecture than default.
|
|
*/
|
|
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);
|
|
|
|
|
|
def VERSION_CODE = 216
|
|
def VERSION_NAME = "2.15.2"
|
|
|
|
android {
|
|
namespace "com.avapp"
|
|
ndkVersion rootProject.ext.ndkVersion
|
|
|
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
|
|
defaultConfig {
|
|
applicationId "com.avapp"
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
versionCode VERSION_CODE
|
|
versionName VERSION_NAME
|
|
buildConfigField "string", "FLAVOR", '"'
|
|
buildConfigField "string", "BUILD_FLAVOR", '"'
|
|
buildConfigField "string", "APP_NAME", '"'
|
|
buildConfigField "string", "API_KEY", '"'
|
|
}
|
|
|
|
signingConfigs {
|
|
debug {
|
|
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
|
|
storeFile file(MYAPP_UPLOAD_STORE_FILE)
|
|
storePassword MYAPP_UPLOAD_STORE_PASSWORD
|
|
keyAlias MYAPP_UPLOAD_KEY_ALIAS
|
|
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
|
|
}
|
|
else {
|
|
storeFile file('debug.keystore')
|
|
storePassword 'android'
|
|
keyAlias 'androiddebugkey'
|
|
keyPassword 'android'
|
|
}
|
|
}
|
|
release {
|
|
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
|
|
storeFile file(MYAPP_UPLOAD_STORE_FILE)
|
|
storePassword MYAPP_UPLOAD_STORE_PASSWORD
|
|
keyAlias MYAPP_UPLOAD_KEY_ALIAS
|
|
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
|
|
}
|
|
}
|
|
}
|
|
buildTypes {
|
|
debug {
|
|
signingConfig signingConfigs.debug
|
|
}
|
|
release {
|
|
// Caution! In production, you need to generate your own keystore file.
|
|
// see https://reactnative.dev/docs/signed-apk-android.
|
|
signingConfig signingConfigs.release
|
|
minifyEnabled enableProguardInReleaseBuilds
|
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
}
|
|
}
|
|
|
|
flavorDimensions "env"
|
|
productFlavors {
|
|
fieldAgentsQA {
|
|
applicationId "com.avapp"
|
|
versionName VERSION_NAME
|
|
buildConfigField 'String', 'FLAVOR', '"fieldAgentsQa"'
|
|
buildConfigField 'String', 'BUILD_FLAVOR', '"qa"'
|
|
buildConfigField 'String', 'APP_NAME', '"COSMOS"'
|
|
buildConfigField 'String', 'API_KEY', '"Egsn144zdk4CZBZuhmDBMc4ytV7sLQ1C"'
|
|
}
|
|
fieldAgentsProd {
|
|
applicationId "com.avapp"
|
|
versionName VERSION_NAME
|
|
buildConfigField 'String', 'FLAVOR', '"fieldAgentsProd"'
|
|
buildConfigField 'String', 'BUILD_FLAVOR', '"prod"'
|
|
buildConfigField 'String', 'APP_NAME', '"COSMOS"'
|
|
buildConfigField 'String', 'API_KEY', '"tOScvaFFqRd0tKF2d8jnJu6oY6eSwtLA"'
|
|
}
|
|
callingAgentsQA {
|
|
applicationId "com.avapp"
|
|
versionName VERSION_NAME
|
|
buildConfigField 'String', 'FLAVOR', '"callingAgentsQA"'
|
|
buildConfigField 'String', 'BUILD_FLAVOR', '"qa"'
|
|
buildConfigField 'String', 'APP_NAME', '"COSMOS"'
|
|
buildConfigField 'String', 'API_KEY', '"Egsn144zdk4CZBZuhmDBMc4ytV7sLQ1C"'
|
|
}
|
|
callingAgentsProd {
|
|
applicationId "com.avapp"
|
|
versionName VERSION_NAME
|
|
buildConfigField 'String', 'FLAVOR', '"callingAgentsProd"'
|
|
buildConfigField 'String', 'BUILD_FLAVOR', '"prod"'
|
|
buildConfigField 'String', 'APP_NAME', '"COSMOS"'
|
|
buildConfigField 'String', 'API_KEY', '"tOScvaFFqRd0tKF2d8jnJu6oY6eSwtLA"'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
|
|
implementation "com.github.anrwatchdog:anrwatchdog:1.4.0"
|
|
implementation 'com.google.android.gms:play-services-location:21.3.0'
|
|
|
|
implementation 'com.navi.android:alfred:1.15.0-20240905.065147-1'
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
|
implementation(platform("com.google.firebase:firebase-bom:32.2.3"))
|
|
implementation("com.google.firebase:firebase-config-ktx")
|
|
implementation("com.google.firebase:firebase-analytics-ktx")
|
|
implementation 'androidx.core:core-splashscreen:1.0.1'
|
|
implementation 'com.navi.android:pulse:1.0.1-cosmos'
|
|
implementation 'androidx.work:work-runtime-ktx:2.8.1'
|
|
|
|
//noinspection GradleDynamicVersion
|
|
implementation("com.facebook.react:react-android")
|
|
|
|
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
|
|
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
|
|
exclude group:'com.squareup.okhttp3', module:'okhttp'
|
|
}
|
|
|
|
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
|
|
if (enableHermes) {
|
|
//noinspection GradleDynamicVersion
|
|
implementation("com.facebook.react:hermes-android")
|
|
} else {
|
|
implementation jscFlavor
|
|
}
|
|
}
|
|
|
|
// 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)
|
|
|
|
apply plugin: 'com.google.gms.google-services'
|
|
apply plugin: "com.google.firebase.crashlytics"
|
|
apply plugin: 'com.google.firebase.firebase-perf'
|
|
|
|
|