Skip to content

Commit

Permalink
chore: remove unused code for finding rn version (software-mansion#2288)
Browse files Browse the repository at this point in the history
We support RN >= 0.72 so this code is no longer needed.
  • Loading branch information
WoLewicki authored and ja1ns committed Oct 9, 2024
1 parent 679d5b6 commit bb946a1
Showing 1 changed file with 6 additions and 34 deletions.
40 changes: 6 additions & 34 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,32 +55,6 @@ def safeAppExtGet(prop, fallback) {
appProject?.ext?.has(prop) ? appProject.ext.get(prop) : fallback
}

def resolveReactNativeDirectory() {
def reactNativeLocation = safeAppExtGet("REACT_NATIVE_NODE_MODULES_DIR", null)
if (reactNativeLocation != null) {
return file(reactNativeLocation)
}

def reactNativeFromAppNodeModules = file("${projectDir}/../../react-native")
if (!isRunningInContextOfScreensRepo() && reactNativeFromAppNodeModules.exists()) {
return reactNativeFromAppNodeModules
}

def reactNativeFromProjectNodeModules = file("${rootProject.projectDir}/../node_modules/react-native")
if (reactNativeFromProjectNodeModules.exists()) {
return reactNativeFromProjectNodeModules
}

throw new GradleException(
"[RNScreens] Unable to resolve react-native location in node_modules. You should add project extension property (in `app/build.gradle`) `REACT_NATIVE_NODE_MODULES_DIR` with path to react-native."
)
}

def reactNativeRootDir = resolveReactNativeDirectory()
def reactProperties = new Properties()
file("$reactNativeRootDir/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) }
def REACT_NATIVE_VERSION = reactProperties.getProperty("VERSION_NAME")
def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION.startsWith("0.0.0-") ? 1000 : REACT_NATIVE_VERSION.split("\\.")[1].toInteger()
def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled()

android {
Expand Down Expand Up @@ -118,14 +92,12 @@ android {
}
}
}
if (REACT_NATIVE_MINOR_VERSION >= 71) {
buildFeatures {
prefab true
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
buildFeatures {
prefab true
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
lintOptions {
Expand Down

0 comments on commit bb946a1

Please sign in to comment.