/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
rnmodules/react-native-kb/android/build.gradle
145 строк
4 KB
chrisnojima
fix(rpc): harden mobile JSI bridge against reader races and stream desync (#29464)
10 авг 2026, 17:06
Не верифицирован
10 авг 2026, 17:06
cd03baa
Код
Авторство
О чём код?
buildscript { // Buildscript is evaluated before everything else so we can't use getExtOrDefault def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["DropView_kotlinVersion"] repositories { google() mavenCentral() } dependencies { classpath "com.android.tools.build:gradle:7.2.1" // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } def resolveBuildType() { Gradle gradle = getGradle() String tskReqStr = gradle.getStartParameter().getTaskRequests()['args'].toString() return tskReqStr.contains('Release') ? 'release' : 'debug' } apply plugin: "com.android.library" apply plugin: "kotlin-android" apply plugin: "com.facebook.react" def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') } def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Kb_" + name] } def getExtOrIntegerDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Kb_" + name]).toInteger() } def reactNativeArchitectures() { def value = project.getProperties().get('reactNativeArchitectures') return value ? value.split(',') : ['armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a'] } android { ndkVersion getExtOrDefault("ndkVersion") compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") buildFeatures { prefab true } defaultConfig { minSdkVersion getExtOrIntegerDefault("minSdkVersion") targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") externalNativeBuild { cmake { cppFlags "-O2 -frtti -fexceptions -Wall -fstack-protector-all" arguments '-DANDROID_STL=c++_shared' abiFilters(*reactNativeArchitectures()) } } } packagingOptions { doNotStrip resolveBuildType() == 'debug' ? "**/**/*.so" : '' excludes = [ "META-INF", "META-INF/**", "**/libc++_shared.so", "**/libfbjni.so", "**/libjsi.so", "**/libfolly_json.so", "**/libfolly_runtime.so", "**/libglog.so", "**/libhermes.so", "**/libhermes-executor-debug.so", "**/libhermes_executor.so", "**/libreactnativejni.so", "**/libreactnative.so", "**/libturbomodulejsijni.so", "**/libreact_nativemodule_core.so", "**/libjscexecutor.so", "**/libv8executor.so", ] } externalNativeBuild { cmake { path "CMakeLists.txt" } } buildTypes { release { minifyEnabled false } } lintOptions { disable "GradleCompatible" } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } sourceSets { main { java.srcDirs += [ // This is needed to build Kotlin project with NewArch enabled "${project.buildDir}/generated/source/codegen/java" ] } } } repositories { mavenCentral() google() } def kotlin_version = getExtOrDefault("kotlinVersion") dependencies { // For < 0.71, this will be from the local maven repo // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "com.google.firebase:firebase-messaging:24.0.1" implementation project(':keybaselib') implementation "androidx.media3:media3-transformer:1.4.1" implementation "androidx.media3:media3-effect:1.4.1" implementation "androidx.media3:media3-common:1.4.1" // Plain JVM unit tests for the dependency-free reader-loop throttles // (src/test/java/com/reactnativekb). Run with // `./gradlew :react-native-kb:testDebugUnitTest` from shared/android. testImplementation "junit:junit:4.13.2" } react { jsRootDir = file("../src/") libraryName = "Kb" codegenJavaPackageName = "com.reactnativekb" }