1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-11-01 05:43:11 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

feat: support for new architecture

This commit is contained in:
steven
2023-02-19 18:20:21 +08:00
parent 65a332b88a
commit e859900df6
34 changed files with 634 additions and 222 deletions

View File

@@ -5,7 +5,15 @@ def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
def isNewArchitectureEnabled() {
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}
apply plugin: 'com.android.library'
if (isNewArchitectureEnabled()) {
apply plugin: 'com.facebook.react'
}
android {
compileSdkVersion safeExtGet('compileSdkVersion', 28)
@@ -17,11 +25,17 @@ android {
versionCode 1
versionName "1.0"
consumerProguardFiles "proguard.pro"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
}
sourceSets {
main {
// let gradle pack the shared library into apk
jniLibs.srcDirs = ['./lib']
if (isNewArchitectureEnabled()) {
java.srcDirs += ['src/newarch']
} else {
java.srcDirs += ['src/oldarch']
}
}
}
@@ -45,3 +59,10 @@ repositories {
dependencies {
implementation 'com.facebook.react:react-native:+'
}
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../lib/")
libraryName = "update"
codegenJavaPackageName = "cn.reactnative.modules.update"
}
}