diff --git a/android/app/build.gradle b/android/app/build.gradle index 8e23aa667a..5985ef3681 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,6 +1,7 @@ apply plugin: "com.android.application" apply plugin: "org.jetbrains.kotlin.android" apply plugin: "com.facebook.react" +apply plugin: "org.rnrepo.tools.prebuilds-plugin" apply plugin: 'com.google.firebase.crashlytics' diff --git a/android/build.gradle b/android/build.gradle index 4c980840f5..fb1db9a870 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -22,6 +22,14 @@ buildscript { classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") + // RNRepo: substitute supported libraries with prebuilt artifacts + def rnrepoDir = new File( + providers.exec { + workingDir(rootDir) + commandLine("node", "--print", "require.resolve('@rnrepo/build-tools/package.json')") + }.standardOutput.asText.get().trim() + ).getParentFile().absolutePath + classpath fileTree(dir: "${rnrepoDir}/gradle-plugin/build/libs", include: ["prebuilds-plugin.jar"]) } } diff --git a/ios/Podfile b/ios/Podfile index a71b3201cf..c713b3b070 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,6 +1,13 @@ require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods") +# RNRepo: substitute supported libraries with prebuilt xcframeworks +require Pod::Executable.execute_command('node', ['-p', + 'require.resolve( + "@rnrepo/build-tools/cocoapods-plugin/lib/plugin.rb", + {paths: [process.argv[1]]}, +)', __dir__]).strip + platform :ios, '15.1' install! 'cocoapods', :deterministic_uuids => false @@ -58,6 +65,9 @@ post_install do |installer| # :ccache_enabled => true ) + # RNRepo: link prebuilt xcframeworks for substituted libraries + rnrepo_post_install(installer) + installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 651983a647..e42b97c6ae 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -4142,6 +4142,6 @@ SPEC CHECKSUMS: Yoga: 1e91d83a5286cfd3b725eade59274c92270540d4 ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5 -PODFILE CHECKSUM: d05b9b865205e9c845b4e7c288577d4b4ae403ab +PODFILE CHECKSUM: 8364aa6657678cfce3811c7f3f0691c83f481d69 COCOAPODS: 1.15.2 diff --git a/package.json b/package.json index 568a7b80cc..1f62808eb3 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "@react-navigation/elements": "^2.6.1", "@react-navigation/native": "^7.1.16", "@react-navigation/native-stack": "^7.3.23", + "@rnrepo/build-tools": "^0.1.4", "@rocket.chat/media-signaling": "1.0.0-rc.1", "@rocket.chat/message-parser": "0.31.31", "@rocket.chat/mobile-crypto": "RocketChat/rocket.chat-mobile-crypto", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 862110b7d2..02946a8c9a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,6 +81,9 @@ importers: '@react-navigation/native-stack': specifier: ^7.3.23 version: 7.9.0(09d99ebaa1204db714736993fde8843e) + '@rnrepo/build-tools': + specifier: ^0.1.4 + version: 0.1.4 '@rocket.chat/media-signaling': specifier: 1.0.0-rc.1 version: 1.0.0-rc.1 @@ -2434,6 +2437,9 @@ packages: '@redux-saga/types@1.3.1': resolution: {integrity: sha512-YRCrJdhQLobGIQ8Cj1sta3nn6DrZDTSUnrIYhS2e5V590BmfVDleKoAquclAiKSBKWJwmuXTb+b4BL6rSHnahw==} + '@rnrepo/build-tools@0.1.4': + resolution: {integrity: sha512-N2l7BtlBSLkLeBQXFzV71C4oOk0/M/mvJOxxXvmZ4cz+gXCs8vlK5o3J6g8BgiUlgd9ltLS54DZgjLCCJB13lQ==} + '@rocket.chat/emitter@0.32.0': resolution: {integrity: sha512-QCXNGDm5xjJPePMeP9GknMAZne5xhNmLLD/ZVVqNgOyeWdfQKddwBUqtMiWDaFCRq1bC22kNf3WQLqt89CO6fg==} @@ -10455,6 +10461,8 @@ snapshots: '@redux-saga/types@1.3.1': {} + '@rnrepo/build-tools@0.1.4': {} + '@rocket.chat/emitter@0.32.0': {} '@rocket.chat/eslint-config@0.4.0(eslint-plugin-import@2.32.0)(eslint@8.57.1)': diff --git a/rnrepo.config.json b/rnrepo.config.json new file mode 100644 index 0000000000..cc4b9de088 --- /dev/null +++ b/rnrepo.config.json @@ -0,0 +1,19 @@ +{ + "denyList": { + "android": [ + "@lodev09/react-native-true-sheet", + "expo-asset", + "expo-file-system", + "expo-font", + "react-native-callkeep", + "react-native-webview" + ], + "ios": [ + "react-native-callkeep", + "react-native-config-reader", + "react-native-gesture-handler", + "react-native-nitro-modules", + "react-native-webview" + ] + } +}