Build File

Build file for Android and iOS compilation

Specify the following in the build file:

  • Android specific settings
  • iOS specific settings
  • SPM 3rd party packages

Mandatory attributes for preparing a release version of an app

Building an iOS app for release

Apple's app creation process includes signing of its components and generating a provision profile file. Below are the important attributes that need to be set in the build.yaml file before creating an iOS app.

SectionAttribute
provision-profileYour iOS mobileprovision file
certificate:Your iOS certificate
export-method:
ad-hoc
app-store
Choose between ad-hoc and app-store mode. Always set to app-store when deploying for consumption.
supported-interface-orientations:
portrait
upside_down
landscape_left
landscape_right
Use any of its elements to set the orientation of your application on an iPhone device.
device-family:
iphone
ipad
* universal
Specify the platforms on which the application can be used.
plist:
CFBundleShortVersionString
CFBundleVersion
NSLocationWhenInUseUsageDescription
NSCameraUsageDescription
* NSPhotoLibraryUsageDescription
Set CFBundleShortVersionString to store the version number.

Set CFBundleVersion to store the build number.

NSLocationWhenInUseUsageDescription: a notification that explains to users why the app needs access to their location while it is running in the foreground.

NSCameraUsageDescription: Take pictures from camera.

NSPhotoLibraryUsageDescription: Choose a photo from your library.
entitlements-fileSet the path to the .entitlements file.
app-delegate-fileSet the path to the AppDelegate.swift file.
iconsSet the necessary icons for the app.

Building an Android app for release

AttributeDescription
build-type
Debug
Release
Set the build-type to either Debug or Release mode. Always set to Release when deploying for consumption.
key-store-propertiesSet the path to the keystore.properties file
google-api-keySet the API Key for Google Platforms (when needed).
manifest-fileSet the path to the AndroidManifest.xml file
permissions: []Set Android permissions to access any of the user's device's protected features.

Example:
[CAMERA, BLUETOOTH, BLUETOOTH_ADMIN, ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION]
version-nameSet version-name to store the application version.
version-codeSet version-name to store the application version code.
iconsSet the app's appropriate icons.

SPM

AttributeDescription
url
search-paths
linked-libs

Adding extra properties to the Build file to improve Responsiveness and User Experience

Build file with Deep Link information Example

The deep link feature can build impressive mobile app shortcuts to automate tasks and increase overall efficiency. Its idea is to tell apps what links and certain app pages they should detect and open to perform a given task.

A deep link begins with a project-uri and continues with the rest of the link:

                      <project-uri>://<anything-You-Want>

Add this to the plist section of the iOS part of your build file:

plist:
  - key: CFBundleURLTypes
    type: list
    values:
      - type: dict
        values:
          - key: CFBundleURLName
            type: string
            value: project-id
          - key: CFBundleURLSchemes
            type: list
            values:
              - type: string
                value: project-uri

You need to set the values for CFBundleURLName and the CFBundleURLSchemes items array.
For example, we set project-uri as the value for the CFBundleURLSchemes items array.

And also set values to the properties of the intent-filters section of the Android part of your build file:

intent-filters:
  - action: android.intent.action.VIEW
    scheme: project-uri
    categories: [android.intent.category.DEFAULT, android.intent.category.BROWSABLE]

The Build file with sample entries

# Build file with examples
spm:
  - url: https://github.com/nicklockwood/Expression
    from: 0.13.1
    path:
    branch:
    exact:
    revision: 
    search-paths: []
    linked-libs: []

search-paths: []
linked-libs: []

# Search paths for 
search-paths: []
linked-libs: [Expression] 

# IOS specific settings
ios:
  name: m1
  id: com.scade.m1
  device-family: iphone # iphone, ipad or universal
  supported-interface-orientations: ['portrait'] # portrait, upside_down, landscape_left or landscape_right
  supported-interface-orientationsiPad: ['portrait']
  entitlements-file: 
  app-delegate-file:
  simulator:
    os: 12.1
    output: m1/.build/ios-simulator
    extra-args:
    search-paths: []
    linked-libs: []
  device: 
    os: 12.1
    output: m1/.build/ios-device
    extra-args: 
    search-paths: []
    linked-libs: []
  mac:
    os: 10.11
    output: m1/.build/scade-simulator
    extra-args: 
    search-paths: []
    linked-libs: []
  # Please specify your mobileprovision file and your security certificate
  sign:
    provision-profile: /Users/flangel/certs/FrankBlackDeviceDev.mobileprovision
    certificate: /Users/flangel/certs/FrankBlackDeviceDevPrivate2.p12
  icons:
    iphone: # or ipad, sizes: 20X20, 29X29, 40X40, 60X60, 76X76, 83.5X83.5
      60X60_2X: ./res/icon1.png
      76X76_2X:
      76X76_3X:
      83.5X83.5_2X:
    marketing:
      1024X1024_1X:
  plist:
    CFBundleShortVersionString: string# 1.0
    CFBundleVersion: string# 1
    NSLocationWhenInUseUsageDescription:
    NSCameraUsageDescription: Take pictures from camera
    NSPhotoLibraryUsageDescription: Choose a photo from your library
  - key: CFBundleURLTypes
    type: list
    values:
      - type: dict
        values:
          - key: CFBundleURLName
            type: string
            value: com.Scade.UgSystemDemo
          - key: CFBundleURLSchemes
            type: list
            values:
              - type: string
                value: scadedeeplink

# Android specific settings
android:
  name: m1
  id: com.scade.m1
  version-name: 1.0.0
  version-code: 1
  build-type: Debug
  key-store-properties:
  google-api-key: 
  manifest-file:
  permissions: []
  armeabi-v7a:
    output: m1/.build/android-armeabi-v7a
    product-path: m1/Product/android-armeabi-v7a
    extra-args:
    search-paths: []
    linked-libs: []
  arm64-v8a:
    output: m1/.build/android-arm64-v8a
    product-path: m1/Product/android-arm64-v8a
    extra-args:
    search-paths: []
    linked-libs: []
  x86:
    output: m1/.build/android-x86
    product-path: m1/Product/android-x86
    extra-args:
    search-paths: []
    linked-libs: []
  x86_64:
    output: m1/.build/android-x86_64
    product-path: m1/Product/android-x86_64
    extra-args:
    search-paths: []
    linked-libs: []
  intent-filters:
  - action: android.intent.action.VIEW
    scheme: scadedeeplink
    categories: [android.intent.category.DEFAULT, android.intent.category.BROWSABLE]
  icons:
    mdpi: ./res/icon1.png
    hdpi:
    xhdpi: 
    xxhdpi: