Skip to content

fix(android): support Gradle configuration cache - #317

Open
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/241-gradle-configuration-cache
Open

fix(android): support Gradle configuration cache#317
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/241-gradle-configuration-cache

Conversation

@huytdps13400

Copy link
Copy Markdown

Summary

Fixes #241.

  • replace Groovy Process.execute() package resolution with Gradle鈥檚 configuration-cache-aware providers.exec()
  • track both React Native and optional react-native-nitro-sqlite-vec resolver outputs as configuration inputs
  • preserve the existing monorepo fallback, explicit REACT_NATIVE_NODE_MODULES_DIR override, and vec resolution error

Gradle documents providers.exec { ... }.standardOutput.asText.get() as the supported API when configuration-time process output is required: https://docs.gradle.org/current/userguide/configuration_cache_requirements.html#config_cache:requirements:external_processes

Test plan

Red

./gradlew :react-native-nitro-sqlite:tasks --configuration-cache --no-daemon failed to store the cache with two problems:

  1. external node process resolving react-native/package.json
  2. external node process resolving react-native-nitro-sqlite-vec/package.json

Green

  • the same task stored the configuration cache successfully, then the next invocation reported Reusing configuration cache
  • :react-native-nitro-sqlite:assembleDebug --configuration-cache completed the Android/CMake build, stored the cache, and a subsequent invocation reported Configuration cache entry reused
  • bun typecheck
  • bun sqlite build
  • bun lint
  • git diff --check

Existing test-infrastructure issue

bun sqlite test stops in Jest configuration before collecting tests because the current RN 0.85 dependency moved the preset from react-native to @react-native/jest-preset. This is reproducible on unchanged main and is unrelated to the Gradle-only diff.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incompatible with Gradle Configuration Cache (Build Fails)

1 participant