From 77611846576a3a4a0ac4312f4555927d502f55f3 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:14:24 +0200 Subject: [PATCH] debug native_modules.gradle --- ...atform-android-npm-14.1.1-9c557ebb09.patch | 41 +++++++++++++++++++ android/autolink.gradle | 2 + android/config-plugins.gradle | 2 + android/dependencies.gradle | 2 + android/manifest.gradle | 2 + android/media-types.gradle | 2 + android/node.gradle | 2 + android/react-native.gradle | 2 + android/utils.gradle | 2 + package.json | 5 ++- test-app.gradle | 5 +++ 11 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 .yarn/patches/@react-native-community-cli-platform-android-npm-14.1.1-9c557ebb09.patch diff --git a/.yarn/patches/@react-native-community-cli-platform-android-npm-14.1.1-9c557ebb09.patch b/.yarn/patches/@react-native-community-cli-platform-android-npm-14.1.1-9c557ebb09.patch new file mode 100644 index 000000000..0df8e1ad6 --- /dev/null +++ b/.yarn/patches/@react-native-community-cli-platform-android-npm-14.1.1-9c557ebb09.patch @@ -0,0 +1,41 @@ +diff --git a/native_modules.gradle b/native_modules.gradle +index 218a860c3816731e20109ddc3ec6aeba27eed89f..4a74e37c6d8075c877384dcd409f735df24cd0c3 100644 +--- a/native_modules.gradle ++++ b/native_modules.gradle +@@ -3,6 +3,8 @@ import groovy.transform.CompileStatic + import org.gradle.initialization.DefaultSettings + import org.apache.tools.ant.taskdefs.condition.Os + ++logger.info("Executing 'native_modules.gradle'") ++ + def generatedFileName = "PackageList.java" + def generatedFilePackage = "com.facebook.react" + def generatedFileContentsTemplate = """ +@@ -144,6 +146,8 @@ void rncli_registerProviders(std::shared_ptr diff --git a/android/config-plugins.gradle b/android/config-plugins.gradle index 13ab4c436..8ecb837c7 100644 --- a/android/config-plugins.gradle +++ b/android/config-plugins.gradle @@ -1,5 +1,7 @@ ext.rnta_config_plugins_gradle = true +logger.info("Executing 'config-plugins.gradle'") + if (!hasProperty("rnta_node_gradle")) { apply(from: "${buildscript.sourceFile.getParent()}/node.gradle") } diff --git a/android/dependencies.gradle b/android/dependencies.gradle index 068587090..9cf6d6b53 100644 --- a/android/dependencies.gradle +++ b/android/dependencies.gradle @@ -1,3 +1,5 @@ +logger.info("Executing 'dependencies.gradle'") + if (!hasProperty("rnta_node_gradle")) { apply(from: "${buildscript.sourceFile.getParent()}/node.gradle") } diff --git a/android/manifest.gradle b/android/manifest.gradle index 0af53fa12..bef272ab3 100644 --- a/android/manifest.gradle +++ b/android/manifest.gradle @@ -1,6 +1,8 @@ import groovy.json.JsonSlurper import java.nio.file.Paths +logger.info("Executing 'manifest.gradle'") + def _manifest = null ext.rnta_manifest_gradle = true diff --git a/android/media-types.gradle b/android/media-types.gradle index 4f83c7f97..029bb4082 100644 --- a/android/media-types.gradle +++ b/android/media-types.gradle @@ -1,3 +1,5 @@ +logger.info("Executing 'media-types.gradle'") + ext.rnta_media_types_gradle = true ext.isFontFile = { File file -> diff --git a/android/node.gradle b/android/node.gradle index f768d3b0e..141c0294e 100644 --- a/android/node.gradle +++ b/android/node.gradle @@ -1,6 +1,8 @@ import groovy.json.JsonSlurper import java.nio.file.Paths +logger.info("Executing 'node.gradle'") + ext.rnta_node_gradle = true if (!hasProperty("rnta_utils_gradle")) { diff --git a/android/react-native.gradle b/android/react-native.gradle index 5d807730e..8d4a477a8 100644 --- a/android/react-native.gradle +++ b/android/react-native.gradle @@ -1,5 +1,7 @@ ext.rnta_react_native_gradle = true +logger.info("Executing 'react-native.gradle'") + if (!hasProperty("rnta_node_gradle")) { apply(from: "${buildscript.sourceFile.getParent()}/node.gradle") } diff --git a/android/utils.gradle b/android/utils.gradle index 12e352845..c722b7b14 100644 --- a/android/utils.gradle +++ b/android/utils.gradle @@ -1,6 +1,8 @@ import groovy.json.JsonSlurper import java.nio.file.Paths +logger.info("Executing 'utils.gradle'") + ext.rnta_utils_gradle = true ext.checkEnvironment = { rootDir, testAppDir -> diff --git a/package.json b/package.json index 2a9309e47..ef10dbf56 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,10 @@ "bplist-parser": "~0.3.2", "compression/bytes": "^3.0.0", "express/qs": "^6.13.0", - "safe-buffer": "~5.2.1" + "safe-buffer": "~5.2.1", + "@react-native-community/cli-platform-android@npm:14.0.0": "patch:@react-native-community/cli-platform-android@npm%3A14.1.1#~/.yarn/patches/@react-native-community-cli-platform-android-npm-14.1.1-9c557ebb09.patch", + "@react-native-community/cli-platform-android@npm:14.1.1": "patch:@react-native-community/cli-platform-android@npm%3A14.1.1#~/.yarn/patches/@react-native-community-cli-platform-android-npm-14.1.1-9c557ebb09.patch", + "@react-native-community/cli-platform-android@npm:14.1.0": "patch:@react-native-community/cli-platform-android@npm%3A14.1.1#~/.yarn/patches/@react-native-community-cli-platform-android-npm-14.1.1-9c557ebb09.patch" }, "workspaces": [ "example" diff --git a/test-app.gradle b/test-app.gradle index 6c57b056b..f5cc9a9b0 100644 --- a/test-app.gradle +++ b/test-app.gradle @@ -9,14 +9,19 @@ apply(from: "${testAppDir}/android/autolink.gradle") apply(from: "${testAppDir}/android/config-plugins.gradle") apply(from: "${testAppDir}/android/media-types.gradle") +logger.info("Check environment") checkEnvironment(rootDir, testAppDir) +logger.info("Apply config plugins") applyConfigPlugins(rootDir, testAppDir) +logger.info("Look for RN") def reactNativeDir = file(findNodeModulesPath("react-native", rootDir)) def cliAndroidDir = findNodeModulesPath("@react-native-community/cli-platform-android", reactNativeDir) +logger.info("Autolinking") apply(from: "${cliAndroidDir}/native_modules.gradle") +logger.info("Autolinking done") ext.applyTestAppSettings = { DefaultSettings settings -> settings.include(":app") settings.include(":support")