// Top-level build file where you can add configuration options common to all sub-projects/modules. def isNewArchitectureEnabled() { return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" } apply plugin: 'com.android.library' if (isNewArchitectureEnabled()) { apply plugin: 'com.facebook.react' } android { compileSdkVersion 34 namespace = "net.singular.react_native" defaultConfig { minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() } buildFeatures { buildConfig = true } lintOptions { abortOnError = false } sourceSets { main { if (isNewArchitectureEnabled()) { java.srcDirs = ['src/main/java', 'src/newarch/java', 'build/generated/source/codegen/java'] } else { java.srcDirs = ['src/main/java', 'src/oldarch/java'] } } } } rootProject.allprojects { repositories { maven { url = "../node_modules/react-native/android" } google() mavenCentral() maven { url = 'https://maven.singular.net/' } } } dependencies { implementation 'com.facebook.react:react-native:+' implementation 'com.singular.sdk:singular_sdk:12.16.1' implementation 'androidx.annotation:annotation:1.6.0' } if (isNewArchitectureEnabled()) { react { jsRootDir = file("../js/") libraryName = "NativeSingular" codegenJavaPackageName = "net.singular.react_native" } }