-
Notifications
You must be signed in to change notification settings - Fork 44
feat: expose Brownfield Gradle Plugin as node module #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
artus9033
merged 10 commits into
callstack:main
from
MrMuzyk:feat/expose-bgp-as-node-module
Jun 17, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4a176e0
feat: expose bgp as node module
MrMuzyk ccc8ee2
feat: small readme update
MrMuzyk 7497ab3
fix: bump koltin and update docs
MrMuzyk f2e8fd2
fix: sync-gradle-plugin-source script to ignore additional paths
artus9033 997b629
chore: gitignore files copied by sync-gradle-plugin-source
artus9033 fc1cd32
Merge branch 'main' of https://github.com/callstack/react-native-brow…
MrMuzyk a8cdf09
fix: after conflicts
MrMuzyk c278b93
fix: typings
MrMuzyk 27c8236
feat: update changeset to minor
MrMuzyk 478ab5d
fix: some final cr fixes
MrMuzyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@callstack/react-native-brownfield': minor | ||
| --- | ||
|
|
||
| Expose the Brownfield Android Gradle Plugin source from the npm package for opt-in local patching. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| pluginManagement { | ||
| repositories { | ||
| google() | ||
| mavenCentral() | ||
| gradlePluginPortal() | ||
| } | ||
| } | ||
|
MrMuzyk marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /gradle-plugin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
packages/react-native-brownfield/scripts/sync-gradle-plugin-source.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /** | ||
| * Copies the Brownfield Gradle plugin source from gradle-plugins/react/brownfield/ | ||
| * into packages/react-native-brownfield/gradle-plugin/brownfield/ so that the | ||
| * plugin source is included in the published npm package. | ||
| * | ||
| * This enables consumers to use the plugin as a composite build via includeBuild | ||
| * from node_modules instead of downloading it from Maven Central — useful for | ||
| * local patching or working with an unreleased version. | ||
| * | ||
| * Run with --clean to remove the copied output (e.g. after publishing or testing). | ||
| * | ||
| * Usage: | ||
| * node sync-gradle-plugin-source.js # copy | ||
| * node sync-gradle-plugin-source.js --clean # remove | ||
| */ | ||
| const fs = require('node:fs'); | ||
|
MrMuzyk marked this conversation as resolved.
|
||
| const path = require('node:path'); | ||
|
|
||
| const packageRoot = path.resolve(__dirname, '..'); | ||
| const repoRoot = path.resolve(packageRoot, '..', '..'); | ||
|
|
||
| const sourceBrownfieldPath = path.join( | ||
| repoRoot, | ||
| 'gradle-plugins', | ||
| 'react', | ||
| 'brownfield' | ||
| ); | ||
|
|
||
| const targetRoot = path.join(packageRoot, 'gradle-plugin'); | ||
| const targetBrownfieldPath = path.join(targetRoot, 'brownfield'); | ||
|
|
||
| if (process.argv.includes('--clean')) { | ||
| // Remove the copied gradle-plugin directory from the package | ||
| fs.rmSync(targetRoot, { recursive: true, force: true }); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| if (!fs.existsSync(sourceBrownfieldPath)) { | ||
| console.error(`Error: Source path not found: ${sourceBrownfieldPath}`); | ||
| console.error('This script must be run from within the monorepo.'); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| // Always start from a clean slate to avoid stale files | ||
| fs.rmSync(targetRoot, { recursive: true, force: true }); | ||
|
|
||
| fs.cpSync(sourceBrownfieldPath, targetBrownfieldPath, { | ||
| recursive: true, | ||
| // Exclude Gradle build artefacts and local state that should not be shipped | ||
| filter(source) { | ||
| const relativePath = path.relative(sourceBrownfieldPath, source); | ||
| const parts = relativePath.split(path.sep); | ||
|
|
||
| return !parts.some((part) => | ||
| ['build', '.gradle', 'local.properties', '.kotlin', 'bin'].includes(part) | ||
| ); | ||
| }, | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.