diff --git a/android/build.gradle b/android/build.gradle index 96ca1c5f..5973c32c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -15,10 +15,6 @@ buildscript { } } -def isNewArchitectureEnabled() { - return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" -} - apply plugin: 'com.android.library' def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() @@ -34,11 +30,7 @@ if (!hasBuiltInKotlin) { apply plugin: 'kotlin-android' } apply plugin: 'org.jetbrains.kotlin.plugin.compose' - - -if (isNewArchitectureEnabled()) { - apply plugin: 'com.facebook.react' -} +apply plugin: 'com.facebook.react' def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['PagerView_' + name] @@ -55,7 +47,7 @@ if(shouldUseNameSpace){ manifestContent = manifestContent.replaceAll( PACKAGE_PROP, '' - ) + ) } else { if(!manifestContent.contains("$PACKAGE_PROP")){ manifestContent = manifestContent.replace( @@ -102,11 +94,9 @@ android { defaultConfig { minSdkVersion getExtOrIntegerDefault('minSdkVersion') targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') - buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() - - buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (isNewArchitectureEnabled() && registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null") + buildConfigField "String", "CODEGEN_MODULE_REGISTRATION", (registrationCompat ? "\"${codegenViewModuleName}_registration\"" : "null") - if (isNewArchitectureEnabled() && registrationCompat) { + if (registrationCompat) { def reactAndroidProject = project(':ReactAndroid') externalNativeBuild { ndkBuild { @@ -126,8 +116,8 @@ android { } } - if (isNewArchitectureEnabled() && registrationCompat) { - // We configure the NDK build only if you decide to opt-in for the New Architecture. + if (registrationCompat) { + // We configure the NDK build when registrationCompat is enabled. externalNativeBuild { ndkBuild { path "Android.mk" @@ -154,14 +144,10 @@ android { } sourceSets { main { - if (isNewArchitectureEnabled()) { - java.srcDirs += [ - "src/fabric/java", - "${project.buildDir}/generated/source/codegen/java" - ] - } else { - java.srcDirs += ["src/paper/java"] - } + java.srcDirs += [ + "src/fabric/java", + "${project.buildDir}/generated/source/codegen/java" + ] } } } @@ -254,10 +240,8 @@ dependencies { testImplementation "junit:junit:4.13.2" } -if (isNewArchitectureEnabled()) { - react { - jsRootDir = file("../src") - libraryName = codegenViewLibraryName - codegenJavaPackageName = "com.reactnativepagerview" - } +react { + jsRootDir = file("../src") + libraryName = codegenViewLibraryName + codegenJavaPackageName = "com.reactnativepagerview" }