matrix:
  include:
    - stage: "Lint"
      language: node_js
      os: linux
      node_js: "10"
      script: cd src && npm run ci.tslint
    - stage: "WebPack, Build and Test"
      os: osx
      env:
        - WebPack="iOS"
      osx_image: xcode10.2
      language: node_js 
      node_js: "10"
      jdk: oraclejdk8
      script: cd src && npm run build && cd ../demo && npm i && tns build ios --bundle --env.uglify
    - language: android
      os: linux
      env:
        - WebPack="Android"
      jdk: oraclejdk8
      before_install: nvm install 10
      script: cd src && npm run build && cd ../demo && npm i && tns build android --bundle --env.uglify --env.snapshot
    - language: android
      env: 
        - BuildAndroid="28"
      os: linux
      jdk: oraclejdk8
      before_install: nvm install 10
      script:
        - cd src && npm i && npm run tsc && cd ../demo && tns build android
    - os: osx
      env: 
        - BuildiOS="12"
        - Xcode="10.0"
      osx_image: xcode10.2
      language: node_js 
      node_js: "10"
      jdk: oraclejdk8
      script: 
        - cd src && npm i && npm run tsc && cd ../demo && tns build ios
    - os: linux
      language: android
      dist: precise
      sudo: required
      jdk: oraclejdk8
      before_script:
        - echo no | android create avd --force -n test -t android-21 -b armeabi-v7a
        - emulator -avd test -no-audio -no-window &
        - android-wait-for-emulator
      before_install:
        - nvm install 10
      script: cd src && npm run test.android
    - os: osx
      language: node_js
      node_js: "10"
      jdk: oraclejdk8
      osx_image: xcode10.2
      script: cd src && npm run test.ios

android:
  components:
    - tools
    - platform-tools
    - build-tools-28.0.3
    - android-28
    - extra-android-m2repository
    - sys-img-armeabi-v7a-android-21

before_install:
    - sudo pip install --upgrade pip
    - sudo pip install six

install:
    - echo no | npm install -g nativescript
    - tns usage-reporting disable
    - tns error-reporting disable
