File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,13 @@ ext.isFabricEnabled = { Project project ->
36
36
}
37
37
38
38
ext. isNewArchitectureEnabled = { Project project ->
39
- def newArchEnabled = project. findProperty(" react.newArchEnabled" )
40
- ?: project. findProperty(" newArchEnabled" )
39
+ def NEW_ARCH_ENABLED = " newArchEnabled"
40
+ def SCOPED_NEW_ARCH_ENABLED = " react.newArchEnabled"
41
+
42
+ def newArchEnabled = project. findProperty(SCOPED_NEW_ARCH_ENABLED )
43
+ ?: project. findProperty(NEW_ARCH_ENABLED )
44
+ def version = getPackageVersionNumber(" react-native" , project. rootDir)
41
45
if (newArchEnabled == " true" ) {
42
- def version = getPackageVersionNumber(" react-native" , project. rootDir)
43
46
def isSupported = version == 0 || version >= v(0 , 71 , 0 )
44
47
if (! isSupported) {
45
48
throw new GradleException ([
@@ -50,5 +53,13 @@ ext.isNewArchitectureEnabled = { Project project ->
50
53
}
51
54
return isSupported
52
55
}
53
- return false
56
+
57
+ if (version < v(0 , 77 , 0 )) {
58
+ return false
59
+ }
60
+
61
+ // As of 0.77, New Architecture is assumed on and doesn't build otherwise
62
+ project. ext[NEW_ARCH_ENABLED ] = " true"
63
+ project. ext[SCOPED_NEW_ARCH_ENABLED ] = " true"
64
+ return true
54
65
}
You can’t perform that action at this time.
0 commit comments