Files
yoga/csharp/tests/Facebook.Yoga/test_macos.sh
Kazuki Sakamoto 25b206ac53 Build native library with BUCK for .NET (Mono, Xamarin)
Summary:
Examples:

- macOS on macOS (Mono, Xamarin.Mac, Unity)
  - `buck build //csharp:yoganet#shared,default` -> `libyoga.dylib`
- Android (Xamarin.Android, Unity)
  - `buck build //csharp:yoganet#shared,android-armv7` -> `libyoga.so`
- iOS (Xamarin.iOS, Unity)
  - `buck build //:yoga#static,iphoneos-arm64` -> `libyoga.a`
  - `buck build //csharp:yoganet#static,iphoneos-arm64` -> `libyoganet.a`
Closes https://github.com/facebook/yoga/pull/282

Reviewed By: emilsjolander

Differential Revision: D4333811

Pulled By: splhack

fbshipit-source-id: 54f4364d93b2419d7504392eb558296a5d06772f
2016-12-15 13:54:34 -08:00

29 lines
992 B
Bash
Executable File

#!/bin/sh
if mcs --version >/dev/null 2>&1 && mono --version >/dev/null 2>&1; then true; else
echo "ERROR: Need to install Mono (brew install mono, or http://www.mono-project.com/download/)"
exit 1
fi
cd "$( dirname "$0" )"
NUNIT=NUnit-2.6.4/bin
if [ -d $NUNIT \
-a -f $NUNIT/nunit-console.exe \
-a -f $NUNIT/lib/nunit-console-runner.dll \
-a -f $NUNIT/lib/nunit.core.dll \
-a -f $NUNIT/lib/nunit.core.interfaces.dll \
-a -f $NUNIT/lib/nunit.util.dll ]; then true; else
curl -L -O https://github.com/nunit/nunitv2/releases/download/2.6.4/NUnit-2.6.4.zip
unzip -qq NUnit-2.6.4.zip
rm NUnit-2.6.4.zip
fi
TARGET=//csharp:yoganet#default,shared
buck build $TARGET
ROOT=`buck root|tail -1`
DYLIB=`buck targets --show-output $TARGET|tail -1|awk '{print $2}'`
cp $ROOT/$DYLIB .
mcs -debug -t:library -r:$NUNIT/nunit.framework.dll -out:YogaTest.dll *.cs ../../../csharp/Facebook.Yoga/*cs
MONO_PATH=$NUNIT mono --arch=64 --debug $NUNIT/nunit-console.exe YogaTest.dll