forked from apla/me.apla.cordova.app-preferences
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
97 lines (95 loc) · 4.07 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
language: objective-c
# xcode 6 still "Invalid Device State"
osx_image: xcode7
node_js:
- "6"
before_install:
- xcrun simctl list
- instruments -s devices
# - export EMU_TARGET=$(cordova emulate ios --list | grep iPhone-5s | cut -f 2 | head -n 1)
# - export ANDROID_HOME=$PWD/android-sdk-macosx
# - export ANDROID_SDK=$ANDROID_HOME
# - export PATH=$(pwd)/node_modules/.bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}
- export PATH=$(pwd)/node_modules/.bin:${PATH}
- export NODE_PATH=$(pwd)/node_modules:$(pwd)/node_modules/cordova/node_modules:$NODE_PATH
# TODO: install android sdk
install:
- (if [ ! -d node_modules ] ; then npm install ; fi)
# xcode version 0.8.0 is not compatible with node 4.x and later
# - find node_modules -type d -name xcode
# - find node_modules -type d -name xcode | grep node_modules/xcode | xargs rm -rf
# - npm install xcode
# - (if [ ! -d cordova-lib/cordova-lib ] ; then git clone https://github.com/apla/cordova-lib -b patch-1 ; fi)
# - npm install ./cordova-lib/cordova-lib
# - rm -rf node_modules/cordova/node_modules/cordova-lib
- (if [ -d app-preferences-app ] ; then rm -rf app-preferences-app ; fi)
# - pwd
# - ls -la
# - ls -la node_modules
# - ls -la node_modules/.bin
- cordova create app-preferences-app
script:
# testing basic functionality of preference generator
- echo running jasmine test
- cd bin
- pwd
- jasmine
- cd ..
# let's create cordova app, add and remove plugin a few times
- echo test plugin within cordova app
- cd app-preferences-app
# - cordova platform add [email protected] android
- cordova platform add ios android
- cordova plugin add cordova-plugin-device
- cordova plugin add https://github.com/apla/me.apla.cordova.app-preferences
- (if [ ! -f app-settings.json ]; then exit 0; fi)
- cp plugins/cordova-plugin-app-preferences/src/test.js www/js/apppreferences-test.js
- patch -p0 -i plugins/cordova-plugin-app-preferences/src/test.patch
- cordova prepare
# - (cordova build --emulator ios > /dev/null)
# - node ../bin/test-server.js ios
- echo plugin must be ok without platforms installed
- cordova platform rm android
- cordova prepare
- cordova platform rm ios
- cordova -d platform add android
- echo patch cordova android emulator
- (patch -p0 -i ../src/platform-android-emulator.patch || exit 0)
- echo check for UIWebView
- cordova platform add ios
- cordova prepare
- (cordova build --emulator ios > /dev/null)
- node ../bin/test-server.js ios
- (android list avd && cordova build --emulator android > /dev/null || exit 0)
- (android list avd && node ../bin/test-server.js android circleci-android22 || exit 0)
- cordova platform add browser
- cordova prepare
- cordova build --emulator browser
- node ../bin/test-server.js browser
- echo plugin can be uninstalled
- cordova plugin rm cordova-plugin-app-preferences
- cordova plugin add https://github.com/apla/me.apla.cordova.app-preferences
- cordova prepare
- echo plugin must not rewrite existing Settings.bundle generated by external tool
- rm platforms/ios/Settings.bundle/.me.apla.apppreferences
- (! cordova prepare)
- touch platforms/ios/Settings.bundle/.me.apla.apppreferences
- cordova prepare
- echo plugin must cleanup after remove
- cordova plugin rm cordova-plugin-app-preferences
- (if [ ! -d platforms/ios/Settings.bundle ]; then exit 0 ; fi)
- cordova plugin add https://github.com/apla/me.apla.cordova.app-preferences
- cordova prepare
- echo plugin must not rewrite existing Settings.bundle generated by external tool
- rm platforms/ios/Settings.bundle/.me.apla.apppreferences
- cordova plugin rm cordova-plugin-app-preferences
- (if [ -f platforms/ios/Settings.bundle/Root.plist ]; then exit 0 ; fi)
- cordova plugin add https://github.com/apla/me.apla.cordova.app-preferences
- cordova plugin add cordova-plugin-console
- touch platforms/ios/Settings.bundle/.me.apla.apppreferences
# prepare and launch ios simulator to test preferences access on ios
- cordova -d prepare
after_script:
- cd ..
- echo rm -rf node_modules
- echo rm -rf app-preferences-app