|
1 | 1 | pluginManagement { |
2 | | - includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile().toString()) |
| 2 | + def reactNativeGradlePlugin = new File( |
| 3 | + providers.exec { |
| 4 | + workingDir(rootDir) |
| 5 | + commandLine("node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })") |
| 6 | + }.standardOutput.asText.get().trim() |
| 7 | + ).getParentFile().absolutePath |
| 8 | + includeBuild(reactNativeGradlePlugin) |
| 9 | + |
| 10 | + def expoPluginsPath = new File( |
| 11 | + providers.exec { |
| 12 | + workingDir(rootDir) |
| 13 | + commandLine("node", "--print", "require.resolve('expo-modules-autolinking/package.json', { paths: [require.resolve('expo/package.json')] })") |
| 14 | + }.standardOutput.asText.get().trim(), |
| 15 | + "../android/expo-gradle-plugin" |
| 16 | + ).absolutePath |
| 17 | + includeBuild(expoPluginsPath) |
| 18 | +} |
| 19 | + |
| 20 | +plugins { |
| 21 | + id("com.facebook.react.settings") |
| 22 | + id("expo-autolinking-settings") |
3 | 23 | } |
4 | | -plugins { id("com.facebook.react.settings") } |
5 | 24 |
|
6 | 25 | extensions.configure(com.facebook.react.ReactSettingsExtension) { ex -> |
7 | 26 | if (System.getenv('EXPO_USE_COMMUNITY_AUTOLINKING') == '1') { |
8 | 27 | ex.autolinkLibrariesFromCommand() |
9 | 28 | } else { |
10 | | - def command = [ |
11 | | - 'node', |
12 | | - '--no-warnings', |
13 | | - '--eval', |
14 | | - 'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))', |
15 | | - 'react-native-config', |
16 | | - '--json', |
17 | | - '--platform', |
18 | | - 'android' |
19 | | - ].toList() |
20 | | - ex.autolinkLibrariesFromCommand(command) |
| 29 | + ex.autolinkLibrariesFromCommand(expoAutolinking.rnConfigCommand) |
21 | 30 | } |
22 | 31 | } |
| 32 | +expoAutolinking.useExpoModules() |
23 | 33 |
|
24 | 34 | rootProject.name = 'ObytesApp' |
25 | 35 |
|
26 | | -dependencyResolutionManagement { |
27 | | - versionCatalogs { |
28 | | - reactAndroidLibs { |
29 | | - from(files(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../gradle/libs.versions.toml"))) |
30 | | - } |
31 | | - } |
32 | | -} |
33 | | - |
34 | | -apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle"); |
35 | | -useExpoModules() |
| 36 | +expoAutolinking.useExpoVersionCatalog() |
36 | 37 |
|
37 | 38 | include ':app' |
38 | | -includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile()) |
| 39 | +includeBuild(expoAutolinking.reactNativeGradlePlugin) |
0 commit comments