Skip to content

Commit

Permalink
feat(TNS5): Support for NativeScript 5
Browse files Browse the repository at this point in the history
  • Loading branch information
hypery2k committed Feb 2, 2019
1 parent 34046c4 commit 614054b
Show file tree
Hide file tree
Showing 198 changed files with 34,737 additions and 1,699 deletions.
51 changes: 37 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ pids
*.pid
*.seed

tmp/

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

Expand All @@ -18,24 +16,49 @@ coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
# Users Environment Variables
.lock-wscript

# OS generated files #
.DS_Store
ehthumbs.db
Icon?
Thumbs.db

# Node Files #
/node_modules
/src/app/node_modules
/bower_components

# Coverage #
/coverage/

# Typing #
/src/typings/tsd/
/typings/
/tsd_typings/

# IDE files
.project
.idea/

# generated files and folders
samples/angular/app/*.js*
samples/angular/app/tests/*.js*
samples/angular/hooks/
samples/angular/lib/
samples/angular/node_modules/
samples/angular/platforms/
tmp/
publish/package/
publish/node_modules/
src/node_modules/
demo-angular/app/*.js*
demo-angular/app/tests/*.js*
demo-angular/hooks/
demo-angular/lib/
demo-angular/node_modules/
demo-angular/platforms/
demo/app/*.js*
demo/app/tests/*.js*
demo/hooks/
demo/lib/
demo/node_modules/
demo/platforms/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v10
188 changes: 112 additions & 76 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,116 @@
os: osx
osx_image: xcode8.3
sudo: false
language: objective-c

env:
global:
- API=19 # Google API 19 by default
- TAG=google_apis # Google APIs by default, alternatively use default
- ABI=armeabi-v7a # ARM ABI v7a by default
matrix:
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="2.5.5"
- NODE_VERSION="7" NPM_VERSION="3" TNS_VERSION="2.5.5"
- NODE_VERSION="7" NPM_VERSION="4" TNS_VERSION="2.5.5"
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="3.0.3"
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="3.0.3"
- NODE_VERSION="7" NPM_VERSION="4" TNS_VERSION="3.0.3"
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="3"
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="3"
- NODE_VERSION="7" NPM_VERSION="4" TNS_VERSION="3"
global:
- EMULATOR_NAME=test
- ANDROID_API_LEVEL=28
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
- ANDROID_ABI=armeabi-v7a
- ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)

matrix:
include:
- stage: "Lint"
language: node_js
os: linux
node_js: "10"
before_install:
- cd publish && npm run setup-dev-env && cd ..
script: cd src && npm run ci.tslint && npm run build && cd ../demo && npm run ci.tslint && cd ../demo-angular && npm run ci.tslint
- stage: "Webpack and Build"
os: osx
env:
- Webpack="iOS"
- Type="VanillaJS"
osx_image: xcode10.0
language: node_js
node_js: "10"
jdk: oraclejdk8
before_script:
- gem install cocoapods
- gem install xcodeproj
- brew install xcproj
- pod repo update
- sudo pip install six
before_install:
- cd publish && npm run setup-dev-env && cd ..
- cd src && npm i && cd ..
script: cd demo && travis_wait travis_retry npm run build-ios-bundle
- os: osx
env:
- Webpack="iOS"
- Type="Angular"
osx_image: xcode10.0
language: node_js
node_js: "10"
jdk: oraclejdk8
before_script:
- gem install cocoapods
- gem install xcodeproj
- brew install xcproj
- pod repo update
- sudo pip install six
before_install:
- cd publish && npm run setup-dev-env && cd ..
- cd src && npm i && cd ..
script: cd demo-angular && travis_wait travis_retry npm run build-ios-bundle
- language: android
os: linux
env:
- Webpack="Android"
- Type="VanillaJS"
jdk: oraclejdk8
before_install:
- nvm install 10
- cd publish && npm run setup-dev-env && cd ..
- cd src && npm i && cd ..
script: cd demo && travis_wait travis_retry npm run build-android-bundle
- language: android
os: linux
env:
- Webpack="Android"
- Type="Angular"
jdk: oraclejdk8
before_install:
- nvm install 10
- cd publish && npm run setup-dev-env && cd ..
- cd src && npm i && cd ..
script: cd demo-angular && travis_wait travis_retry npm run build-android-bundle

android:
components:
- platform-tools
- tools # to install Android SDK tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
# For Google APIs
- addon-google_apis-google-$ANDROID_API_LEVEL
# Google Play Services
- extra-google-google_play_services
# Support library
- extra-android-support
# Latest artifacts in local repository
- extra-google-m2repository
- extra-android-m2repository
# Specify at least one system image
- sys-img-armeabi-v7a-android-21
- sys-img-armeabi-v7a-android-$ANDROID_API_LEVEL

before_install:
- export EMULATOR="system-images;android-${API};${TAG};${ABI}" # Used to install/create emulator
- export ANDROID_HOME=/usr/local/share/android-sdk
- export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH
- wget -qO- https://github.com/raw/creationix/nvm/v0.31.0/install.sh | bash
- source ~/.nvm/nvm.sh && nvm install $NODE_VERSION && nvm use $NODE_VERSION
- PATH="`npm bin`:`npm bin -g`:$PATH"
- brew update > /dev/null;
- brew install Caskroom/cask/android-sdk
# Tools
- echo y | sdkmanager 'tools'
# Platform tools
- echo y | sdkmanager 'platform-tools'
# SDKs
- echo y | sdkmanager 'platforms;android-25'
# build tools
- echo y | sdkmanager 'build-tools;25.0.2'
# Android System Images, for emulators
- echo y | sdkmanager 'system-images;android-24;default;armeabi-v7a'
- echo y | sdkmanager 'system-images;android-22;default;armeabi-v7a'
- echo y | sdkmanager 'system-images;android-21;default;armeabi-v7a'
- echo y | sdkmanager 'system-images;android-19;default;armeabi-v7a'
- echo y | sdkmanager 'system-images;android-19;google_apis;armeabi-v7a'
# Extras
- echo y | sdkmanager 'extras;android;m2repository'
- echo y | sdkmanager 'extras;google;google_play_services'
- echo y | sdkmanager 'extras;google;m2repository'
# google apis
- echo y | sdkmanager 'add-ons;addon-google_apis-google-23'
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
# create and start emulator
- echo no | avdmanager create avd --name test -k "$EMULATOR" -f --abi "$ABI" --tag "$TAG"
- emulator -avd test -gpu off -skin 768x1280 -no-window &
# CocoaPods
- gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- pod --version
- pod setup --silent
- pod repo update --silent
# Build Tools
- npm install -g npm@$NPM_VERSION
- npm install -g nativescript@$TNS_VERSION
- tns usage-reporting disable
- tns error-reporting disable
# Show environment info
- node --version
- npm --version
- xcpretty --version
- xcodebuild -version
- xcodebuild -showsdks
- echo $ANDROID_HOME
- sudo pip install --upgrade pip
- sudo pip install six

licenses:
- ".+"

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock

cache:
directories:
- .nvm
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

script:
- npm run clean
- npm run build
- npm run test
# - npm run e2e
install:
- echo no | npm install -g nativescript
- tns usage-reporting disable
- tns error-reporting disable
43 changes: 31 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ properties properties: [
def nodeJS = new de.mare.ci.jenkins.NodeJS()
def git = new de.mare.ci.jenkins.Git()

node('nativescript') {
timeout(150) {
node('nativescript') {

def workspace = env.WORKSPACE

Expand All @@ -21,27 +22,45 @@ node('nativescript') {
}

stage('Build') {
nodeJS.nvmRun('clean')
nodeJS.nvm("install -g nativescript")
dir("publish") {
nodeJS.nvmRun("setup-dev-env")
}
}

stage('Test') {
nodeJS.nvmRun('test')
junit 'test/android/build/reports/TEST-*.xml'
stage('Webpack') {
parallel demo: {
dir("demo") {
nodeJS.nvmRun("clean")
nodeJS.nvmRun("build-android-bundle")
nodeJS.nvmRun("build-ios-bundle")
}
}, demoAngular: {
dir("demo-angular") {
nodeJS.nvmRun("clean")
nodeJS.nvmRun("build-android-bundle")
nodeJS.nvmRun("build-ios-bundle")
}
},
failFast: true
}

stage('E2E') {
nodeJS.nvmRun('e2e')
junit 'tmp/TEST-*.xml'
}
dir("src") {
stage('Test') {
nodeJS.nvmRun('test')
// junit 'test/android/build/reports/TEST-*.xml'
}

if(git.isDevelopBranch() || git.isFeatureBranch()){
stage('Publish NPM snapshot') {
nodeJS.publishSnapshot('.', env.BUILD_NUMBER, env.BRANCH_NAME)
if(git.isDevelopBranch() || git.isFeatureBranch()){
stage('Publish NPM snapshot') {
nodeJS.publishSnapshot('.', env.BUILD_NUMBER, env.BRANCH_NAME)
}
}
}

} catch (e) {
mail subject: "${env.JOB_NAME} (${env.BUILD_NUMBER}): Error on build", to: 'github@martinreinhardt-online.de', body: "Please go to ${env.BUILD_URL}."
throw e
}
}
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# NativeScript Toast Plugin

[![Build Status](https://travis-ci.org/TobiasHennig/nativescript-toast.svg?branch=master)](https://travis-ci.org/TobiasHennig/nativescript-toast)
[![npm version](https://badge.fury.io/js/nativescript-toast.svg)](http://badge.fury.io/js/nativescript-toast)
[![npm version](https://badge.fury.io/js/nativescript-toast.svg)](http://badge.fury.io/js/nativescript-toast)
[![npm downloads](https://img.shields.io/npm/dm/nativescript-toast.svg)](https://www.npmjs.com/package/nativescript-toast)
[![npm downloads](https://img.shields.io/npm/dt/nativescript-toast.svg)](https://www.npmjs.com/package/nativescript-toast)

> A NativeScript Toast Plugin for Android and iOS apps.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion demo/angular/app/main.ts → demo-angular/app/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// this import should be first in order to load some required settings (like globals and reflect-metadata)
import { platformNativeScriptDynamic, NativeScriptModule } from 'nativescript-angular/platform';
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference path='../../node_modules/@types/jasmine/index.d.ts' />
import {inject, TestBed} from '@angular/core/testing';
import {NativeScriptModule} from 'nativescript-angular/platform';
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
import * as appSettings from 'application-settings';
import {Page} from 'ui/page';
import {AppComponent} from '../app.component';
Expand All @@ -22,7 +21,7 @@ describe('LoginComponent', () => {
});

it('should init', inject([AppComponent], (appComponent: AppComponent) => {
expect(appComponent).toBeDefined();
// expect(appComponent).toBeDefined();
}));

it('should work on click', inject([AppComponent], (appComponent: AppComponent) => {
Expand Down
File renamed without changes.
Loading

0 comments on commit 614054b

Please sign in to comment.