plugin-fastlane
The “plugin-fastlane” package assumes a pivotal role within the Flagship Code ecosystem, meticulously crafted to expedite the generation of a Fastlane configuration. Leveraging Fastlane’s versatility, it orchestrates distinct “lanes” tailored to diverse use cases. For instance, it seamlessly orchestrates a “compile” lane for non-code-signing tasks and a “build” lane dedicated to code signing, specifically catered to iOS projects. Moreover, this plugin extends compatibility with AppCenter distribution, enriching its functionality for developers who fulfill the interface requirements. By seamlessly integrating with Fastlane and extending support for AppCenter distribution, it empowers developers to automate and streamline their deployment workflows, fostering enhanced efficiency and reliability in the software delivery process.
Install
Add @brandingbrand/code-plugin-fastlane
as a development dependency to your React Native project.
yarn add --dev @brandingbrand/code-plugin-fastlane
npm install --save-dev @brandingbrand/code-plugin-fastlane
pnpm add --save-dev @brandingbrand/code-plugin-fastlane
bun add --dev @brandingbrand/code-plugin-fastlane
Your package.json should now be updated, @brandingbrand/code-plugin-fastlane
should be listed as a devDependency
.
{ "name": "my-awesome-app", "version": "1.0.0", "author": "Your Name <email@example.com>", "dependencies": { "react": "^18.2.0", "react-native": "~0.72.0" }, "devDependencies": { "@brandingbrand/code-plugin-fastlane": "2.0.0" }}
Configure
Flagship Code Configuration
Upon installing the dependency, it is imperative to update the flagship-code.config.ts
file. Specifically, ensure that the plugins
array includes the newly installed dependency. This step is crucial, as Flagship Code will only invoke the plugin if it is listed within this array. By including the dependency in the plugins
array, you enable Flagship Code to recognize and utilize the functionality provided by the plugin during project execution.
import { defineConfig } from "@brandingbrand/code-cli-kit";
export default defineConfig({ buildPath: "./coderc/build", envPath: "./coderc/env", pluginPath: "./coderc/plugins", plugins: [ // other plugins "@brandingbrand/code-plugin-fastlane", ],});
For more detailed guidance and information, please refer to the Flagship Code Configuration guide. This resource offers comprehensive instructions and insights to assist you in configuring Flagship Code effectively.
Build Configuration
Depending on the plugin, there might be additional configuration required. Regarding the plugin-fastlane
, there’s an optional additional build configuration feature available to extend your Fastlane setup. Presently, the only extensions supported are for uploads to AppCenter and/or Firebase App Distribution. Providing configuration for either services will prompt the plugin to update your Fastlane setup accordingly.
For the purpose of illustration, the build.internal.ts
configuration shall be presented as follows if you want to include both AppCenter and Firebase App Distribution uploads:
import { defineBuild } from "@brandingbrand/code-cli-kit";import { type CodePluginFastlane } from "@brandingbrand/code-plugin-fastlane";
export default defineBuild<CodePluginFastlane>({ ios: { bundleId: "com.brandingbrand", displayName: "Branding Brand", }, android: { packageName: "com.brandingbrand", displayName: "Branding Brand", }, codePluginFastlane: { plugin: { ios: { appCenter: { organization: "Branding Brand", appName: "MyApp-iOS", destinationType: "group", destinations: ["iat"], }, firebase: { appId: '1234', groups: ['iat'], }, }, android: { appCenter: { organization: "Branding Brand", appName: "MyApp-Android", destinationType: "group", destinations: ["iat"], }, firebase: { appId: '4321', groups: ['iat'], }, }, }, },});
Options
codePluginFastlane.plugin.ios.appCenter
type: AppCenterIOS
Optional iOS AppCenter configuration.
AppCenterIOS
organization
type: string
required
The organization name in App Center.
appName
type: string
required
The name of the app in App Center.
destinationType
type: "group" | "store"
required
The type of distribution destination.
destinations
type: string[]
required
Array of distribution destinations.
codePluginFastlane.plugin.ios.firebase
FirebaseIOS
appId
type: `“string”
required
The Firebase app id.
groups
type: string[]
required
Array of distribution groups.
codePluginFastlane.plugin.android.appCenter
type: AppCenterAndroid
Optional Android AppCenter configuration.
AppCenterAndroid
organization
type: string
required
The organization name in App Center.
appName
type: string
required
The name of the app in App Center.
destinationType
type: "group" | "store"
required
The type of distribution destination.
destinations
type: string[]
required
Array of distribution destinations.
codePluginFastlane.plugin.android.firebase
FirebaseAndroid
appId
type: `“string”
required
The Firebase app id.
groups
type: string[]
required
Array of distribution groups.