@@ -4,27 +4,6 @@ apply plugin: "com.facebook.react"
44
55def projectRoot = rootDir. getAbsoluteFile(). getParentFile(). getAbsolutePath()
66
7- static def versionToNumber (major , minor , patch ) {
8- return patch * 100 + minor * 10000 + major * 1000000
9- }
10-
11- def getRNVersion () {
12- def version = providers. exec {
13- workingDir(projectDir)
14- commandLine(" node" , " -e" , " console.log(require('react-native/package.json').version);" )
15- }. standardOutput. asText. get(). trim()
16-
17- def coreVersion = version. split(" -" )[0 ]
18- def (major, minor, patch) = coreVersion. tokenize(' .' ). collect { it. toInteger() }
19-
20- return versionToNumber(
21- major,
22- minor,
23- patch
24- )
25- }
26- def rnVersion = getRNVersion()
27-
287/**
298 * This is the configuration block to customize your React Native Android app.
309 * By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -41,12 +20,12 @@ react {
4120 bundleCommand = " export:embed"
4221
4322 /* Folders */
44- // The root of your project, i.e. where "package.json" lives. Default is '..'
45- // root = file("../")
46- // The folder where the react-native NPM package is. Default is ../node_modules/react-native
47- // reactNativeDir = file("../node_modules/react-native")
48- // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
49- // codegenDir = file("../node_modules/@react-native/codegen")
23+ // The root of your project, i.e. where "package.json" lives. Default is '../ ..'
24+ // root = file("../../ ")
25+ // The folder where the react-native NPM package is. Default is ../../ node_modules/react-native
26+ // reactNativeDir = file("../../ node_modules/react-native")
27+ // The folder where the react-native Codegen package is. Default is ../../ node_modules/@react-native/codegen
28+ // codegenDir = file("../../ node_modules/@react-native/codegen")
5029
5130 /* Variants */
5231 // The list of variants to that are debuggable. For those we're going to
@@ -79,10 +58,8 @@ react {
7958 // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
8059 // hermesFlags = ["-O", "-output-source-map"]
8160
82- if (rnVersion >= versionToNumber(0 , 75 , 0 )) {
83- /* Autolinking */
84- autolinkLibrariesWithApp()
85- }
61+ /* Autolinking */
62+ autolinkLibrariesWithApp()
8663}
8764
8865/**
@@ -144,6 +121,9 @@ android {
144121 useLegacyPackaging (findProperty(' expo.useLegacyPackaging' )?. toBoolean() ?: false )
145122 }
146123 }
124+ androidResources {
125+ ignoreAssetsPattern ' !.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
126+ }
147127}
148128
149129// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -194,8 +174,3 @@ dependencies {
194174 implementation jscFlavor
195175 }
196176}
197-
198- if (rnVersion < versionToNumber(0 , 75 , 0 )) {
199- apply from : new File ([" node" , " --print" , " require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })" ]. execute(null , rootDir). text. trim(), " ../native_modules.gradle" );
200- applyNativeModulesAppBuildGradle(project)
201- }
0 commit comments