Skip to content

Commit 1b89a88

Browse files
committed
Merge branch 'master' into android-media-type
2 parents 242e7d6 + 5d77c84 commit 1b89a88

File tree

91 files changed

+225
-375
lines changed

Some content is hidden

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

91 files changed

+225
-375
lines changed

.travis.yml

Lines changed: 44 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
env:
22
global:
33
- ANDROID_PACKAGE_JS='imagepicker-debug-js.apk'
4+
- ANDROID_PACKAGE_NG='imagepicker-debug-ng.apk'
45
- ANDROID_PACKAGE_VUE='imagepicker-debug-vue.apk'
56
- ANDROID_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/outputs
7+
- ANDROID_PACKAGE_FOLDER_NG=$TRAVIS_BUILD_DIR/demo-angular/outputs
68
- ANDROID_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/outputs
79
- ANDROID_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER"
810
- IOS_PACKAGE_JS='imagepicker-demo-js.zip'
11+
- IOS_PACKAGE_NG='imagepicker-demo-ng.zip'
912
- IOS_PACKAGE_VUE='imagepicker-demo-vue.zip'
1013
- IOS_PACKAGE_FOLDER_JS=$TRAVIS_BUILD_DIR/demo/outputs
14+
- IOS_PACKAGE_FOLDER_NG=$TRAVIS_BUILD_DIR/demo-angular/outputs
1115
- IOS_PACKAGE_FOLDER_VUE=$TRAVIS_BUILD_DIR/demo-vue/outputs
1216
- IOS_SAUCE_STORAGE="https://saucelabs.com/rest/v1/storage/$SAUCE_USER"
1317

@@ -43,30 +47,31 @@ matrix:
4347
- os: osx
4448
env:
4549
- WebpackiOS="12.0"
46-
- Type="VueJS"
50+
- Type="Angular"
4751
osx_image: xcode10.2
4852
language: node_js
4953
node_js: "10"
5054
jdk: oraclejdk8
5155
before_script: pod repo update
5256
script:
5357
- cd src && npm run build
54-
- cd ../demo-vue && npm i && tns build ios --bundle --env.uglify --copy-to "./outputs/demovue.app"
55-
- cd $IOS_PACKAGE_FOLDER_VUE && zip -r $IOS_PACKAGE_VUE demovue.app
56-
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_VUE?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_VUE/$IOS_PACKAGE_VUE"
58+
- cd ../demo-angular && npm i && tns build ios --bundle --env.uglify --env.aot --copy-to "./outputs/demo-angular.app"
59+
- cd $IOS_PACKAGE_FOLDER_NG && zip -r $IOS_PACKAGE_NG demo-angular.app
60+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_NG?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_NG/$IOS_PACKAGE_NG"
5761
- os: osx
5862
env:
5963
- WebpackiOS="12.0"
60-
- Type="Angular"
64+
- Type="VueJS"
6165
osx_image: xcode10.2
6266
language: node_js
6367
node_js: "10"
6468
jdk: oraclejdk8
6569
before_script: pod repo update
6670
script:
67-
- cd src && npm run build && npm pack
68-
- cd ../demo-angular && tns plugin add ../src/*.tgz
69-
- npm i && tns build ios --bundle --env.uglify --env.aot
71+
- cd src && npm run build
72+
- cd ../demo-vue && npm i && tns build ios --bundle --env.uglify --copy-to "./outputs/demovue.app"
73+
- cd $IOS_PACKAGE_FOLDER_VUE && zip -r $IOS_PACKAGE_VUE demovue.app
74+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_VUE?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_VUE/$IOS_PACKAGE_VUE"
7075
- language: android
7176
os: linux
7277
dist: trusty
@@ -84,73 +89,25 @@ matrix:
8489
dist: trusty
8590
env:
8691
- WebpackAndroid="28"
87-
- Type="VueJS"
92+
- Type="Angular"
8893
jdk: oraclejdk8
8994
before_install: nvm install 10
9095
script:
9196
- cd src && npm run build
92-
- cd ../demo-vue && npm i && tns build android --bundle --env.uglify --copy-to "./outputs/app-debug.apk"
93-
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_VUE?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_VUE/app-debug.apk"
97+
- cd ../demo-angular && npm i && tns build android --bundle --env.uglify --env.snapshot --copy-to "./outputs/app-debug.apk"
98+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_NG?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_NG/app-debug.apk"
9499
- language: android
95100
os: linux
96101
dist: trusty
97102
env:
98103
- WebpackAndroid="28"
99-
- Type="Angular"
104+
- Type="VueJS"
100105
jdk: oraclejdk8
101106
before_install: nvm install 10
102107
script:
103108
- cd src && npm run build
104-
- cd ../publish && sh pack.sh
105-
- cd ../demo-angular && tns plugin add ../publish/package/*.tgz
106-
- npm i && tns build android --bundle --env.uglify --env.snapshot --env.aot
107-
- language: android
108-
os: linux
109-
dist: trusty
110-
env:
111-
- BuildAndroid="28"
112-
- Type="VanillaJS"
113-
114-
jdk: oraclejdk8
115-
before_install: nvm install 10
116-
script:
117-
- cd demo && npm run ci.android.build
118-
- language: android
119-
os: linux
120-
dist: trusty
121-
env:
122-
- BuildAndroid="28"
123-
- Type="Angular"
124-
125-
jdk: oraclejdk8
126-
before_install: nvm install 10
127-
script:
128-
- cd demo-angular && npm run ci.android.build
129-
- os: osx
130-
env:
131-
- BuildiOS="12.0"
132-
- Xcode="10.0"
133-
- Type="VanillaJS"
134-
osx_image: xcode10.2
135-
language: node_js
136-
node_js: "10"
137-
jdk: oraclejdk8
138-
before_script: pod repo update
139-
script:
140-
- cd src && npm run build
141-
- cd ../demo && tns build ios --bundle --env.uglify
142-
- os: osx
143-
env:
144-
- BuildiOS="12.0"
145-
- Xcode="10.0"
146-
- Type="Angular"
147-
osx_image: xcode10.2
148-
language: node_js
149-
node_js: "10"
150-
jdk: oraclejdk8
151-
before_script: pod repo update
152-
script:
153-
- cd demo-angular && npm run ci.ios.build
109+
- cd ../demo-vue && npm i && tns build android --bundle --env.uglify --copy-to "./outputs/app-debug.apk"
110+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE/$ANDROID_PACKAGE_VUE?overwrite=true --data-binary @$ANDROID_PACKAGE_FOLDER_VUE/app-debug.apk"
154111
- stage: "UI Tests"
155112
env:
156113
- Android="24"
@@ -160,7 +117,7 @@ matrix:
160117
node_js: "10"
161118
script:
162119
- npm i -g appium
163-
- cd demo && npm i
120+
- cd tests && npm i
164121
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_JS
165122
- os: linux
166123
env:
@@ -171,8 +128,19 @@ matrix:
171128
node_js: "10"
172129
script:
173130
- npm i -g appium
174-
- cd demo-vue && npm i
131+
- cd tests && npm i
175132
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_VUE
133+
- os: linux
134+
env:
135+
- Android="24"
136+
- Type="Angular"
137+
language: node_js
138+
os: linux
139+
node_js: "10"
140+
script:
141+
- npm i -g appium
142+
- cd tests && npm i
143+
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_NG
176144
- os: linux
177145
env:
178146
- iOS="12.0"
@@ -181,7 +149,7 @@ matrix:
181149
node_js: "10"
182150
script:
183151
- npm i -g appium
184-
- cd demo && npm i
152+
- cd tests && npm i
185153
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_JS
186154
- os: linux
187155
env:
@@ -191,8 +159,18 @@ matrix:
191159
node_js: "10"
192160
script:
193161
- npm i -g appium
194-
- cd demo-vue && npm i
162+
- cd tests && npm i
195163
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_VUE
164+
- os: linux
165+
env:
166+
- iOS="12.0"
167+
- Type="Angular"
168+
language: node_js
169+
node_js: "10"
170+
script:
171+
- npm i -g appium
172+
- cd tests && npm i
173+
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_NG
196174

197175
android:
198176
components:

demo-angular/karma.conf.js

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
module.exports = function(config) {
2-
config.set({
1+
module.exports = function (config) {
2+
const options = {
33

44
// base path that will be used to resolve all patterns (eg. files, exclude)
55
basePath: '',
@@ -11,9 +11,7 @@ module.exports = function(config) {
1111

1212

1313
// list of files / patterns to load in the browser
14-
files: [
15-
'app/**/*.js',
16-
],
14+
files: ['app/tests/**/*.*'],
1715

