fix: brownfield Gradle Plugin not to depend on *UpdatesResources task from expo-updates if absent#401
fix: brownfield Gradle Plugin not to depend on *UpdatesResources task from expo-updates if absent#401artus9033 wants to merge 5 commits into
Conversation
… from expo-updates if absent
There was a problem hiding this comment.
Pull request overview
This PR updates the Brownfield Gradle plugin to avoid hard-depending on Expo Updates’ *UpdatesResources task when that task is not present, preventing Gradle task dependency resolution failures in Expo projects that don’t include expo-updates.
Changes:
- Make the plugin’s dependency on
create<Variant>UpdatesResourcesconditional on the task actually existing. - Bump the Brownfield Gradle plugin version (and related snapshot/version references) from
2.0.0-alpha02to2.0.0-alpha03. - Add a changeset entry for the patch and update release-notes test fixtures for the new version tag.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/tests/generate-brownfield-gradle-plugin-release-notes.test.ts | Updates prerelease tag fixture and formatting to reflect the new alpha version. |
| packages/react-native-brownfield/src/expo-config-plugin/android/utils/constants.ts | Bumps the referenced Gradle plugin version used by the Expo config plugin. |
| gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/VariantTaskProvider.kt | Makes the *UpdatesResources dependency conditional to handle absence of expo-updates. |
| gradle-plugins/react/brownfield/gradle.properties | Bumps the Gradle plugin’s published version to 2.0.0-alpha03. |
| apps/scripts/prepare-android-build-gradle-for-ci.ts | Updates the snapshot version used for CI gradle preparation. |
| apps/RNApp/android/build.gradle | Updates the classpath snapshot version reference. |
| .changeset/fair-swans-remain.md | Adds a changeset documenting the fix as a patch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| val updatesResourcesTaskName = | ||
| "create${capitalizedBundledAssetsVariantName}UpdatesResources" | ||
|
|
||
| appProject.tasks | ||
| .matching { it.name == updatesResourcesTaskName } | ||
| .configureEach { updatesTask -> | ||
| preBuildTask.dependsOn(updatesTask) | ||
| } |
There was a problem hiding this comment.
The SDK 56 PR contains this fix with also addressing the SourceSets part for Expo resources.
See:
We can either pull those changes in this PR or close this PR in favor of that
There was a problem hiding this comment.
I see. Then, maybe we can pull it in from here? That PR may still take some time, while here we have it ready right away. May help us with other initiatives.
There was a problem hiding this comment.
Yes, absolutely. You can take these two changes that I shared from that PR and pull in here, we can then merge this one first.
Summary
If using Expo and
expo-updatesis absent, the following error will be thrown:The solution is to depend on it only if it exists to cover use cases without expo-updates.