Skip to content

Commit

Permalink
splitting up iOS build scripts for better job distribution across the…
Browse files Browse the repository at this point in the history
… build server farm
  • Loading branch information
patrickmeehan committed Oct 27, 2015
1 parent 919683b commit 8b9c8d7
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 45 deletions.
10 changes: 10 additions & 0 deletions util/build/build-ios-device.sh
@@ -0,0 +1,10 @@
#!/bin/bash

set -e # exit on error

pushd $(dirname "${0}")/../../xcode > /dev/null

xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme libmoai-ios-all -sdk iphoneos || exit 1
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme moai-ios -sdk iphoneos || exit 1

popd > /dev/null
10 changes: 10 additions & 0 deletions util/build/build-ios-simulator.sh
@@ -0,0 +1,10 @@
#!/bin/bash

set -e # exit on error

pushd $(dirname "${0}")/../../xcode > /dev/null

xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme libmoai-ios-all -sdk iphonesimulator || exit 1
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme moai-ios -sdk iphonesimulator || exit 1

popd > /dev/null
16 changes: 6 additions & 10 deletions xcode/build-ios.sh → util/build/build-ios.sh
Expand Up @@ -2,14 +2,15 @@

set -e # exit on error

IOS_LIB=../lib/ios
./build-ios-simulator.sh || exit 1
./build-ios-device.sh || exit 1

pushd $(dirname "${0}")/../../xcode > /dev/null

pushd $(dirname "${0}") > /dev/null
IOS_LIB=../lib/ios

#---------------------------------------------------------------
# build libmoai ios
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme libmoai-ios-all -sdk iphonesimulator || exit 1
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme libmoai-ios-all -sdk iphoneos || exit 1
# package libmoai ios

