2016-12-22 08:36:31 -08:00
|
|
|
#!/bin/sh
|
2018-09-11 15:27:47 -07:00
|
|
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
2016-12-22 08:36:31 -08:00
|
|
|
#
|
2018-02-16 18:24:55 -08:00
|
|
|
# This source code is licensed under the MIT license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree.
|
2016-12-22 08:36:31 -08:00
|
|
|
|
2016-12-23 09:48:55 -08:00
|
|
|
set -e
|
|
|
|
|
2016-12-22 08:36:31 -08:00
|
|
|
cd "$( dirname "$0" )"
|
|
|
|
|
|
|
|
if [ \! -f yoga.dll ]; then
|
|
|
|
echo "Launch win.bat on Windows and copy yoga.dll to here"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
function build {
|
|
|
|
buck build $1
|
|
|
|
echo "$root/`buck targets --show-output $1|tail -1|awk '{print $2}'`"
|
|
|
|
}
|
|
|
|
|
|
|
|
function copy {
|
|
|
|
mkdir -p $3
|
|
|
|
cp $1 $3/$2
|
|
|
|
}
|
|
|
|
|
|
|
|
rm -rf Yoga yoga.unitypackage
|
|
|
|
|
|
|
|
root=`buck root|tail -f`
|
|
|
|
mac=$(build '//csharp:yoganet#default,shared')
|
|
|
|
armv7=$(build '//csharp:yoganet#android-armv7,shared')
|
|
|
|
ios=$(build '//csharp:yoganet-ios')
|
|
|
|
win=yoga.dll
|
|
|
|
|
|
|
|
Unity -quit -batchMode -createProject Yoga
|
|
|
|
|
|
|
|
copy $win ${win##*/} Yoga/Assets/Facebook.Yoga/Plugins/x86_64
|
|
|
|
copy $mac yoga Yoga/Assets/Facebook.Yoga/Plugins/x86_64/yoga.bundle/Contents/MacOS
|
|
|
|
armv7path=Assets/Plugins/Android/libs/armeabi-v7a
|
|
|
|
copy $armv7 ${armv7##*/} Yoga/$armv7path
|
|
|
|
iospath=Assets/Plugins/iOS
|
|
|
|
copy $ios ${ios##*/} Yoga/$iospath
|
|
|
|
libs="$armv7path/${armv7##*/} $iospath/${ios##*/}"
|
|
|
|
|
|
|
|
scripts=Yoga/Assets/Facebook.Yoga/Scripts/Facebook.Yoga
|
|
|
|
mkdir -p $scripts
|
|
|
|
(cd ../Facebook.Yoga; tar cf - *.cs)|tar -C $scripts -xf -
|
|
|
|
|
|
|
|
tests=Yoga/Assets/Facebook.Yoga/Editor/Facebook.Yoga.Tests
|
|
|
|
mkdir -p $tests
|
|
|
|
(cd ../tests/Facebook.Yoga; tar cf - *.cs)|tar -C $tests -xf -
|
|
|
|
|
2016-12-23 09:48:55 -08:00
|
|
|
function onerror {
|
|
|
|
local xml=Yoga/EditorTestResults.xml
|
|
|
|
if [ -f $xml ]; then cat $xml|grep 'success="False"'; fi
|
|
|
|
}
|
|
|
|
trap onerror EXIT
|
|
|
|
Unity -quit -batchMode -projectPath `pwd`/Yoga -runEditorTests
|
|
|
|
|
|
|
|
pkg="`pwd`/yoga.unitypackage"
|
|
|
|
Unity -quit -batchMode -projectPath `pwd`/Yoga -exportPackage Assets/Facebook.Yoga $libs $pkg
|
2016-12-22 08:36:31 -08:00
|
|
|
|
2016-12-23 09:48:55 -08:00
|
|
|
echo "Success: $pkg"
|