Skip to content

android: replace prefab cache-busting hack with deterministic task wiring#1337

Draft
mrousavy wants to merge 1 commit into
mainfrom
codex/refactor-fix-prefab.gradle-for-nitro-ecosystem
Draft

android: replace prefab cache-busting hack with deterministic task wiring#1337
mrousavy wants to merge 1 commit into
mainfrom
codex/refactor-fix-prefab.gradle-for-nitro-ecosystem

Conversation

@mrousavy

Copy link
Copy Markdown
Owner

Motivation

  • The old fix-prefab.gradle globally disabled up-to-date checks and mutated generated .cxx/**/prefab_config.json timestamps, causing broad Gradle cache invalidation and repeated native reconfiguration/builds.
  • The intent was to ensure prefab packaging runs when the native .so exists for consuming modules; this should be modeled in the Gradle task graph rather than by mutating generated files.

Description

  • Removed the unconditional task.outputs.upToDateWhen { false } override from prefab*ConfigurePackage tasks to avoid forcing non-incremental behavior.
  • Removed logic that touched .cxx/.../prefab_config.json timestamps that caused blanket cache invalidation.
  • Added deterministic wiring so each consumer module's externalNativeBuild<Variant> task depends on this library's prefab<Variant>ConfigurePackage task and declares the prefab task outputs as explicit inputs with PathSensitivity.RELATIVE.
  • Applied these changes to packages/react-native-nitro-modules/android/fix-prefab.gradle, packages/template/android/fix-prefab.gradle, and packages/react-native-nitro-test-external/android/fix-prefab.gradle.

Testing

  • Verified the diff with git diff and inspected the patched files with nl to confirm changes applied; these commands succeeded.
  • Staged and committed the changes with git add and git commit; the commit succeeded with message android: replace prefab cache-busting hack with task input wiring.
  • Created the PR metadata via the repo helper (make_pr) to record the change; that operation completed successfully.

Codex Task

@vercel

vercel Bot commented May 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nitro-docs Ready Ready Preview, Comment May 20, 2026 10:57am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant