Skip to content

Conversation

@andrei-zgirvaci
Copy link
Collaborator

@andrei-zgirvaci andrei-zgirvaci commented Dec 5, 2025

Currently, brownfield-gradle-plugin doesn't support flavors. Only the default variants: Debug and Release are supported.

If a different flavor is added, like: FlavorOne, the createBundleReleaseJsAndAssets task won't be executed due to it having a different name now: createBundleFlavorOneReleaseJsAndAssets thus not generating the index.android.bundle.

Moreover, the assets source location for index.android.bundle is also not correctly specified. It should reflect the new flavor: app/build/generated/assets/createBundleFlavorOneReleaseJsAndAssets/ instead of the default variant: app/build/generated/assets/createBundleReleaseJsAndAssets/.

Summary

This PR makes the createBundle...JsAndAssets task and assets source location dynamic, reflecting the actual flavor + build type.

Test plan

These changes has been tested locally using maven local in a React Native brownfield project.

@andrei-zgirvaci andrei-zgirvaci marked this pull request as ready for review December 5, 2025 13:48
@andrei-zgirvaci andrei-zgirvaci changed the title feat: support non default variants feat: support flavors Dec 5, 2025
Copy link
Member

@hurali97 hurali97 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 🚀

@hurali97 hurali97 changed the title feat: support flavors feat: support flavors for JSBundle Dec 8, 2025
Copy link
Collaborator

@artus9033 artus9033 left a comment

Choose a reason for hiding this comment

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

Great job! What remains is just the uppercase var name we need to sort out, otherwise LGTM!

Copy link
Member

@hurali97 hurali97 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the PR 🚀

@andrei-zgirvaci
Copy link
Collaborator Author

andrei-zgirvaci commented Dec 8, 2025

Based on our private conversation with @hurali97, a decision was made to generate and include the JS bundle for both Debug and Release variants. Hence, I have reverted my commits ed8aad5 (#163) & 8b1a169 (#163) which addressed this change: #163 (comment).

# Conflicts:
#	gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/VariantProcessor.kt
Copy link
Member

@hurali97 hurali97 left a comment

Choose a reason for hiding this comment

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

LGTM

@andrei-zgirvaci andrei-zgirvaci merged commit c2cc76e into main Dec 8, 2025
3 of 4 checks passed
@andrei-zgirvaci andrei-zgirvaci deleted the support-flavors branch December 8, 2025 12:39
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.

4 participants