Introducing full cross-platform support

Bitrise
Bitrise
Jul 27, 2017 · 3 min read

Hoooorray! Now Bitrise supports all major cross-platform and hybrid frameworks!

These frameworks became more and more popular as in some cases it is much easier to develop and maintain 1 code base for all the supported platforms than 1 code base per platform. In addition to iOS, Android, Xamarin, fastlane and macOS, you can choose the following project types for your app on Bitrise:

  • Cordova
  • Ionic
  • React Native

How does it look?

For these project types

  • we developed a list of the most common steps for testing and building your project
  • the new project-types will be detected when you add a new app
  • our scanner will generate an initial bitrise configuration (bitrise.yml) for your app

The scanner tries to generate two workflows for you: one for testing (primary) and another workflow for releasing your app (deploy). (If the scanner does not detect any known testing framework in your repository, you will get only one workflow (primary), which builds your app.)

Ionic and Cordova

In case of Ionic and Cordova, the scanner can detect jasmine and karma-jasmine tests. Using these testing frameworks your workflows will look like this:

primary:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone:
- script:
title: Do anything with Script step
- npm:
inputs:
- command: install
- karma-jasmine-runner: # or jasmine-runner
- deploy-to-bitrise-io:
deploy:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone:
- script:
title: Do anything with Script step
- npm:
inputs:
- command: install
- karma-jasmine-runner: # or jasmine-runner
- generate-cordova-build-configuration:
- cordova-archive: # or ionic-archive
inputs:
- platform: "$CORDOVA_PLATFORM"
- target: emulator
- deploy-to-bitrise-io:

React Native

In case of the React Native project type, the scanner searches for a test script in your package.json file. This is what your workflows will look like:

primary:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- script:
title: Do anything with Script step
- install-react-native: {}
- npm:
inputs:
- workdir: project
- command: install
- npm:
inputs:
- workdir: project
- command: test
- deploy-to-bitrise-io: {}
deploy:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- script:
title: Do anything with Script step
- install-react-native: {}
- npm:
inputs:
- workdir: project
- command: install
- install-missing-android-tools: {}
- gradle-runner:
inputs:
- gradle_file: $GRADLE_BUILD_FILE_PATH
- gradle_task: assembleRelease
- gradlew_path: $GRADLEW_PATH
- certificate-and-profile-installer: {}
- xcode-archive:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- scheme: $BITRISE_SCHEME
- configuration: Release
- deploy-to-bitrise-io: {}

Generating release outputs

For Ionic and Cordova projects we created specific build steps (namely cordova-archive and ionic-archive) which use the framework's command line tools (Ionic and Cordova CLI) to build your project. Both Ionic and Cordova use the Cordova CLI tool to build the project, so you can control the release type with the Cordova build configuration file (build.json), which contains code signing settings for both iOS and Android projects. (Read more on our Discuss pages for Cordova and Ionic release builds.)

For React Native we use our native iOS and Android build steps (xcode-archive and gradle-runner). Read more on our DevCenter for iOS and Android code signing.

The scanner and the steps are open source, so you can always jump in and see how we did it. If you find any issues let us know or even better, send us a pull request! :)

Happy coding! 🚀


Bitrise

Written by

Bitrise

Mobile Continuous Integration and Delivery for your whole team, with dozens of integrations for your favorite services.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade