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
Section titled “Install”Add @brandingbrand/code-plugin-fastlane as a development dependency to your React Native project.
yarn add --dev @brandingbrand/code-plugin-fastlanenpm install --save-dev @brandingbrand/code-plugin-fastlanepnpm add --save-dev @brandingbrand/code-plugin-fastlanebun add --dev @brandingbrand/code-plugin-fastlaneYour 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
Section titled “Configure”Flagship Code Configuration
Section titled “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", preset: "@brandingbrand/code-preset-react-native", 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
Section titled “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 CodePresetReactNative } from "@brandingbrand/code-preset-react-native";import { type CodePluginFastlane } from "@brandingbrand/code-plugin-fastlane";
export default defineBuild<CodePresetReactNative & 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
Section titled “Options”codePluginFastlane.plugin.ios.appCenter
Section titled “codePluginFastlane.plugin.ios.appCenter”type: AppCenterIOS
Optional iOS AppCenter configuration.
AppCenterIOS
Section titled “AppCenterIOS”organization
Section titled “organization”type: string
required
The organization name in App Center.
appName
Section titled “appName”type: string
required
The name of the app in App Center.
destinationType
Section titled “destinationType”type: "group" | "store"
required
The type of distribution destination.
destinations
Section titled “destinations”type: string[]
required
Array of distribution destinations.
codePluginFastlane.plugin.ios.firebase
Section titled “codePluginFastlane.plugin.ios.firebase”FirebaseIOS
Section titled “FirebaseIOS”type: `“string”
required
The Firebase app id.
groups
Section titled “groups”type: string[]
required
Array of distribution groups.
resetBuildOnVersionChange
Section titled “resetBuildOnVersionChange”type: boolean
optional
Will reset the build version to 1 whenever the version retrieved from firebase is different then local build number. Default behavior is to reset.
codePluginFastlane.plugin.android.appCenter
Section titled “codePluginFastlane.plugin.android.appCenter”type: AppCenterAndroid
Optional Android AppCenter configuration.
AppCenterAndroid
Section titled “AppCenterAndroid”organization
Section titled “organization”type: string
required
The organization name in App Center.
appName
Section titled “appName”type: string
required
The name of the app in App Center.
destinationType
Section titled “destinationType”type: "group" | "store"
required
The type of distribution destination.
destinations
Section titled “destinations”type: string[]
required
Array of distribution destinations.
codePluginFastlane.plugin.android.firebase
Section titled “codePluginFastlane.plugin.android.firebase”FirebaseAndroid
Section titled “FirebaseAndroid”type: `“string”
required
The Firebase app id.
groups
Section titled “groups”type: string[]
required
Array of distribution groups.
resetBuildOnVersionChange
Section titled “resetBuildOnVersionChange”type: boolean
optional
Will reset the build version to 1 whenever the version retrieved from firebase is different then local build number. Default behavior is to NOT reset.