diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5ea3845 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build CI + +# Trigger the workflow on push +on: [push] + +jobs: + job1: + name: Android Builds + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Base Setup + run: npm run ci.base.setup + + - name: Lint + run: npm run ci.tslint + + - name: Build Vanilla Android Demo App + run: npm run ci.vanilla.android.build diff --git a/.prettierrc b/.prettierrc index 650cb88..b57da5f 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,6 @@ { "singleQuote": true, - "semi": true + "semi": true, + "arrowParens": "avoid", + "trailingComma": "none" } diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0d0fa9e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,78 +0,0 @@ -branches: - only: - - master -env: - global: - - ANDROID_PACKAGE_JS='seed-js.apk' - - ANDROID_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/outputs - - ANDROID_PACKAGE_NG='seed-ng.apk' - - ANDROID_PACKAGE_FOLDER_NG=$TRAVIS_BUILD_DIR/demo-angular/outputs - - ANDROID_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER" - -matrix: - include: - - stage: "Lint" - language: node_js - os: linux - node_js: "10" - script: cd src && npm run ci.tslint - - stage: "Build and Test" - env: - - BuildAndroid="28" - - NodeJs="8" - - Type="TypeScript" - language: android - dist: trusty - os: linux - jdk: oraclejdk8 - before_install: nvm install 8 - script: - - cd src - - npm run build - - cd ../demo - - tns build android - - env: - - BuildAndroid="28" - - Type="TypeScript" - language: android - dist: trusty - os: linux - jdk: oraclejdk8 - before_install: nvm install 10 - script: - - cd src - - npm run tsc - - cd ../demo - - travis_wait travis_retry tns build android --copy-to "$ANDROID_PACKAGE_FOLDER_JS/$ANDROID_PACKAGE_JS" - - "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_JS?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_JS/$ANDROID_PACKAGE_JS" - - stage: "UI Tests" - env: - - Android="24" - - Type="TypeScript" - language: node_js - os: linux - node_js: "10" - script: - - npm i -g appium - - cd seed-tests && npm i - - travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_JS - - -android: - components: - - tools - - platform-tools - - build-tools-28.0.3 - - android-21 - - 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 \ No newline at end of file diff --git a/README.md b/README.md index d66c19a..167531e 100644 --- a/README.md +++ b/README.md @@ -6,31 +6,33 @@ NativeScript-Wear-OS is a NativeScript plugin that provides layouts and utilitie
--- ## Installation +NativeScript Version 7+: + ```bash tns plugin add nativescript-wear-os ``` +NativeScript version prior to 7: + +```bash +tns plugin add nativescript-wear-os@2.1.1 +``` + --- ### Ambient Mode Support @@ -56,9 +58,9 @@ tns plugin add nativescript-wear-os ```javascript // Add your custom Activities, Services and other Android app components here. const appComponents = [ - 'tns-core-modules/ui/frame', - 'tns-core-modules/ui/frame/activity', - resolve(__dirname, 'app/ambient-activity') + '@nativescript/core/ui/frame', + '@nativescript/core/ui/frame/activity', + resolve(__dirname, 'app/ambient-activity'), ]; ``` @@ -156,7 +158,7 @@ The plugin has a success dialog and failure/error dialog to present on WearOS. T ```typescript import { showFailure, - showSuccess + showSuccess, } from 'nativescript-wear-os/packages/dialogs'; showSuccess('Great choice! NativeScript is awesome.', 4).then(() => { diff --git a/demo/app/ambient-activity.ts b/demo/app/ambient-activity.ts index edda9f0..d453078 100644 --- a/demo/app/ambient-activity.ts +++ b/demo/app/ambient-activity.ts @@ -1,15 +1,13 @@ -///