forked from facebook/yoga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
124 lines (109 loc) · 3.28 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# 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
env:
- TARGET=c
- TARGET=java
- TARGET=net
- TARGET=ios
- TARGET=js
- TARGET=android
before_install:
- brew update > /dev/null
- brew tap facebook/fb
- brew install 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 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 >& /dev/null &&
/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;
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;
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 &&
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
fi
# JavaScript
- |
if [[ $TARGET = "js" ]]; then (
cd javascript &&
npm run test:all &&
npm run bench
) fi