pushd ./build/Build/Products/Release-iphoneos/ > /dev/null
rm -rf "../Release-universal" # clean out the old dir (if any)
Expand All @@ -30,11 +31,6 @@ rm -rf $IOS_LIB
mkdir -p $IOS_LIB
cp -a ./build/Build/Products/Release-universal/*.a $IOS_LIB

#---------------------------------------------------------------
# build ios
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme moai-ios -sdk iphonesimulator || exit 1
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme moai-ios -sdk iphoneos || exit 1

#---------------------------------------------------------------
# build ios static
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme moai-ios-static -sdk iphonesimulator || exit 1
Expand Down
4 changes: 2 additions & 2 deletions xcode/build-osx.sh → util/build/build-osx.sh
Expand Up @@ -2,11 +2,11 @@

set -e # exit on error

pushd $(dirname "${0}")/../../xcode > /dev/null

OSX_LIB=../lib/osx
OSX_BIN=../bin/osx

pushd $(dirname "${0}") > /dev/null

#---------------------------------------------------------------
# build libmoai osx
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme libmoai-osx-all || exit 1
Expand Down
16 changes: 16 additions & 0 deletions util/build/clean-ios-device.sh
@@ -0,0 +1,16 @@
#!/bin/bash

#----------------------------------------------------------------#
# Copyright (c) 2010-2011 Zipline Games, Inc.
# All Rights Reserved.
# http://getmoai.com
#----------------------------------------------------------------#

set -e # exit on error

pushd $(dirname "${0}")/../../xcode > /dev/null

xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme libmoai-ios-all -sdk iphoneos clean
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme moai-ios -sdk iphoneos clean

popd > /dev/null
16 changes: 16 additions & 0 deletions util/build/clean-ios-simulator.sh
@@ -0,0 +1,16 @@
#!/bin/bash

#----------------------------------------------------------------#
# Copyright (c) 2010-2011 Zipline Games, Inc.
# All Rights Reserved.
# http://getmoai.com
#----------------------------------------------------------------#

set -e # exit on error

pushd $(dirname "${0}")/../../xcode > /dev/null

xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme libmoai-ios-all -sdk iphonesimulator clean
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme moai-ios -sdk iphonesimulator clean

popd > /dev/null
23 changes: 23 additions & 0 deletions util/build/clean-ios.sh
@@ -0,0 +1,23 @@
#!/bin/bash

#----------------------------------------------------------------#
# Copyright (c) 2010-2011 Zipline Games, Inc.
# All Rights Reserved.
# http://getmoai.com
#----------------------------------------------------------------#

set -e # exit on error

./clean-ios-simulator.sh
./clean-ios-device.sh

pushd $(dirname "${0}")/../../xcode > /dev/null

IOS_LIB=../lib/ios

xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme moai-ios-static -sdk iphonesimulator clean
xcodebuild -derivedDataPath build -configuration Release -workspace moai.xcworkspace -scheme moai-ios-static -sdk iphoneos clean

rm -rf $IOS_LIB

popd > /dev/null
4 changes: 2 additions & 2 deletions xcode/clean-osx.sh → util/build/clean-osx.sh
Expand Up @@ -8,11 +8,11 @@

set -e # exit on error

pushd $(dirname "${0}")/../../xcode > /dev/null

OSX_LIB=../lib/osx
OSX_BIN=../bin/osx

pushd $(dirname "${0}") > /dev/null

#---------------------------------------------------------------
# clean everything

Expand Down
42 changes: 42 additions & 0 deletions util/build/main.lua
@@ -0,0 +1,42 @@
----------------------------------------------------------------
-- Copyright (c) 2010-2011 Zipline Games, Inc.
-- All Rights Reserved.
-- http://getmoai.com
----------------------------------------------------------------

local STATE_FILENAME = 'count.lua'
local MARKED_FILENAME = 'marked.lua'
local SAMPLES_DIRECTORY = MOAI_SDK_HOME .. '/samples/'

MODE_BUILD = 'build'
MODE_CLEAN = 'clean'

gTargets = {
[ 'ios' ] = { build = 'build-ios.sh', clean = 'clean-ios.sh' },
[ 'ios-device' ] = { build = 'build-ios-device.sh', clean = 'clean-ios-device.sh' },
[ 'ios-simulator' ] = { build = 'build-ios-simulator.sh', clean = 'clean-ios-simulator.sh' },
[ 'osx' ] = { build = 'build-osx.sh', clean = 'clean-osx.sh' },
}

gMode = MODE_BUILD
gTargetsToBuild = {}

----------------------------------------------------------------
for i, escape, param, iter in util.iterateCommandLine ( arg or {}) do

if escape == 'c' or escape == 'clean' then
gMode = MODE_CLEAN
end

if param and gTargets [ param ] then
table.insert ( gTargetsToBuild, param )
end
end

for i, target in ipairs ( gTargetsToBuild ) do

local command = gTargets [ target ]
command = command and command [ gMode ]

util.moaiexec ( './%s', command )
end
2 changes: 1 addition & 1 deletion util/package-sdk/prepare-sdk-osx.sh
Expand Up @@ -11,7 +11,7 @@ echo $MOAI_SDK_ROOT
#./libmoai-clean.sh
#./libmoai-build.sh

cd $MOAI_SDK_ROOT/xcode
cd $MOAI_SDK_ROOT/util/build
./build-ios.sh
./build-osx.sh

Expand Down
2 changes: 1 addition & 1 deletion util/pito
Expand Up @@ -22,7 +22,7 @@ then
MOAI_SDK_BIN=$MOAI_SDK_HOME/bin/osx/moai
echo "pito will use your pre-built MOAI binary at $MOAI_SDK_HOME/bin/osx/moai"
else
MOAI_BUILD_SCRIPT=$MOAI_SDK_HOME/xcode/build-osx.sh
MOAI_BUILD_SCRIPT=$MOAI_SDK_HOME/util/build/build-osx.sh
MOAI_SDK_BIN=$MOAI_SDK_HOME/bin/osx/moai
fi
;;
Expand Down
29 changes: 0 additions & 29 deletions xcode/clean-ios.sh

This file was deleted.

0 comments on commit 8b9c8d7

Please sign in to comment.