Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
8 changes: 8 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Comment on lines +25 to +32

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Does @rnrepo/build-tools0.1.4 honorDISABLE_RNREPO=1 before Gradle/CocoaPods plugin initialization, or only after the plugins have already been resolved/applied?

💡 Result:

Answer: Based on the official rnrepo documentation, DISABLE_RNREPO is checked to “completely skip the RNRepo plugin setup” for a given build, rather than only disabling individual downloads later. The docs indicate that when DISABLE_RNREPO is set (to any value), the plugin will not execute at all for that Gradle/CocoaPods run—so it prevents the RNRepo plugin’s behavior from running during that build lifecycle, not merely after the plugin has already been resolved/applied. Evidence: - The troubleshooting guide states: “If this variable is set to ANY value, the plugin will not execute.” [1] - It further says: “This environment variable takes precedence and will completely skip the RNRepo plugin setup regardless of the Gradle task being executed.” [1] Important nuance: - The documentation confirms “skip setup/execute” behavior, but it does not spell out the exact implementation order relative to Gradle plugin resolution/application phases (i.e., whether the code path avoids all work immediately upon init vs. after the Gradle/CocoaPods plugin entrypoint is invoked). It only guarantees that the plugin won’t execute / setup when DISABLE_RNREPO is set. [1] For reference, official setup/testing commands show using DISABLE_RNREPO with Gradle commands like assembleDebug. [2]

Citations:


Gate rnrepo build-tools resolution/classpath wiring behind DISABLE_RNREPO
@rnrepo/build-tools docs state that when DISABLE_RNREPO is set to any value, the plugin “will not execute / completely skip the RNRepo plugin setup.” However, android/build.gradle still unconditionally runs require.resolve('@rnrepo/build-tools/package.json') and adds prebuilds-plugin.jar to the buildscript classpath during Gradle configuration. That means the documented opt-out may skip plugin behavior, but it does not avoid requiring @rnrepo/build-tools/the jar to be present and resolvable at configuration time—potentially undermining the “source-only” escape hatch.
Wrap the rnrepoDir resolution and classpath fileTree(...) registration in a DISABLE_RNREPO check.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@android/build.gradle` around lines 25 - 32, Wrap the rnrepo resolution and
classpath registration so they are skipped when DISABLE_RNREPO is set: surround
the providers.exec(...) call that sets rnrepoDir and the subsequent classpath
fileTree("${rnrepoDir}/gradle-plugin/build/libs", ...) line with a guard like if
(!System.getenv('DISABLE_RNREPO')) { ... } (or the equivalent Gradle/Groovy
null-check) so require.resolve('`@rnrepo/build-tools/package.json`') is not
invoked and the prebuilds-plugin.jar is not added to the buildscript classpath
when DISABLE_RNREPO is present.

}
}

Expand Down
10 changes: 10 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4142,6 +4142,6 @@ SPEC CHECKSUMS:
Yoga: 1e91d83a5286cfd3b725eade59274c92270540d4
ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5

PODFILE CHECKSUM: d05b9b865205e9c845b4e7c288577d4b4ae403ab
PODFILE CHECKSUM: 8364aa6657678cfce3811c7f3f0691c83f481d69

COCOAPODS: 1.15.2
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions rnrepo.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"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-webview"
]
}
}
Loading