Summary: Fix some long-standing issues with the android build on Travis (and elsewhere) and enable automatic publishing of snapshots. Reviewed By: emilsjolander Differential Revision: D5044001 fbshipit-source-id: f00be07f33c8018573af0b98233068ebd93360b4
127 lines
3.3 KiB
YAML
127 lines
3.3 KiB
YAML
# 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.
|
|
|
|
os: osx
|
|
osx_image: xcode8.2
|
|
language: cpp
|
|
compiler: clang
|
|
cache:
|
|
directories:
|
|
- $HOME/Library/Caches/Homebrew
|
|
|
|
env:
|
|
- TARGET=c
|
|
- TARGET=java
|
|
- TARGET=net
|
|
- TARGET=ios
|
|
- TARGET=js
|
|
- TARGET=android
|
|
|
|
before_install:
|
|
- openssl aes-256-cbc -K $encrypted_d27e803291ff_key -iv $encrypted_d27e803291ff_iv -in scripts/setup-keys.enc -d >> gradle.properties
|
|
- brew update > /dev/null
|
|
- brew install --HEAD facebook/fb/buck
|
|
|
|
# Java
|
|
- |
|
|
if [[ $TARGET = "java" ]]; then
|
|
brew cask install java &&
|
|
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) &&
|
|
export PATH=$JAVA_HOME/bin:$PATH
|
|
fi
|
|
|
|
# .NET
|
|
- |
|
|
if [[ $TARGET = "net" ]]; then
|
|
brew install mono
|
|
fi
|
|
|
|
# iOS
|
|
- |
|
|
if [[ $TARGET = "ios" ]]; then
|
|
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/;
|
|
fi
|
|
|
|
# Emscripten (used for js tests)
|
|
# Note: cannot be ran on Linux (because it will compile Clang from its sources :|)
|
|
- |
|
|
if [[ $TARGET = "js" ]]; then
|
|
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 2>&1 | grep -v '^x ' &&
|
|
/tmp/emsdk-portable/emsdk activate latest
|
|
fi
|
|
|
|
# Android
|
|
- |
|
|
if [[ $TARGET = "android" ]]; then
|
|
brew cask install java;
|
|
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8);
|
|
export PATH=$JAVA_HOME/bin:$PATH;
|
|
source scripts/android-setup.sh && installAndroidSDK
|
|
export ANDROID_SDK=$ANDROID_HOME
|
|
fi
|
|
|
|
# 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
|
|
|
|
script:
|
|
# 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
|
|
|
|
# Java
|
|
- |
|
|
if [[ $TARGET = "java" ]]; then
|
|
buck test --verbose 0 //java:java
|
|
fi
|
|
|
|
# .NET
|
|
- |
|
|
if [[ $TARGET = "net" ]]; then
|
|
sh csharp/tests/Facebook.Yoga/test_macos.sh
|
|
fi
|
|
|
|
# iOS
|
|
- |
|
|
if [[ $TARGET = "ios" ]]; then
|
|
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
|
|
fi
|
|
|
|
# Android
|
|
- |
|
|
if [[ $TARGET = "android" ]]; then
|
|
buck build --verbose 0 //android/sample:sample &&
|
|
scripts/publish-snapshot.sh
|
|
fi
|
|
|
|
# JavaScript
|
|
- |
|
|
if [[ $TARGET = "js" ]]; then (
|
|
cd javascript &&
|
|
npm run test:all &&
|
|
npm run bench
|
|
) fi
|