Build configuration

How to configure build settings for your app

In the Build page, you can define various build settings for your project. Depending on the app platform identified when scanning a branch in your project, the labels of some fields may be different from the screenshot below.

This guide covers:

Read more about building feature branches for repositories hosted on GitHub, Bitbucket and GitLab.

General build settings

  • Enable automatic builds — if enabled, builds will be triggered automatically when new code is committed.
  • Enable builds on tag push — if enabled, builds will be triggered automatically for every tagged commit you make. Note that you must also enable automatic builds to use this feature.
  • Cancel pending builds — if enabled, Nevercode will automatically cancel all ongoing and queued builds triggered by webhooks on a branch when you have triggered a new build for the same branch. We recommend enabling automatic cancelling of builds when you're making several commits, each of which triggers a build. Otherwise, you may end up waiting for the triggered builds to be run while you only need the build triggered by the latest commit.
Configuring general build settings

Configuring general build settings

Setting up scheduled builds

You can schedule Nevercode to automatically build your app on certain days and time. This way, your QA can start the day with the latest version of the app, or you can configure a workflow to run the long test suits at a convenient time and only run fast tests with builds triggered by commits to the repo.

To set up scheduled builds:

  1. Select the day(s) you want to run the build.
  2. Specify the start time of the build (UTC).
  3. Check Enable and click Save schedule to finish the setup.
Enabling scheduled builds

Enabling scheduled builds

Defining iOS build settings

If you are using Cocoapods to manage the dependencies of your project, please refer to the page on Using CocoaPods before continuing to read this section.

  1. Select a project or a workspace. Projects are containers for code, resources and different build settings. Workspaces are containers of different projects.
  2. Based on the previous selection of project or workspace, you will need to select either a Target (projects) or a Scheme (workspaces).

Defining Android build settings

  1. Select a project in the Project dropdown.

The Project is an Android app directory in your repository or the repository root. Project, in a sense, is a container for one or more app flavors. Usually, there is only one project in the repository, but there might be more, for example when you have a library project and a sample app that uses this library.

  1. Select a gradle task that will be used to build your app in the Task dropdown.

The easiest choice there is to pick the assemble task which builds every possible configuration of your app at once. If you have some specific flavor you want to be built, say ExampleFlavor, then just select assembleExampleflavor and you're ready to go.

Defining Cordova build settings

  1. Select a project from the Project dropdown. The project selection here means a directory in your repository where the Cordova configuration file config.xml is stored.
  2. Select an option in Configuration dropdown, so Nevercode will know whether to build the debug or the release version of your app.
  3. Select the platform for which you'd like to build your app (Android or iOS, or for both platforms).

Cordova project structure

To identify an app as Cordova, Nevercode looks for a "signature" comprised of 2 components. The config.xml file will be present by default in any project that began its life as Cordova. However, if you are converting e.g. a Phonegap project to Cordova, please be sure to address all the points below before adding your project to Nevercode.

  • Cordova namespace must be correctly specified in the config.xml file in the root folder of your project. Here's what this looks like:
    <widget id="com.your.project" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

  • There must be no ionic.project or ionic.config.json file in the root folder of you project. This won't be something you'll have to worry about unless you are converting your project from Ionic to Cordova. However, this file is the only distinguishing feature between Ionic and Cordova projects, which is why this is part of the Cordova "signature".

Defining Ionic build settings

Ionic project structure

To identify an app as Ionic, Nevercode looks for a "signature" comprised of 2 components. Note that for Ionic 2 both these steps are generated automatically when you add a new app with ionic start command. If apps are created with older Ionic versions, you'd need to provide one extra step.

  • Ionic namespace must be correctly specified in the config.xml file in the root folder of your project. Here's what this looks like:
    <widget id="com.your.project" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

  • The presence of the ionic.project or ionic.config.json file in the root folder of you project. This file is not created immediately after a new Ionic one project is started from the CLI. You could add it manually, but even though it’s tiny and simple, why not let Ionic do it for you: just run ionic serve from your project’s folder. This will open a browser window in which you can see your shiny new app, but more importantly, it will create the ionic.project file. Don't forget to add it to source control and commit.

If your project began its life as Ionic, and you've run ionic serve, then everything should be in place. However, users who are converting their existing projects to Ionic (we usually see this with Cordova and PhoneGap projects) need to take extra care to ensure that all these elements of the Ionic "signature" are present and committed to source control before adding their project to Nevercode.

  1. Select a branch from the dropdown that Nevercode should scan. Note that you can change the branch later if needed.
  2. Click Scan branch. Nevercode scans the repository from the specified branch. This includes cloning the repository, looking for projects from it and searching for the configurations.

Defining React Native build settings

React Native project structure

To identify an app as React Native, Nevercode looks for package.json file from your repository that has react-native listed under dependencies. Nevercode expects that the Android and iOS specific code is stored in the default locations, that is in android and ios subdirectories.

In case your app was added with the standard create-react-native-app MyProjectName, you should be good to go.

  1. Select a project or a workspace. The project selection here means a directory in your repository where your React Native configuration file package.json is stored.
  2. Select an option in Configuration dropdown, so Nevercode knows whether to build either debug or release version of your app.
  3. Select the platform for which you'd like to build your app (Android or iOS, or for both platforms).