Skip to content

Commit 614054b

Browse files
committed
feat(TNS5): Support for NativeScript 5
1 parent 34046c4 commit 614054b

File tree

198 files changed

+34737
-1699
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+34737
-1699
lines changed

.gitignore

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ pids
77
*.pid
88
*.seed
99

10-
tmp/
11-
1210
# Directory for instrumented libs generated by jscoverage/JSCover
1311
lib-cov
1412

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

21-
# node-waf configuration
22-
.lock-wscript
23-
2419
# Compiled binary addons (http://nodejs.org/api/addons.html)
2520
build/Release
2621

27-
# Dependency directory
28-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
29-
node_modules
22+
# Users Environment Variables
23+
.lock-wscript
24+
25+
# OS generated files #
26+
.DS_Store
27+
ehthumbs.db
28+
Icon?
29+
Thumbs.db
30+
31+
# Node Files #
32+
/node_modules
33+
/src/app/node_modules
34+
/bower_components
35+
36+
# Coverage #
37+
/coverage/
38+
39+
# Typing #
40+
/src/typings/tsd/
41+
/typings/
42+
/tsd_typings/
3043

3144
# IDE files
3245
.project
3346
.idea/
3447

3548
# generated files and folders
36-
samples/angular/app/*.js*
37-
samples/angular/app/tests/*.js*
38-
samples/angular/hooks/
39-
samples/angular/lib/
40-
samples/angular/node_modules/
41-
samples/angular/platforms/
49+
tmp/
50+
publish/package/
51+
publish/node_modules/
52+
src/node_modules/
53+
demo-angular/app/*.js*
54+
demo-angular/app/tests/*.js*
55+
demo-angular/hooks/
56+
demo-angular/lib/
57+
demo-angular/node_modules/
58+
demo-angular/platforms/
59+
demo/app/*.js*
60+
demo/app/tests/*.js*
61+
demo/hooks/
62+
demo/lib/
63+
demo/node_modules/
64+
demo/platforms/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v10

.travis.yml

Lines changed: 112 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,116 @@
1-
os: osx
2-
osx_image: xcode8.3
3-
sudo: false
4-
language: objective-c
5-
61
env:
7-
global:
8-
- API=19 # Google API 19 by default
9-
- TAG=google_apis # Google APIs by default, alternatively use default
10-
- ABI=armeabi-v7a # ARM ABI v7a by default
11-
matrix:
12-
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="2.5.5"
13-
- NODE_VERSION="7" NPM_VERSION="3" TNS_VERSION="2.5.5"
14-
- NODE_VERSION="7" NPM_VERSION="4" TNS_VERSION="2.5.5"
15-
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="3.0.3"
16-
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="3.0.3"
17-
- NODE_VERSION="7" NPM_VERSION="4" TNS_VERSION="3.0.3"
18-
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="3"
19-
- NODE_VERSION="6" NPM_VERSION="3" TNS_VERSION="3"
20-
- NODE_VERSION="7" NPM_VERSION="4" TNS_VERSION="3"
2+
global:
3+
- EMULATOR_NAME=test
4+
- ANDROID_API_LEVEL=28
5+
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
6+
- ANDROID_ABI=armeabi-v7a
7+
- ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)
8+
9+
matrix:
10+
include:
11+
- stage: "Lint"
12+
language: node_js
13+
os: linux
14+
node_js: "10"
15+
before_install:
16+
- cd publish && npm run setup-dev-env && cd ..
17+
script: cd src && npm run ci.tslint && npm run build && cd ../demo && npm run ci.tslint && cd ../demo-angular && npm run ci.tslint
18+
- stage: "Webpack and Build"
19+
os: osx
20+
env:
21+
- Webpack="iOS"
22+
- Type="VanillaJS"
23+
osx_image: xcode10.0
24+
language: node_js
25+
node_js: "10"
26+
jdk: oraclejdk8
27+
before_script:
28+
- gem install cocoapods
29+
- gem install xcodeproj
30+
- brew install xcproj
31+
- pod repo update
32+
- sudo pip install six
33+
before_install:
34+
- cd publish && npm run setup-dev-env && cd ..
35+
- cd src && npm i && cd ..
36+
script: cd demo && travis_wait travis_retry npm run build-ios-bundle
37+
- os: osx
38+
env:
39+
- Webpack="iOS"
40+
- Type="Angular"
41+
osx_image: xcode10.0
42+
language: node_js
43+
node_js: "10"
44+
jdk: oraclejdk8
45+
before_script:
46+
- gem install cocoapods
47+
- gem install xcodeproj
48+
- brew install xcproj
49+
- pod repo update
50+
- sudo pip install six
51+
before_install:
52+
- cd publish && npm run setup-dev-env && cd ..
53+
- cd src && npm i && cd ..
54+
script: cd demo-angular && travis_wait travis_retry npm run build-ios-bundle
55+
- language: android
56+
os: linux
57+
env:
58+
- Webpack="Android"
59+
- Type="VanillaJS"
60+
jdk: oraclejdk8
61+
before_install:
62+
- nvm install 10
63+
- cd publish && npm run setup-dev-env && cd ..
64+
- cd src && npm i && cd ..
65+
script: cd demo && travis_wait travis_retry npm run build-android-bundle
66+
- language: android
67+
os: linux
68+
env:
69+
- Webpack="Android"
70+
- Type="Angular"
71+
jdk: oraclejdk8
72+
before_install:
73+
- nvm install 10
74+
- cd publish && npm run setup-dev-env && cd ..
75+
- cd src && npm i && cd ..
76+
script: cd demo-angular && travis_wait travis_retry npm run build-android-bundle
77+
78+
android:
79+
components:
80+
- platform-tools
81+
- tools # to install Android SDK tools
82+
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
83+
- android-$ANDROID_API_LEVEL
84+
# For Google APIs
85+
- addon-google_apis-google-$ANDROID_API_LEVEL
86+
# Google Play Services
87+
- extra-google-google_play_services
88+
# Support library
89+
- extra-android-support
90+
# Latest artifacts in local repository
91+
- extra-google-m2repository
92+
- extra-android-m2repository
93+
# Specify at least one system image
94+
- sys-img-armeabi-v7a-android-21
95+
- sys-img-armeabi-v7a-android-$ANDROID_API_LEVEL
2196

2297
before_install:
23-
- export EMULATOR="system-images;android-${API};${TAG};${ABI}" # Used to install/create emulator
24-
- export ANDROID_HOME=/usr/local/share/android-sdk
25-
- export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH
26-
- wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
27-
- source ~/.nvm/nvm.sh && nvm install $NODE_VERSION && nvm use $NODE_VERSION
28-
- PATH="`npm bin`:`npm bin -g`:$PATH"
29-
- brew update > /dev/null;
30-
- brew install Caskroom/cask/android-sdk
31-
# Tools
32-
- echo y | sdkmanager 'tools'
33-
# Platform tools
34-
- echo y | sdkmanager 'platform-tools'
35-
# SDKs
36-
- echo y | sdkmanager 'platforms;android-25'
37-
# build tools
38-
- echo y | sdkmanager 'build-tools;25.0.2'
39-
# Android System Images, for emulators
40-
- echo y | sdkmanager 'system-images;android-24;default;armeabi-v7a'
41-
- echo y | sdkmanager 'system-images;android-22;default;armeabi-v7a'
42-
- echo y | sdkmanager 'system-images;android-21;default;armeabi-v7a'
43-
- echo y | sdkmanager 'system-images;android-19;default;armeabi-v7a'
44-
- echo y | sdkmanager 'system-images;android-19;google_apis;armeabi-v7a'
45-
# Extras
46-
- echo y | sdkmanager 'extras;android;m2repository'
47-
- echo y | sdkmanager 'extras;google;google_play_services'
48-
- echo y | sdkmanager 'extras;google;m2repository'
49-
# google apis
50-
- echo y | sdkmanager 'add-ons;addon-google_apis-google-23'
51-
- mkdir "$ANDROID_HOME/licenses" || true
52-
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
53-
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
54-
# create and start emulator
55-
- echo no | avdmanager create avd --name test -k "$EMULATOR" -f --abi "$ABI" --tag "$TAG"
56-
- emulator -avd test -gpu off -skin 768x1280 -no-window &
57-
# CocoaPods
58-
- gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet
59-
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
60-
- pod --version
61-
- pod setup --silent
62-
- pod repo update --silent
63-
# Build Tools
64-
- npm install -g npm@$NPM_VERSION
65-
- npm install -g nativescript@$TNS_VERSION
66-
- tns usage-reporting disable
67-
- tns error-reporting disable
68-
# Show environment info
69-
- node --version
70-
- npm --version
71-
- xcpretty --version
72-
- xcodebuild -version
73-
- xcodebuild -showsdks
74-
- echo $ANDROID_HOME
98+
- sudo pip install --upgrade pip
99+
- sudo pip install six
100+
101+
licenses:
102+
- ".+"
103+
104+
before_cache:
105+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
106+
107+
cache:
108+
directories:
109+
- .nvm
110+
- $HOME/.gradle/caches/
111+
- $HOME/.gradle/wrapper/
75112

76-
script:
77-
- npm run clean
78-
- npm run build
79-
- npm run test
80-
# - npm run e2e
113+
install:
114+
- echo no | npm install -g nativescript
115+
- tns usage-reporting disable
116+
- tns error-reporting disable

Jenkinsfile

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ properties properties: [
77
def nodeJS = new de.mare.ci.jenkins.NodeJS()
88
def git = new de.mare.ci.jenkins.Git()
99

10-
node('nativescript') {
10+
timeout(150) {
11+
node('nativescript') {
1112

1213
def workspace = env.WORKSPACE
1314

@@ -21,27 +22,45 @@ node('nativescript') {
2122
}
2223

2324
stage('Build') {
24-
nodeJS.nvmRun('clean')
25+
nodeJS.nvm("install -g nativescript")
26+
dir("publish") {
27+
nodeJS.nvmRun("setup-dev-env")
28+
}
2529
}
2630

27-
stage('Test') {
28-
nodeJS.nvmRun('test')
29-
junit 'test/android/build/reports/TEST-*.xml'
31+
stage('Webpack') {
32+
parallel demo: {
33+
dir("demo") {
34+
nodeJS.nvmRun("clean")
35+
nodeJS.nvmRun("build-android-bundle")
36+
nodeJS.nvmRun("build-ios-bundle")
37+
}
38+
}, demoAngular: {
39+
dir("demo-angular") {
40+
nodeJS.nvmRun("clean")
41+
nodeJS.nvmRun("build-android-bundle")
42+
nodeJS.nvmRun("build-ios-bundle")
43+
}
44+
},
45+
failFast: true
3046
}
3147

32-
stage('E2E') {
33-
nodeJS.nvmRun('e2e')
34-
junit 'tmp/TEST-*.xml'
35-
}
48+
dir("src") {
49+
stage('Test') {
50+
nodeJS.nvmRun('test')
51+
// junit 'test/android/build/reports/TEST-*.xml'
52+
}
3653

37-
if(git.isDevelopBranch() || git.isFeatureBranch()){
38-
stage('Publish NPM snapshot') {
39-
nodeJS.publishSnapshot('.', env.BUILD_NUMBER, env.BRANCH_NAME)
54+
if(git.isDevelopBranch() || git.isFeatureBranch()){
55+
stage('Publish NPM snapshot') {
56+
nodeJS.publishSnapshot('.', env.BUILD_NUMBER, env.BRANCH_NAME)
57+
}
4058
}
4159
}
4260

4361
} catch (e) {
4462
mail subject: "${env.JOB_NAME} (${env.BUILD_NUMBER}): Error on build", to: '[email protected]', body: "Please go to ${env.BUILD_URL}."
4563
throw e
4664
}
65+
}
4766
}

README.md

Lines changed: 3 additions & 1 deletion

0 commit comments

Comments
 (0)