Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ buildscript {

allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url({
def searchDir = rootDir.toPath()
do {
def p = searchDir.resolve("node_modules/react-native/android")
if (p.toFile().exists()) {
return p.toRealPath().toString()
{
def searchDir = rootDir.toPath()
do {
def p = searchDir.resolve("node_modules/react-native/android")
if (p.toFile().exists()) {
maven {
url(p.toRealPath().toString())
}
} while (searchDir = searchDir.getParent())
throw new GradleException("Could not find `react-native`");
}())
}
break
}
} while (searchDir = searchDir.getParent())
// As of 0.80, React Native is no longer installed from npm
}()
mavenCentral()
google()
}
Expand Down
24 changes: 12 additions & 12 deletions scripts/template.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ export function buildGradle() {
// https://github.com/facebook/react-native/commit/51a48d2e2c64a18012692b063368e369cd8ff797
"allprojects {",
" repositories {",
" maven {",
" // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm",
" url({",
" def searchDir = rootDir.toPath()",
" do {",
' def p = searchDir.resolve("node_modules/react-native/android")',
" if (p.toFile().exists()) {",
" return p.toRealPath().toString()",
" {",
" def searchDir = rootDir.toPath()",
" do {",
' def p = searchDir.resolve("node_modules/react-native/android")',
" if (p.toFile().exists()) {",
" maven {",
" url(p.toRealPath().toString())",
" }",
" } while (searchDir = searchDir.getParent())",
' throw new GradleException("Could not find `react-native`");',
" }())",
" }",
" break",
" }",
" } while (searchDir = searchDir.getParent())",
" // As of 0.80, React Native is no longer installed from npm",
" }()",
" mavenCentral()",
" google()",
" }",
Expand Down
48 changes: 24 additions & 24 deletions test/configure/gatherConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ describe("gatherConfig()", () => {
"",
"allprojects {",
" repositories {",
" maven {",
" // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm",
" url({",
" def searchDir = rootDir.toPath()",
" do {",
' def p = searchDir.resolve("node_modules/react-native/android")',
" if (p.toFile().exists()) {",
" return p.toRealPath().toString()",
" {",
" def searchDir = rootDir.toPath()",
" do {",
' def p = searchDir.resolve("node_modules/react-native/android")',
" if (p.toFile().exists()) {",
" maven {",
" url(p.toRealPath().toString())",
" }",
" } while (searchDir = searchDir.getParent())",
' throw new GradleException("Could not find `react-native`");',
" }())",
" }",
" break",
" }",
" } while (searchDir = searchDir.getParent())",
" // As of 0.80, React Native is no longer installed from npm",
" }()",
" mavenCentral()",
" google()",
" }",
Expand Down Expand Up @@ -427,19 +427,19 @@ describe("gatherConfig()", () => {
"",
"allprojects {",
" repositories {",
" maven {",
" // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm",
" url({",
" def searchDir = rootDir.toPath()",
" do {",
' def p = searchDir.resolve("node_modules/react-native/android")',
" if (p.toFile().exists()) {",
" return p.toRealPath().toString()",
" {",
" def searchDir = rootDir.toPath()",
" do {",
' def p = searchDir.resolve("node_modules/react-native/android")',
" if (p.toFile().exists()) {",
" maven {",
" url(p.toRealPath().toString())",
" }",
" } while (searchDir = searchDir.getParent())",
' throw new GradleException("Could not find `react-native`");',
" }())",
" }",
" break",
" }",
" } while (searchDir = searchDir.getParent())",
" // As of 0.80, React Native is no longer installed from npm",
" }()",
" mavenCentral()",
" google()",
" }",
Expand Down
Loading