variants
variants copied to clipboard
A command-line tool to setup deployment variants for iOS and Android, alongside a working CI/CD setup.
Variants
A command line tool to setup deployment variants and working CI/CD setup for mobile projects.
Concept
Variants aims to facilitate the setup and usage of multiple deployment variants for a mobile application (iOS and Android) while also providing a fully working and rich Fastlane setup, with opt-in features for your pipelines. While achieving these goals, it also reduces the amount of sources of truth in your configuration, by relying only on the Variants Spec - a YAML configuration file generated by variants init.
Variants spec - by default located at ./variants.yml, relative to your project's base folder - becomes the sole source of truth and the main configuration file for your needs.
This file is responsible for:
- Specifying how many deployment variants you desire for this project and the differences between these variants (Name, Icon, Identifier, Version, and more with Custom Properties);
- Which store do you want Fastlane to deploy each variant to;
- Signing configuration. Both global (applies to all) and variant specific (overrides global);
- Custom properties. Both global (applies to all) and variant specific (overrides global). Custom properties have different destinations, so that certain properties aren't available to Fastlane but to Project and vice-versa. These can also be sourced from environment variables, perfect for secrets and tokens.
Features
- ✅ Setup your mobile project to have multiple variants of the same application.
- ➡️ Each variant having it's own:
- Name
- Identifier
- Icon
- Version
- Specific tasks and configurations
- Anything really!
- ➡️ Each variant having it's own:
- ✅ Setup CI/CD using fastlane.
- ➡️ Lanes for specific tasks:
- Setup CI
- Create Keychain
- Perform Unit and UI tests
- Lint and format
- Complexity analisys
- Sonar report
- Build and sign application
- Deploy to AppCenter / PlayStore / AppStore
- Many more!
- ➡️ Lanes for specific tasks:
Installation
On Github Actions CI
See Switching Variants on CI for a better understanding and examples.
Homebrew (recommended)
brew install backbase/m/variants
Make
For Linux, make sure you have Swift installed by running
swift --version
git clone https://github.com/backbase/variants.git
cd variants
make install
Swift Package Manager
Use as CLI
git clone https://github.com/backbase/variants.git
cd variants
swift run variants
CLI Usage
For usage and examples see USAGE.
Auto detecting the project's platform
Specifying your project's platform (ios or android) isn't always necessary. Variants is able to detect which platform your project is.
See our Platform Auto Detection for a better understanding and examples.