Skip to content

Commit

Permalink
Merge branch 'migrate/-Migrate-to-new-Arch' of github.com:hoanghai965…
Browse files Browse the repository at this point in the history
…0/react-native-contacts into hoanghai9650-migrate/-Migrate-to-new-Arch
  • Loading branch information
Harry Moreno committed Sep 20, 2024
2 parents e3465b4 + 5dcc43b commit ee74e0e
Show file tree
Hide file tree
Showing 14 changed files with 2,437 additions and 680 deletions.
29 changes: 28 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ buildscript {
}
}

apply plugin: 'com.android.library'
def isNewArchitectureEnabled() {
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}

apply plugin: 'com.android.library'
if (isNewArchitectureEnabled()) {
apply plugin: 'com.facebook.react'
}
def DEFAULT_MIN_SDK_VERSION = 21
def DEFAULT_COMPILE_SDK_VERSION = 29
def DEFAULT_TARGET_SDK_VERSION = 29
Expand All @@ -30,6 +36,20 @@ android {
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
versionCode 1
versionName "1.0"
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
}
sourceSets {
main {
if (isNewArchitectureEnabled()) {
java.srcDirs += [
"src/newarch",
// This is needed to build Kotlin project with NewArch enabled
"${project.buildDir}/generated/source/codegen/java"
]
} else {
java.srcDirs += ["src/oldarch"]
}
}
}
lintOptions {
abortOnError false
Expand All @@ -43,3 +63,10 @@ repositories {
dependencies {
implementation 'com.facebook.react:react-native:+'
}
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
libraryName = "react-native-contacts"
codegenJavaPackageName = "com.rt2zz.reactnativecontacts"
}
}
Loading

0 comments on commit ee74e0e

Please sign in to comment.