Skip to content

Commit

Permalink
Add osx build on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
j3k0 committed Oct 24, 2016
1 parent 4fc5a72 commit d655e1e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 23 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
os:
- osx
- linux
osx_image: xcode8

language: node_js
node_js:
- "6.7"
git:
submodules: false

script:
- make all
- ./test/run.sh cc.fovea.babygoo babygooinapp1
48 changes: 25 additions & 23 deletions test/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# Set variables: PLUGIN_DIR, TEST_DIR, BUILD_DIR
cd `dirname $0`/..
Expand Down Expand Up @@ -69,12 +69,6 @@ cp "$ROOT_DIR"/www/*.js plugins/cc.fovea.cordova.purchase/www/
# Add console debug
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git || exit 1

# Compile for iOS
cordova build ios || exit 1

# Compile for Android
cordova build android || exit 1

# Check existance of the plugins files
function hasFile() {
if test -e "$1"; then
Expand All @@ -85,24 +79,32 @@ function hasFile() {
fi
}

echo
echo Check iOS installation
IOS_PLUGIN_DIR="$BUILD_DIR/platforms/ios/Test/Plugins/cc.fovea.cordova.purchase"
IOS_WWW_DIR="$BUILD_DIR/platforms/ios/www/plugins/cc.fovea.cordova.purchase/www"
IOS_PROJ="$BUILD_DIR/platforms/ios/Test.xcodeproj/project.pbxproj"
case "$OSTYPE" in darwin*)
# Compile for iOS
cordova build ios || exit 1

hasFile "$IOS_PLUGIN_DIR/InAppPurchase.m"
hasFile "$IOS_PLUGIN_DIR/InAppPurchase.h"
hasFile "$IOS_PLUGIN_DIR/SKProduct+LocalizedPrice.h"
hasFile "$IOS_PLUGIN_DIR/SKProduct+LocalizedPrice.m"
hasFile "$IOS_WWW_DIR/store-ios.js"
echo
echo Check iOS installation
IOS_PLUGIN_DIR="$BUILD_DIR/platforms/ios/Test/Plugins/cc.fovea.cordova.purchase"
IOS_WWW_DIR="$BUILD_DIR/platforms/ios/www/plugins/cc.fovea.cordova.purchase/www"
IOS_PROJ="$BUILD_DIR/platforms/ios/Test.xcodeproj/project.pbxproj"

hasFile "$IOS_PLUGIN_DIR/InAppPurchase.m"
hasFile "$IOS_PLUGIN_DIR/InAppPurchase.h"
hasFile "$IOS_PLUGIN_DIR/SKProduct+LocalizedPrice.h"
hasFile "$IOS_PLUGIN_DIR/SKProduct+LocalizedPrice.m"
hasFile "$IOS_WWW_DIR/store-ios.js"

if grep StoreKit.framework "$IOS_PROJ" > /dev/null; then
echo "StoreKit framework added."
else
echo "ERROR: StoreKit framework missing."
EXIT=1
fi
;; esac

if grep StoreKit.framework "$IOS_PROJ" > /dev/null; then
echo "StoreKit framework added."
else
echo "ERROR: StoreKit framework missing."
EXIT=1
fi
# Compile for Android
cordova build android || exit 1

echo Check Android installation
ANDROID_CLASSES_DIR="$BUILD_DIR/platforms/android/build/intermediates/classes/debug"
Expand Down

0 comments on commit d655e1e

Please sign in to comment.