feat: expose Brownfield Gradle Plugin as node module - #359
Conversation
|
Back from vacation. I will be addressing the comments and rebasing today! |
…nfield into feat/expose-bgp-as-node-module
hurali97
left a comment
There was a problem hiding this comment.
LGTM - Just take care of the changeset and we are good!
|
Hey @artus9033, you wanted to have a look at it as well :) |
There was a problem hiding this comment.
Pull request overview
This PR makes the Brownfield Android Gradle Plugin source available inside the published @callstack/react-native-brownfield npm package so consumers can opt into using it via Gradle composite build (includeBuild) from node_modules for local patching, while keeping the Maven artifact as the default path.
Changes:
- Add a
sync-gradle-plugin-source.jsscript and wire it intoprepack/postpackto copy the Gradle plugin source into the npm package and clean it up afterward. - Document the “load from node_modules source” setup in both the Gradle plugin README and the Android integration docs.
- Improve composite build support by adding
pluginManagement.repositoriesin the plugin’ssettings.gradle, plus small Kotlin source/tooling adjustments.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-brownfield/scripts/sync-gradle-plugin-source.js | New script to copy/remove Gradle plugin sources into the package for publishing. |
| packages/react-native-brownfield/package.json | Adds sync:gradle-plugin and hooks sync/cleanup into prepack/postpack; includes gradle-plugin in published files. |
| packages/react-native-brownfield/.gitignore | Ignores the generated gradle-plugin/ directory in the package workspace. |
| gradle-plugins/react/README.md | Documents how to include the plugin build from node_modules. |
| gradle-plugins/react/brownfield/src/main/kotlin/.../ProjectConfigurations.kt | Tightens generic bound for attribute copying (T : Any). |
| gradle-plugins/react/brownfield/settings.gradle | Adds plugin repositories to support composite build plugin resolution. |
| gradle-plugins/react/brownfield/gradle/libs.versions.toml | Bumps Kotlin JVM plugin version. |
| docs/docs/docs/getting-started/android.mdx | Adds “Advanced: Load the Plugin from Node Modules” integration docs. |
| .changeset/brownfield-gradle-plugin-source.md | Declares a minor release for exposing plugin source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Test plan
Check that the npm package contains the Gradle plugin source:
yarn workspace @callstack/react-native-brownfield pack --dry-runCheck that the copied Gradle plugin project can be loaded by Gradle:
Within RNApp
Within Expo55
includeBuild("../node_modules/@callstack/react-native-brownfield/gradle-plugin/brownfield")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}