Usage with Brownfield package
The brownfield CLI provides utilities for building & packaging artifacts for brownfield projects that use the @callstack/react-native-brownfield library.
Usage
iOS
Build for iOS
Simply run npx brownfield package:ios to create an XCFramework that you can later integrate into your native iOS app according to other instruction sections below.
Available arguments:
The build directory will be placed in the <iOS project folder>/.brownfield/build folder by default and the build outputs (XCFrameworks) will be created in the <iOS project folder>/.brownfield/package folder:
package/<scheme name>.xcframework, e.g. in theapps/RNAppdemo project, the output will be atapps/RNApp/ios/.brownfield/package/BrownfieldLib.xcframework.package/hermesvm.xcframeworkfor RN >= 0.82.0 orpackage/hermes.xcframeworkotherwiseReactBrownfield.xcframework
The consumer project needs to embed all 3 frameworks.
Android
For Android, building happens in two steps: first, you build (brownfield package:android) the AAR artifact(s) with your module, in the appropriate build variant(s), and then you brownfield publish:android them to Maven local.
From there, native applications can consume your library from the local Maven repository.
Build for Android
To build the artifact for Android without publishing, run npx brownfield package:android --module-name app.
Available arguments:
Publish locally for Android
To publish the .aar(s) built beforehand with npx brownfield publish:android to Maven local, which will allow Gradle to be able to load it from Maven local repository, run:
npx brownfield publish:android --module-name app