1816

1917
// list of files to exclude
@@ -72,6 +70,39 @@ module.exports = function(config) {
7270

7371
// Continuous Integration mode
7472
// if true, Karma captures browsers, runs the tests and exits
75-
singleRun: true
76-
});
77-
};
73+
singleRun: false
74+
};
75+
76+
setWebpackPreprocessor(config, options);
77+
setWebpack(config, options);
78+
79+
config.set(options);
80+
}
81+
82+
function setWebpackPreprocessor(config, options) {
83+
if (config && config.bundle) {
84+
if (!options.preprocessors) {
85+
options.preprocessors = {};
86+
}
87+
88+
options.files.forEach(file => {
89+
if (!options.preprocessors[file]) {
90+
options.preprocessors[file] = [];
91+
}
92+
options.preprocessors[file].push('webpack');
93+
});
94+
}
95+
}
96+
97+
function setWebpack(config, options) {
98+
if (config && config.bundle) {
99+
const env = {};
100+
env[config.platform] = true;
101+
env.sourceMap = config.debugBrk;
102+
options.webpack = require('./webpack.config')(env);
103+
delete options.webpack.entry;
104+
delete options.webpack.output.libraryTarget;
105+
const invalidPluginsForUnitTesting = ["GenerateBundleStarterPlugin", "GenerateNativeScriptEntryPointsPlugin"];
106+
options.webpack.plugins = options.webpack.plugins.filter(p => !invalidPluginsForUnitTesting.includes(p.constructor.name));
107+
}
108+
}

demo-angular/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"nativescript": {
33
"id": "org.nativescript.imagepickerdemoangular",
44
"tns-ios": {
5-
"version": "5.4.0"
5+
"version": "6.0.1"
66
},
77
"tns-android": {
8-
"version": "5.4.0"
8+
"version": "6.0.0"
99
}
1010
},
1111
"dependencies": {
@@ -20,23 +20,23 @@
2020
"nativescript-angular": "~8.0.0",
2121
"nativescript-imagepicker": "../src",
2222
"nativescript-theme-core": "^1.0.4",
23-
"nativescript-unit-test-runner": "^0.3.4",
23+
"nativescript-unit-test-runner": "0.7.0",
2424
"reflect-metadata": "~0.1.8",
2525
"rxjs": "^6.3.3",
26-
"tns-core-modules": "^5.0.0",
27-
"typescript": "~3.4.5"
26+
"tns-core-modules": "^6.0.0"
2827
},
2928
"devDependencies": {
3029
"jasmine-core": "^2.5.2",
31-
"karma": "^1.3.0",
32-
"karma-jasmine": "^1.0.2",
30+
"karma": "4.1.0",
31+
"karma-jasmine": "2.0.1",
3332
"karma-nativescript-launcher": "^0.4.0",
3433
"nativescript-css-loader": "~0.26.0",
35-
"nativescript-dev-typescript": "~0.10.0",
36-
"nativescript-dev-webpack": "~0.24.0",
37-
"tns-platform-declarations": "^5.0.0",
34+
"nativescript-dev-webpack": "~1.0.1",
35+
"tns-platform-declarations": "^6.0.0",
3836
"tslint": "~5.11.0",
39-
"zone.js": "^0.8.4"
37+
"zone.js": "^0.8.4",
38+
"typescript": "~3.4.5",
39+
"karma-webpack": "3.0.5"
4040
},
4141
"scripts": {
4242
"build.plugin": "cd ../src && npm run build",

demo-vue/e2e/config/appium.capabilities.json

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)