expo-template-bare-minimum 51.0.50 → 51.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,27 @@ apply plugin: "com.facebook.react"
4
4
 
5
5
  def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
6
6
 
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
+
7
28
  /**
8
29
  * This is the configuration block to customize your React Native Android app.
9
30
  * By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -57,6 +78,11 @@ react {
57
78
  //
58
79
  // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
59
80
  // hermesFlags = ["-O", "-output-source-map"]
81
+
82
+ if (rnVersion >= versionToNumber(0, 75, 0)) {
83
+ /* Autolinking */
84
+ autolinkLibrariesWithApp()
85
+ }
60
86
  }
61
87
 
62
88
  /**
@@ -169,5 +195,7 @@ dependencies {
169
195
  }
170
196
  }
171
197
 
172
- 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");
173
- applyNativeModulesAppBuildGradle(project)
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
+ }
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
4
4
  networkTimeout=10000
5
5
  validateDistributionUrl=true
6
6
  zipStoreBase=GRADLE_USER_HOME
@@ -1,3 +1,27 @@
1
+ pluginManagement {
2
+ includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile().toString())
3
+ }
4
+
5
+ // Uncomment this to use React Native 0.75
6
+ // plugins { id("com.facebook.react.settings") }
7
+
8
+ def getRNMinorVersion() {
9
+ def version = providers.exec {
10
+ commandLine("node", "-e", "console.log(require('react-native/package.json').version);")
11
+ }.standardOutput.asText.get().trim()
12
+
13
+ def coreVersion = version.split("-")[0]
14
+ def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() }
15
+
16
+ return minor
17
+ }
18
+
19
+ if (getRNMinorVersion() >= 75) {
20
+ extensions.configure(com.facebook.react.ReactSettingsExtension){ ex ->
21
+ ex.autolinkLibrariesFromCommand()
22
+ }
23
+ }
24
+
1
25
  rootProject.name = 'HelloWorld'
2
26
 
3
27
  dependencyResolutionManagement {
@@ -11,8 +35,10 @@ dependencyResolutionManagement {
11
35
  apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle");
12
36
  useExpoModules()
13
37
 
14
- 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");
15
- applyNativeModulesSettingsGradle(settings)
38
+ if (getRNMinorVersion() < 75) {
39
+ 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");
40
+ applyNativeModulesSettingsGradle(settings)
41
+ }
16
42
 
17
43
  include ':app'
18
44
  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())
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "expo-template-bare-minimum",
3
3
  "description": "This bare project template includes a minimal setup for using unimodules with React Native.",
4
- "version": "51.0.50",
4
+ "version": "51.0.52",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "start": "expo start --dev-client",