Files
zeekay 55a7f247ca init: extract wallet from lux/exchange monorepo
Copies apps/extension, apps/mobile and 10 pkgs (wallet, ui, config,
utilities, sessions, gating, notifications, analytics, eslint-config,
prices) into a standalone pnpm workspace.  Resolves merge conflict
markers in extension and mobile package.json files, strips build
artifacts (.wxt, .output, Pods).
2026-04-11 01:59:19 -07:00

294 lines
11 KiB
Groovy

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.google.gms.google-services"
apply plugin: "maven-publish"
apply plugin: "kotlin-android"
apply plugin: "org.jetbrains.kotlin.plugin.compose"
apply plugin: "com.facebook.react"
def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
def nodeModulesPath = "../../../../node_modules"
react {
// From expo docs: https://docs.expo.dev/brownfield/get-started
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim())
reactNativeDir = file("$nodeModulesPath/react-native")
hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc"
codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
enableBundleCompression = (findProperty('android.enableBundleCompression') ?: false).toBoolean()
cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
bundleCommand = "export:embed"
debuggableVariants = ["devDebug", "betaDebug", "prodDebug"]
/* Autolinking */
autolinkLibrariesWithApp()
}
/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
*
* 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 = 'io.github.react-native-community:jsc-android:2026004.+'
/**
* Private function to get the list of Native Architectures you want to build.
* This reads the value from reactNativeArchitectures in your gradle.properties
* file and works together with the --active-arch-only flag of react-native run-android.
*/
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}
boolean isCI = System.getenv('CI') != null
boolean datadogPropertiesAvailable = System.getenv('DATADOG_API_KEY') != null
if (isCI && datadogPropertiesAvailable) {
apply from: "../../../../node_modules/@datadog/mobile-react-native/datadog-sourcemaps.gradle"
}
<<<<<<< HEAD
def devVersionName = "1.69"
def betaVersionName = "1.69"
def prodVersionName = "1.69"
=======
def devVersionName = "1.70"
def betaVersionName = "1.70"
def prodVersionName = "1.70"
>>>>>>> upstream/main
android {
ndkVersion rootProject.ext.ndkVersion
<<<<<<< HEAD
namespace "com.lux.exchange"
defaultConfig {
applicationId "com.lux.exchange.mobile"
=======
namespace "com.uniswap"
defaultConfig {
applicationId "com.uniswap.mobile"
>>>>>>> upstream/main
compileSdk rootProject.ext.compileSdkVersion
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
splits {
abi {
reset()
enable false
universalApk false // If true, also generate a universal APK
include (*reactNativeArchitectures())
}
}
lintOptions {
abortOnError false
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
def useDebugKeystore = System.getenv("ANDROID_USE_DEBUG_KEYSTORE") == "true"
if (useDebugKeystore) {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
} else {
storeFile file(System.getenv("ANDROID_KEYSTORE_FILE") ?: 'keystore.jks')
storePassword System.getenv("ANDROID_STORE_PASSWORD") ?: ""
keyAlias System.getenv("ANDROID_KEYSTORE_ALIAS") ?: ""
keyPassword System.getenv("ANDROID_KEY_PASSWORD") ?: ""
}
}
}
flavorDimensions += "variant"
productFlavors {
dev {
isDefault(true)
<<<<<<< HEAD
applicationId "com.lux.exchange.mobile.dev"
=======
applicationId "com.uniswap.mobile.dev"
>>>>>>> upstream/main
versionName devVersionName
dimension "variant"
}
beta {
<<<<<<< HEAD
applicationId "com.lux.exchange.mobile.beta"
=======
applicationId "com.uniswap.mobile.beta"
>>>>>>> upstream/main
versionName betaVersionName
dimension "variant"
}
prod {
dimension "variant"
versionName prodVersionName
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.configureEach { variant ->
// Prevent using debug keystore for production builds
if (variant.flavorName == "prod" && variant.buildType.name == "release") {
def useDebugKeystore = System.getenv("ANDROID_USE_DEBUG_KEYSTORE") == "true"
if (useDebugKeystore) {
def blockTask = tasks.register("blockDebugKeystoreFor${variant.name.capitalize()}") {
doLast {
throw new GradleException(
"ANDROID_USE_DEBUG_KEYSTORE cannot be used for production builds.\n" +
"This prevents accidentally publishing an improperly signed APK."
)
}
}
variant.assembleProvider.configure { dependsOn blockTask }
}
}
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(com.android.build.VariantOutput.FilterType.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
}
}
packagingOptions {
resources.excludes.add("META-INF/*")
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
}
androidResources {
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.15"
}
sourceSets {
main {
jniLibs {
<<<<<<< HEAD
srcDir '../../../../node_modules/@luxamm/ethers-rs-mobile/android/jniLibs'
=======
srcDir '../../../../node_modules/@uniswap/ethers-rs-mobile/android/jniLibs'
>>>>>>> upstream/main
}
}
}
}
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation "com.facebook.react:react-android"
implementation("com.facebook.react:hermes-android")
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerialization"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle"
implementation 'com.google.android.play:integrity:1.2.0'
// Firebase App Check: Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:32.7.2"))
implementation("com.google.firebase:firebase-appcheck-playintegrity")
// Guava
implementation "com.google.guava:guava:24.1-jre"
// Guava fix
implementation "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava"
//TODO: Revisit dependencies during security audit
//Drive
implementation('com.google.api-client:google-api-client-android:2.1.0') {
exclude group: 'org.apache.httpcomponents'
exclude module: 'guava-jdk5'
}
implementation('com.google.apis:google-api-services-drive:v3-rev20221023-2.0.0') {
exclude group: 'org.apache.httpcomponents'
exclude module: 'guava-jdk5'
}
implementation 'com.google.android.gms:play-services-auth:20.4.0'
implementation 'com.google.api-client:google-api-client-jackson2:1.31.1'
implementation 'com.google.auth:google-auth-library-oauth2-http:1.11.0'
implementation "androidx.compose.foundation:foundation:$compose"
implementation "androidx.compose.material:material:$compose"
implementation "androidx.compose.ui:ui:$compose"
debugImplementation("androidx.compose.ui:ui-tooling:$compose")
implementation("androidx.compose.ui:ui-tooling-preview:$compose")
implementation "androidx.security:security-crypto:1.0.0"
implementation 'com.lambdapioneer.argon2kt:argon2kt:1.3.0'
implementation "com.google.accompanist:accompanist-flowlayout:$flowlayout"
// Used for device-reported performance class.
implementation("androidx.core:core-performance:$corePerf")
implementation("androidx.core:core-performance-play-services:$corePerf")
implementation 'com.github.statsig-io:android-sdk:4.36.0'
// For animated GIF support
implementation 'com.facebook.fresco:animated-gif:3.6.0'
implementation 'androidx.compose.ui:ui-tooling-preview-android:1.8.1'
implementation project(':react-native-video')
}