From 267b31aadc1ba5b42576db0b60cd0caa7d66d244 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 15 Feb 2023 06:05:56 -0800 Subject: [PATCH] Make it easier for users to build from source if needed (#36165) Summary: This page is not up to date anymore: https://reactnative.dev/contributing/how-to-build-from-source I'm pushing those changes to make it easier to consume our build when building from source. I'll update the page those change lands. ## Changelog [Internal] [Changed] - Make it easier for users to build from source if needed Pull Request resolved: https://github.com/facebook/react-native/pull/36165 Test Plan: If the CI is green, we should be good to merge this Reviewed By: cipolleschi Differential Revision: D43303867 Pulled By: cortinico fbshipit-source-id: c0080b06cbcbf872ee92fcfa82a9f823d5b247f4 --- package.json | 3 +++ settings.gradle.kts | 15 ++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 89a60945129..aa65def8134 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,11 @@ }, "files": [ "android", + "build.gradle.kts", "cli.js", "flow", "flow-typed", + "gradle.properties", "index.js", "interface.js", "jest-preset.js", @@ -61,6 +63,7 @@ "sdks/.hermesversion", "sdks/hermes-engine", "sdks/hermesc", + "settings.gradle.kts", "template.config.js", "template", "!template/node_modules", diff --git a/settings.gradle.kts b/settings.gradle.kts index 836c9a2946e..47ea26461d5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,14 +13,15 @@ pluginManagement { } } -include( - ":ReactAndroid", - ":ReactAndroid:hermes-engine", - ":ReactAndroid:external-artifacts", - ":packages:rn-tester:android:app") +include(":ReactAndroid", ":ReactAndroid:hermes-engine", ":ReactAndroid:external-artifacts") -// Include this to enable codegen Gradle plugin. -includeBuild("packages/react-native-gradle-plugin/") +// If the ./packages folder exists, then we're inside the React Native repository. +// If not, a users is consuming this project for a build from source. +if (File("./packages").exists()) { + include(":packages:rn-tester:android:app") + // Include this to enable codegen Gradle plugin. + includeBuild("packages/react-native-gradle-plugin/") +} rootProject.name = "react-native-github"