Skip to content

feat: expose Brownfield Gradle Plugin as node module#359

Open
MrMuzyk wants to merge 5 commits into
callstack:mainfrom
MrMuzyk:feat/expose-bgp-as-node-module
Open

feat: expose Brownfield Gradle Plugin as node module#359
MrMuzyk wants to merge 5 commits into
callstack:mainfrom
MrMuzyk:feat/expose-bgp-as-node-module

Conversation

@MrMuzyk
Copy link
Copy Markdown

@MrMuzyk MrMuzyk commented Jun 1, 2026

Summary

  • Include the Brownfield Android Gradle Plugin source in the published @callstack/react-native-brownfield package
  • Add a script that copies the Gradle plugin source into the package before publishing and removes the copy afterwards
  • Document the node_modules setup as an advanced option for local patching
  • Keep the Maven dependency as the default and recommended setup
  • Add missing repository declarations to the Gradle plugin's settings.gradle to support composite build resolution
  • Bump Kotlin compiler to 2.2.21 for Gradle 9.x compatibility
  • Fix VariantProcessor.kt nullability — mustRunAfter requires non-null under Kotlin 2.2
  • Add a changeset

Test plan

Check that the npm package contains the Gradle plugin source:
yarn workspace @callstack/react-native-brownfield pack --dry-run

image

Check that the copied Gradle plugin project can be loaded by Gradle:

yarn workspace @callstack/react-native-brownfield sync:gradle-plugin
./gradle-plugins/react/gradlew -p packages/react-native-brownfield/gradle-plugin/brownfield tasks
yarn workspace @callstack/react-native-brownfield sync:gradle-plugin --clean

Within RNApp

  1. Remove classpath("com.callstack.react:brownfield-gradle-plugin:") from android/build.gradle
  2. Add to android/settings.gradle inside pluginManagement:
  includeBuild("../node_modules/@callstack/react-native-brownfield/gradle-plugin/brownfield")
  repositories {
      google()
      mavenCentral()  
      gradlePluginPortal()
  }
  1. Run ./gradlew :BrownfieldLib:assembleDebug
  2. Verify > Task :brownfield:compileKotlin appears in the output — this confirms the plugin was compiled from node_modules source rather than downloaded from Maven Central
  3. Verify BUILD SUCCESSFUL

Within Expo55

  1. Run expo prebuild --platform android --clean in apps/ExpoApp55
  2. In the generated apps/ExpoApp55/android/settings.gradle, add inside the pluginManagement block (after the last includeBuild line, before the closing }):
    includeBuild("../node_modules/@callstack/react-native-brownfield/gradle-plugin/brownfield")
    repositories {
    google()
    mavenCentral()
    gradlePluginPortal()
    }
  3. Run ./gradlew :brownfieldlib:assembleDebug
  4. Verify > Task :brownfield:compileKotlin appears — confirms plugin compiled from node_modules source, not Maven
  5. Verify BUILD SUCCESSFUL
Screenshot 2026-06-03 at 13 45 33 Screenshot 2026-06-03 at 13 45 49

@MrMuzyk MrMuzyk marked this pull request as ready for review June 3, 2026 13:45
@artus9033 artus9033 changed the title feat: expose bgp as node module feat: expose Brownfield Gradle Plugin as node module Jun 3, 2026
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.

2 participants