2016-08-10 08:27:40 -07:00
|
|
|
# Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This source code is licensed under the BSD-style license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
2016-08-02 08:07:04 -07:00
|
|
|
|
2016-08-10 08:27:40 -07:00
|
|
|
os: osx
|
2017-01-23 19:33:24 -08:00
|
|
|
osx_image: xcode8.2
|
2016-08-10 08:27:40 -07:00
|
|
|
language: cpp
|
2016-08-02 08:07:04 -07:00
|
|
|
compiler: clang
|
|
|
|
|
2017-02-13 05:17:34 -08:00
|
|
|
env:
|
2017-02-13 09:27:44 -08:00
|
|
|
- TARGET=c
|
|
|
|
- TARGET=java
|
|
|
|
- TARGET=net
|
|
|
|
- TARGET=ios
|
|
|
|
- TARGET=js
|
2017-02-14 08:28:36 -08:00
|
|
|
- TARGET=android
|
2017-02-13 05:17:34 -08:00
|
|
|
|
2016-08-10 08:27:40 -07:00
|
|
|
before_install:
|
2017-02-20 05:31:20 -08:00
|
|
|
- brew update > /dev/null
|
2016-08-10 08:27:40 -07:00
|
|
|
- brew tap facebook/fb
|
|
|
|
- brew install buck
|
2017-02-13 05:17:34 -08:00
|
|
|
|
|
|
|
# Java
|
2017-02-13 06:49:38 -08:00
|
|
|
- |
|
2017-02-13 09:27:44 -08:00
|
|
|
if [[ $TARGET = "java" ]]; then
|
2017-02-20 05:31:20 -08:00
|
|
|
brew cask install java &&
|
|
|
|
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) &&
|
|
|
|
export PATH=$JAVA_HOME/bin:$PATH
|
2017-02-13 09:27:44 -08:00
|
|
|
fi
|
2017-02-13 05:17:34 -08:00
|
|
|
|
|
|
|
# .NET
|
2017-02-13 06:49:38 -08:00
|
|
|
- |
|
2017-02-13 09:27:44 -08:00
|
|
|
if [[ $TARGET = "net" ]]; then
|
2017-02-20 05:31:20 -08:00
|
|
|
brew install mono
|
2017-02-13 09:27:44 -08:00
|
|
|
fi
|
2017-02-13 05:17:34 -08:00
|
|
|
|
|
|
|
# iOS
|
2017-02-13 06:49:38 -08:00
|
|
|
- |
|
2017-02-13 09:27:44 -08:00
|
|
|
if [[ $TARGET = "ios" ]]; then
|
2017-03-15 09:05:40 -07:00
|
|
|
brew outdated xctool || brew upgrade xctool;
|
|
|
|
gem install xcpretty --no-document --quiet;
|
|
|
|
gem install cocoapods --pre --no-document --quiet;
|
|
|
|
pod repo update --silent;
|
|
|
|
pod install --project-directory=YogaKit/YogaKitSample/;
|
2017-02-13 09:27:44 -08:00
|
|
|
fi
|
2017-02-13 05:17:34 -08:00
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
# Emscripten (used for js tests)
|
|
|
|
# Note: cannot be ran on Linux (because it will compile Clang from its sources :|)
|
2017-02-13 06:49:38 -08:00
|
|
|
- |
|
2017-02-13 09:27:44 -08:00
|
|
|
if [[ $TARGET = "js" ]]; then
|
2017-02-20 05:31:20 -08:00
|
|
|
wget -O /tmp/emsdk-portable.tar.gz https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz &&
|
|
|
|
tar xf /tmp/emsdk-portable.tar.gz -C /tmp/ &&
|
|
|
|
/tmp/emsdk_portable/emsdk install latest >& /dev/null &&
|
|
|
|
/tmp/emsdk_portable/emsdk activate latest
|
2017-02-13 09:27:44 -08:00
|
|
|
fi
|
2017-02-13 05:17:34 -08:00
|
|
|
|
2017-02-14 08:28:36 -08:00
|
|
|
# Android
|
|
|
|
- |
|
|
|
|
if [[ $TARGET = "android" ]]; then
|
2017-02-28 00:19:07 -08:00
|
|
|
brew cask install java;
|
|
|
|
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8);
|
|
|
|
export PATH=$JAVA_HOME/bin:$PATH;
|
|
|
|
brew install android-sdk;
|
|
|
|
export ANDROID_SDK=/usr/local/Cellar/android-sdk/24.4.1_1;
|
|
|
|
export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1;
|
|
|
|
brew install lib32stdc++6 lib32z1;
|
|
|
|
echo y | $ANDROID_SDK/tools/android update sdk --filter android-19,addon-google_apis-google-19,build-tools-19.1.0 --no-ui;
|
|
|
|
echo y | $ANDROID_SDK/tools/android update sdk -u;
|
2017-02-14 08:28:36 -08:00
|
|
|
fi
|
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
# JavaScript
|
|
|
|
- |
|
|
|
|
if [[ $TARGET = "js" ]]; then (
|
|
|
|
cd javascript &&
|
|
|
|
npm install &&
|
|
|
|
unset CC && unset CXX && unset LINK &&
|
|
|
|
source /tmp/emsdk_portable/emsdk_env.sh &&
|
|
|
|
npm run build:browser
|
|
|
|
) fi
|
|
|
|
|
2017-02-13 06:49:38 -08:00
|
|
|
script:
|
2017-02-20 05:31:20 -08:00
|
|
|
# C
|
|
|
|
- |
|
|
|
|
if [[ $TARGET = "c" ]]; then
|
|
|
|
buck test --verbose 0 //:yoga &&
|
|
|
|
buck run --verbose 0 //benchmark:benchmark &&
|
|
|
|
git checkout HEAD^ &&
|
|
|
|
buck run --verbose 0 //benchmark:benchmark
|
|
|
|
fi
|
2017-02-13 05:17:34 -08:00
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
# Java
|
|
|
|
- |
|
|
|
|
if [[ $TARGET = "java" ]]; then
|
|
|
|
buck test --verbose 0 //java:java
|
|
|
|
fi
|
2017-02-13 05:17:34 -08:00
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
# .NET
|
|
|
|
- |
|
|
|
|
if [[ $TARGET = "net" ]]; then
|
|
|
|
sh csharp/tests/Facebook.Yoga/test_macos.sh
|
|
|
|
fi
|
2017-02-13 05:17:34 -08:00
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
# iOS
|
|
|
|
- |
|
|
|
|
if [[ $TARGET = "ios" ]]; then
|
2017-03-15 09:05:40 -07:00
|
|
|
buck test --verbose 0 //YogaKit:YogaKitTests --config cxx.default_platform=iphonesimulator-x86_64 &&
|
|
|
|
set -o pipefail &&
|
|
|
|
xcodebuild build -workspace YogaKit/YogaKitSample/YogaKitSample.xcworkspace -scheme YogaKitSample -sdk iphonesimulator | xcpretty -c
|
2017-02-20 05:31:20 -08:00
|
|
|
fi
|
2017-02-13 05:17:34 -08:00
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
# Android
|
|
|
|
- |
|
|
|
|
if [[ $TARGET = "android" ]]; then
|
|
|
|
buck build --verbose 0 //android/sample:sample
|
|
|
|
fi
|
2017-02-14 08:28:36 -08:00
|
|
|
|
2017-02-20 05:31:20 -08:00
|
|
|
# JavaScript
|
|
|
|
- |
|
|
|
|
if [[ $TARGET = "js" ]]; then (
|
|
|
|
cd javascript &&
|
|
|
|
npm run test:all &&
|
|
|
|
npm run bench
|
|
|
|
) fi
|