Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ buildscript {
}
}

def isNewArchitectureEnabled() {
return project.hasProperty("newArchEnabled") && (project.newArchEnabled == "true" || project.newArchEnabled == true)
}

apply plugin: 'com.android.library'
if (isNewArchitectureEnabled()) {
apply plugin: 'com.facebook.react'
}

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
Expand Down Expand Up @@ -44,12 +51,23 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"

buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

ndk {
abiFilters(*reactNativeArchitectures())
}
}
lintOptions {
abortOnError false
}
}

def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

repositories {
mavenCentral()
}
Expand Down
3 changes: 2 additions & 1 deletion src/NativeRNCConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
// Synchronous getters (supported on Windows TurboModules)
getAll(): { [key: string]: string };
get(key: string): string;
// it's overriding react-native method, so we're not using it
// get(key: string): string;
// Optional Composition info hook
compositionInfo?(): string;
}
Expand Down