From 32fc551c55a203bc4a511c12ae362632acb3b286 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 12 Oct 2022 03:21:12 -0700 Subject: [PATCH] Cleanup Buck usages from New App Template (#34881) Summary: I'm cleaning up the Buck setup in the New App template. It hasn't been touched since 2018 and is currently not working, but will end up being propagated in user space. This is also affecting the Gradle setup as there is a need to have an extra task just for Buck. I doubt anyone is using this at this stage. We can get back to it or have a dedicated guide for users that are willing to use it. ## Changelog [Android] [Remove] - Cleanup Buck usages from New App Template Pull Request resolved: https://github.com/facebook/react-native/pull/34881 Test Plan: Testing was missing on this API so there is nothing to test here Reviewed By: cipolleschi Differential Revision: D40142064 Pulled By: cortinico fbshipit-source-id: 6c65e1030bf3fe1603bfb7d486f8f3fd7d254126 --- template/_flowconfig | 3 -- template/_gitignore | 8 ++--- template/android/app/_BUCK | 55 ------------------------------- template/android/app/build.gradle | 7 ---- 4 files changed, 2 insertions(+), 71 deletions(-) delete mode 100644 template/android/app/_BUCK diff --git a/template/_flowconfig b/template/_flowconfig index b82fe7fe9ff..9f69724d1f4 100644 --- a/template/_flowconfig +++ b/template/_flowconfig @@ -2,9 +2,6 @@ ; We fork some components by platform .*/*[.]android.js -; Ignore "BUCK" generated dirs -/\.buckd/ - ; Ignore polyfills node_modules/react-native/Libraries/polyfills/.* diff --git a/template/_gitignore b/template/_gitignore index 2423126f729..27becf965d1 100644 --- a/template/_gitignore +++ b/template/_gitignore @@ -31,6 +31,8 @@ local.properties *.iml *.hprof .cxx/ +*.keystore +!debug.keystore # node.js # @@ -38,12 +40,6 @@ node_modules/ npm-debug.log yarn-error.log -# BUCK -buck-out/ -\.buckd/ -*.keystore -!debug.keystore - # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the diff --git a/template/android/app/_BUCK b/template/android/app/_BUCK deleted file mode 100644 index 0e779048347..00000000000 --- a/template/android/app/_BUCK +++ /dev/null @@ -1,55 +0,0 @@ -# To learn about Buck see [Docs](https://buckbuild.com/). -# To run your application with Buck: -# - install Buck -# - `npm start` - to start the packager -# - `cd android` -# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` -# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck -# - `buck install -r android/app` - compile, install and run application -# - -load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") - -lib_deps = [] - -create_aar_targets(glob(["libs/*.aar"])) - -create_jar_targets(glob(["libs/*.jar"])) - -android_library( - name = "all-libs", - exported_deps = lib_deps, -) - -android_library( - name = "app-code", - srcs = glob([ - "src/main/java/**/*.java", - ]), - deps = [ - ":all-libs", - ":build_config", - ":res", - ], -) - -android_build_config( - name = "build_config", - package = "com.helloworld", -) - -android_resource( - name = "res", - package = "com.helloworld", - res = "src/main/res", -) - -android_binary( - name = "app", - keystore = "//android/keystores:debug", - manifest = "src/main/AndroidManifest.xml", - package_type = "debug", - deps = [ - ":app-code", - ], -) diff --git a/template/android/app/build.gradle b/template/android/app/build.gradle index ea7ea35382b..3a23b468c2d 100644 --- a/template/android/app/build.gradle +++ b/template/android/app/build.gradle @@ -260,13 +260,6 @@ if (isNewArchitectureEnabled()) { } } -// Run this once to be able to run the application with BUCK -// puts all compile dependencies into folder libs for BUCK to use -task copyDownloadableDepsToLibs(type: Copy) { - from configurations.implementation - into 'libs' -} - apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) def isNewArchitectureEnabled() {