From 4a07ed2c0c78fd7d3353aff6e0a7f75a2a4b6b86 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 1e96436351a657..d99ef6323c5a01 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,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 836c9a2946eaa1..47ea26461d5496 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"