Compare commits

..

9 Commits

Author SHA1 Message Date
Lukas Wöhrl
2a3d9ba20e transfer current layout before calling basline function
do not reset newLayoutFlag on baseline transfer

fixed bad method call

fix reference
2018-04-28 12:58:10 +02:00
Peter van der Zee
e1c19cecad Upgrade Prettier to v1.12.1 on fbsource
Summary:
Updates Prettier to v1.12.1, using `xplat/js/scripts/prettier-bump.js` based on the playbook by https://our.intern.facebook.com/intern/wiki/Prettier/upgrade-guide/

All changes related to upgrading or running Prettier

allow-many-files
allow-large-files
bypass-lint
drop-conflicts
ignore-conflict-markers
ignore-signed-source
ignore-nocommit

Reviewed By: benjaffe, ryanmce, yungsters

Differential Revision: D7652946

fbshipit-source-id: 396d45c675e93f2298cd2920d927630c81867447
2018-04-19 03:05:38 -07:00
Pascal Hartig
8e4f3a3084 Add getParent() method for easier migration
Summary:
External partners have asked us to provide an easier way to migrate and this was
a breaking change in the most recent release.

Reviewed By: emilsjolander

Differential Revision: D7654526

fbshipit-source-id: efe44807caa97f495c5e5691dedcf281760fa23e
2018-04-18 04:45:12 -07:00
Jakub Grzmiel
9b8323ff38 Clean up BUCK files for missing dependencies and tests
Summary: Several of dependencies and tests in repository are missing (e.g. because we don't support building certain library for MacOSX). Clean up those mistakes.

Differential Revision: D7625433

fbshipit-source-id: 332b7ff7eaed82cb52f459921f1ae67b702a1636
2018-04-14 15:35:24 -07:00
Jakub Grzmiel
5b7adda620 Unbreak the build
Summary: build-break

Differential Revision: D7629493

fbshipit-source-id: baf5ca7cec2078a8ba9e34afe84da76c2edbb3b3
2018-04-14 14:58:08 -07:00
Jakub Grzmiel
ba2a3b8c91 Clean up BUCK files for missing dependencies and tests
Summary: Several of dependencies and tests in repository are missing (e.g. because we don't support building certain library for MacOSX). Clean up those mistakes.

Differential Revision: D7618360

fbshipit-source-id: 421834892519998ad088a138b3fc3d96afe34d79
2018-04-14 13:17:59 -07:00
Jonathan Kim
eb15939c23 Make yoga wrapper macros start with yoga_
Summary: Rename macros

Reviewed By: mzlee

Differential Revision: D7606834

fbshipit-source-id: a2089260dbe46f30f49a207737c83472e2fb3c63
2018-04-14 12:43:03 -07:00
Pascal Hartig
b9fa60fd74 Re-enable matrix build for Java snapshots
Summary:
Change the travis platform to Java and install Node via nvm instead. This
manually reinstalls buck and then publishes a snapshot if it builds and tests
correctly.

Reviewed By: emilsjolander, danielbuechele

Differential Revision: D7567862

fbshipit-source-id: fabdbbb13117ab8ead4eb9f10402a71d30f29c12
2018-04-10 05:33:13 -07:00
Pascal Hartig
d397aa04d7 1.8.1-SNAPSHOT
Summary: Back to snapshot release.

Reviewed By: marco-cova

Differential Revision: D7550851

fbshipit-source-id: f98983799dc9ea2a44d658fd50a2676f1d6e31d5
2018-04-09 04:03:11 -07:00
29 changed files with 201 additions and 145 deletions

View File

@@ -1,16 +1,58 @@
language: node_js
node_js:
- "8"
language: java
env:
- TARGET: website
- TARGET: android
install:
- cd website
- yarn --ignore-scripts
- cd ..
cache:
directories:
- $HOME/buck
- $HOME/.gradle
before_install:
- |
if [[ -n "$encrypted_d27e803291ff_iv" ]]; then
openssl aes-256-cbc -K $encrypted_d27e803291ff_key -iv $encrypted_d27e803291ff_iv -in scripts/setup-keys.enc -d >> gradle.properties;
fi
# Android
- |
if [[ $TARGET = "android" ]]; then
pushd $HOME
git clone --depth 1 https://github.com/facebook/buck.git
cd buck
ant
popd
export PATH=$PATH:$HOME/buck/bin/
buck --version
export TERMINAL=dumb
source scripts/android-setup.sh && installAndroidSDK
export ANDROID_SDK=$ANDROID_HOME
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-r15c
fi
# Website
- |
if [[ $TARGET = "website" ]]; then
nvm install 8
nvm use 8
fi
script:
- cd website
- yarn build
- cd ..
- |
if [[ $TARGET = "android" ]]; then
./gradlew testDebugUnit && scripts/publish-snapshot.sh
fi
- |
if [[ $TARGET = "website" ]]; then
pushd website
yarn build
popd
fi
deploy:
provider: pages
@@ -23,3 +65,4 @@ deploy:
keep-history: true
on:
branch: master
condition: $TARGET = website

6
BUCK
View File

@@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "LIBRARY_COMPILER_FLAGS", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "yoga_dep", "cxx_library", "cxx_test")
load("//:yoga_defs.bzl", "LIBRARY_COMPILER_FLAGS", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "yoga_dep", "yoga_cxx_library", "yoga_cxx_test")
GMOCK_OVERRIDE_FLAGS = [
# gmock does not mark mocked methods as override, ignore the warnings in tests
@@ -18,7 +18,7 @@ TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + [
"-std=c++1y",
]
cxx_library(
yoga_cxx_library(
name = "yoga",
srcs = glob(["yoga/*.cpp"]),
header_namespace = "",
@@ -32,7 +32,7 @@ cxx_library(
],
)
cxx_test(
yoga_cxx_test(
name = "YogaTests",
srcs = glob(["tests/*.cpp"]),
compiler_flags = TEST_COMPILER_FLAGS,

View File

@@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "yoga_dep", "apple_library", "apple_test")
load("//:yoga_defs.bzl", "yoga_dep", "yoga_apple_library", "yoga_apple_test")
COMPILER_FLAGS = [
"-fobjc-arc",
@@ -25,7 +25,7 @@ COMPILER_FLAGS = [
"-Wunused-value",
]
apple_library(
yoga_apple_library(
name = "YogaKit",
srcs = glob(["Source/**/*.m"]),
header_namespace = "",
@@ -49,7 +49,7 @@ apple_library(
],
)
apple_test(
yoga_apple_test(
name = "YogaKitTests",
srcs = glob(["Tests/**/*.m"]),
compiler_flags = COMPILER_FLAGS,

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "android_aar", "android_resource")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "yoga_android_aar", "yoga_android_resource")
android_aar(
yoga_android_aar(
name = "android",
manifest_skeleton = "src/main/AndroidManifest.xml",
visibility = [
@@ -20,7 +20,7 @@ android_aar(
],
)
android_resource(
yoga_android_resource(
name = "res",
package = "com.facebook.yoga.android",
res = "src/main/res",

View File

@@ -4,9 +4,9 @@
# This source code is licensed under the license found in the
# LICENSE-examples file in the root directory of this source tree.
load("//:yoga_defs.bzl", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_RES_TARGET", "android_binary", "android_resource")
load("//:yoga_defs.bzl", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_RES_TARGET", "yoga_android_binary", "yoga_android_resource")
android_binary(
yoga_android_binary(
name = "sample",
keystore = ":debug_keystore",
manifest = "AndroidManifest.xml",
@@ -16,7 +16,7 @@ android_binary(
],
)
android_resource(
yoga_android_resource(
name = "res",
package = "com.facebook.samples.yoga",
res = "res",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the license found in the
# LICENSE-examples file in the root directory of this source tree.
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "android_library")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "yoga_android_library")
android_library(
yoga_android_library(
name = "yoga",
srcs = glob(["**/*.java"]),
visibility = [

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "android_library")
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "yoga_android_library")
android_library(
yoga_android_library(
name = "android",
srcs = glob(["**/*.java"]),
visibility = [

View File

@@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "yoga_dep")
load("//:yoga_defs.bzl", "yoga_dep", "ANDROID", "APPLE")
cxx_binary(
name = "benchmark",
@@ -18,6 +18,7 @@ cxx_binary(
"-O3",
"-std=c11",
],
platforms = (ANDROID, APPLE),
visibility = ["PUBLIC"],
deps = [
yoga_dep(":yoga"),

View File

@@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "yoga_dep", "cxx_library", "is_apple_platform")
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "yoga_dep", "yoga_cxx_library", "is_apple_platform")
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
@@ -21,7 +21,7 @@ csharp_library(
framework_ver = "net45",
)
cxx_library(
yoga_cxx_library(
name = "yoganet",
srcs = glob(["Yoga/YGInterop.cpp"]),
compiler_flags = COMPILER_FLAGS,
@@ -42,9 +42,9 @@ if is_apple_platform():
genrule(
name = name,
srcs = [
yoga_dep(':yoga#%s,static' % arch),
yoga_dep('YogaKit:YogaKit#%s,static' % arch),
yoga_dep('csharp:yoganet#%s,static' % arch),
yoga_dep(':yogaApple#%s,static' % arch),
yoga_dep('YogaKit:YogaKitApple#%s,static' % arch),
yoga_dep('csharp:yoganetApple#%s,static' % arch),
],
out = 'libyoga-%s.a' % arch,
cmd = 'libtool -static -o $OUT $SRCS',
@@ -59,7 +59,7 @@ if is_apple_platform():
visibility = ['PUBLIC'],
)
yoganet_macosx_target = 'csharp:yoganet#macosx-%s,dynamic'
yoganet_macosx_target = 'csharp:yoganetAppleMac#macosx-%s,dynamic'
genrule(
name = 'yoganet-macosx',
srcs = [

View File

@@ -2,7 +2,7 @@
org.gradle.jvmargs=-Xmx1536M
VERSION_NAME=1.8.0
VERSION_NAME=1.8.1-SNAPSHOT
POM_URL=https://github.com/facebook/yoga
POM_SCM_URL=https://github.com/facebook/yoga.git
POM_SCM_CONNECTION=scm:git:https://github.com/facebook/yoga.git

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "FBJNI_TARGET", "JNI_TARGET", "INFER_ANNOTATIONS_TARGET", "JSR_305_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JUNIT_TARGET", "FBJNI_JAVA_TARGET", "CXX_LIBRARY_WHITELIST", "ANDROID", "yoga_dep", "cxx_library", "java_library", "java_test", "java_binary")
load("//:yoga_defs.bzl", "FBJNI_TARGET", "JNI_TARGET", "INFER_ANNOTATIONS_TARGET", "JSR_305_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JUNIT_TARGET", "FBJNI_JAVA_TARGET", "CXX_LIBRARY_WHITELIST", "ANDROID", "yoga_dep", "yoga_cxx_library", "yoga_java_library", "yoga_java_test", "yoga_java_binary")
cxx_library(
yoga_cxx_library(
name = "jni",
srcs = glob(["jni/*.cpp"]),
header_namespace = "",
@@ -28,7 +28,7 @@ cxx_library(
],
)
java_library(
yoga_java_library(
name = "java",
srcs = glob(["com/facebook/yoga/*.java"]),
required_for_source_only_abi = True,
@@ -47,7 +47,7 @@ java_library(
],
)
java_test(
yoga_java_test(
name = "tests",
srcs = glob(["tests/**/*.java"]),
cxx_library_whitelist = CXX_LIBRARY_WHITELIST,
@@ -59,7 +59,7 @@ java_test(
],
)
java_binary(
yoga_java_binary(
name = "yoga",
deps = [
":java",

View File

@@ -239,6 +239,13 @@ public class YogaNode implements Cloneable {
return mOwner;
}
/** @deprecated Use #getOwner() instead. This will be removed in the next version. */
@Deprecated
@Nullable
YogaNode getParent() {
return getOwner();
}
public int indexOf(YogaNode child) {
return mChildren == null ? -1 : mChildren.indexOf(child);
}

View File

@@ -42,7 +42,7 @@ static void YGTransferLayoutDirection(YGNodeRef node, alias_ref<jobject> javaNod
javaNode->setFieldValue(layoutDirectionField, static_cast<jint>(YGNodeLayoutGetDirection(node)));
}
static void YGTransferLayoutOutputsRecursive(YGNodeRef root) {
static void YGTransferLayoutOutputsRecursiveImpl(YGNodeRef root, bool transferAndResetNewLayoutFlag) {
if (root->getHasNewLayout()) {
if (auto obj = YGNodeJobject(root)->lockLocal()) {
static auto widthField = obj->getClass()->getField<jfloat>("mWidth");
@@ -111,12 +111,14 @@ static void YGTransferLayoutOutputsRecursive(YGNodeRef root) {
obj->setFieldValue(borderBottomField, YGNodeLayoutGetBorder(root, YGEdgeBottom));
}
obj->setFieldValue<jboolean>(hasNewLayoutField, true);
YGTransferLayoutDirection(root, obj);
root->setHasNewLayout(false);
if(transferAndResetNewLayoutFlag){
obj->setFieldValue<jboolean>(hasNewLayoutField, true);
root->setHasNewLayout(false);
}
for (uint32_t i = 0; i < YGNodeGetChildCount(root); i++) {
YGTransferLayoutOutputsRecursive(YGNodeGetChild(root, i));
YGTransferLayoutOutputsRecursiveImpl(YGNodeGetChild(root, i), transferAndResetNewLayoutFlag);
}
} else {
YGLog(root, YGLogLevelError, "Java YGNode was GCed during layout calculation\n");
@@ -124,6 +126,14 @@ static void YGTransferLayoutOutputsRecursive(YGNodeRef root) {
}
}
static void YGTransferLayoutOutputsRecursive(YGNodeRef root) {
YGTransferLayoutOutputsRecursiveImpl(root, true);
}
static void YGTransferLayoutOutputsRecursiveForBaseline(YGNodeRef root) {
YGTransferLayoutOutputsRecursiveImpl(root, false);
}
static void YGPrint(YGNodeRef node) {
if (auto obj = YGNodeJobject(node)->lockLocal()) {
cout << obj->toString() << endl;
@@ -136,6 +146,7 @@ static float YGJNIBaselineFunc(YGNodeRef node, float width, float height) {
if (auto obj = YGNodeJobject(node)->lockLocal()) {
static auto baselineFunc = findClassStatic("com/facebook/yoga/YogaNode")
->getMethod<jfloat(jfloat, jfloat)>("baseline");
YGTransferLayoutOutputsRecursiveForBaseline(node);
return baselineFunc(obj, width, height);
} else {
return height;

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "java_library")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_java_library")
java_library(
yoga_java_library(
name = "annotations",
srcs = glob(["*.java"]),
source = "1.7",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_jar")
prebuilt_jar(
yoga_prebuilt_jar(
name = "android-support",
binary_jar = "android-support-v4.jar",
visibility = YOGA_ROOTS,

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
include_defs("//yoga_defs.bzl")
load("//:yoga_defs.bzl", "yoga_prebuilt_cxx_library", "yoga_cxx_library", "YOGA_ROOTS", "FBJNI_JAVA_TARGET", "JNI_TARGET", "ANDROID")
prebuilt_cxx_library(
yoga_prebuilt_cxx_library(
name = "ndklog",
exported_platform_linker_flags = [
(
@@ -17,7 +17,7 @@ prebuilt_cxx_library(
visibility = YOGA_ROOTS,
)
cxx_library(
yoga_cxx_library(
name = "fbjni",
srcs = glob(["src/main/cpp/**/*.cpp"]),
header_namespace = "",
@@ -35,6 +35,7 @@ cxx_library(
"-Wno-unused-parameter",
"-std=c++11",
],
platforms = (ANDROID,),
visibility = ["PUBLIC"],
deps = [
":ndklog",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JSR_305_TARGET", "java_library")
load("//:yoga_defs.bzl", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JSR_305_TARGET", "yoga_java_library")
java_library(
yoga_java_library(
name = "jni",
srcs = glob(["**/*.java"]),
proguard_config = "fbjni.pro",

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "cxx_library", "YOGA_ROOTS")
load("//:yoga_defs.bzl", "yoga_cxx_library", "YOGA_ROOTS")
COMPILER_FLAGS = [
"-std=c++11",
"-Wno-missing-prototypes",
]
cxx_library(
yoga_cxx_library(
name = "gtest",
srcs = glob(["googletest/googletest/src/*.cc"]),
header_namespace = "",

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar", "java_library")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_jar", "yoga_java_library")
prebuilt_jar(
yoga_prebuilt_jar(
name = "infer-annotations-jar",
binary_jar = "infer-annotations-1.4.jar",
)
java_library(
yoga_java_library(
name = "infer-annotations",
exported_deps = [
":infer-annotations-jar",

View File

@@ -3,9 +3,9 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "cxx_library")
load("//:yoga_defs.bzl", "yoga_cxx_library")
cxx_library(
yoga_cxx_library(
name = "jni",
header_namespace = "",
exported_headers = [

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar", "java_library")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_jar", "yoga_java_library")
prebuilt_jar(
yoga_prebuilt_jar(
name = "jsr305-jar",
binary_jar = "jsr305.jar",
)
java_library(
yoga_java_library(
name = "jsr-305",
exported_deps = [
":jsr305-jar",

View File

@@ -3,14 +3,14 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//:yoga_defs.bzl", "YOGA_ROOTS", "prebuilt_jar", "java_library")
load("//:yoga_defs.bzl", "YOGA_ROOTS", "yoga_prebuilt_jar", "yoga_java_library")
prebuilt_jar(
yoga_prebuilt_jar(
name = "junit-jar",
binary_jar = "junit4.jar",
)
java_library(
yoga_java_library(
name = "junit",
exported_deps = [
":junit-jar",

View File

@@ -1,7 +1,8 @@
set -e
function download() {
echo "Downloading '$1' to '$2' ..."
if hash curl 2>/dev/null; then
curl --retry 10 -L -o "$2" "$1"
curl -s -L -o "$2" "$1"
elif hash wget 2>/dev/null; then
wget -O "$2" "$1"
else
@@ -12,38 +13,38 @@ function download() {
function installsdk() {
PROXY_ARGS=""
if [[ ! -z "$https_proxy" ]]; then
PROXY_HOST="$(cut -d : "$https_proxy" -f 1,1)"
PROXY_PORT="$(cut -d : "$https_proxy" -f 2,2)"
if [[ ! -z "$HTTPS_PROXY" ]]; then
PROXY_HOST="$(echo $HTTPS_PROXY | cut -d : -f 1,1)"
PROXY_PORT="$(echo $HTTPS_PROXY | cut -d : -f 2,2)"
PROXY_ARGS="--proxy=http --proxy_host=$PROXY_HOST --proxy_port=$PROXY_PORT"
fi
yes | "$ANDROID_HOME/tools/bin/sdkmanager" $PROXY_ARGS $@
echo y | "$ANDROID_HOME"/tools/bin/sdkmanager $PROXY_ARGS "$@"
}
function installAndroidSDK {
export ANDROID_HOME=$HOME/android-sdk
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$PATH"
if [[ ! -f "$ANDROID_HOME/tools/bin/sdkmanager" ]]; then
if [[ ! -d "$HOME/android-sdk" ]]; then
TMP=/tmp/sdk$$.zip
download 'https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip' $TMP
unzip -qod "$ANDROID_HOME" "$TMP"
download 'https://dl.google.com/android/repository/tools_r25.2.3-linux.zip' $TMP
unzip -qod "$HOME/android-sdk" $TMP
rm $TMP
fi
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
if [[ ! -d "$ANDROID_NDK_REPOSITORY/android-ndk-r15c" ]]; then
TMP=/tmp/ndk$$.zip
mkdir -p "$ANDROID_NDK_REPOSITORY"
download 'https://dl.google.com/android/repository/android-ndk-r15c-darwin-x86_64.zip' $TMP
download 'https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip' $TMP
unzip -qod "$ANDROID_NDK_REPOSITORY" "$TMP"
rm $TMP
fi
mkdir -p "$ANDROID_HOME/licenses/"
echo > "$ANDROID_HOME/licenses/android-sdk-license"
echo -n d56f5187479451eabf01fb78af6dfcb131a6481e >> "$ANDROID_HOME/licenses/android-sdk-license"
export ANDROID_HOME=$HOME/android-sdk
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$PATH"
installsdk 'build-tools;26.0.2' 'platform-tools' 'platforms;android-23' 'platforms;android-25' 'extras;android;m2repository'
mkdir -p $ANDROID_HOME/licenses/
echo > $ANDROID_HOME/licenses/android-sdk-license
echo -n d56f5187479451eabf01fb78af6dfcb131a6481e > $ANDROID_HOME/licenses/android-sdk-license
installsdk 'build-tools;25.0.3' 'build-tools;26.0.2' 'platforms;android-25' 'platforms;android-26' 'ndk-bundle' 'extras;android;m2repository'
}

View File

@@ -31,6 +31,6 @@
"develop": "gatsby develop"
},
"devDependencies": {
"prettier": "^1.10.2"
"prettier": "1.12.1"
}
}

View File

@@ -10,10 +10,12 @@
import React, {Component} from 'react';
export default () => <svg viewBox="0 0 1133.9 1133.9">
<g>
<path d="M 498.3 3.7 c 153.6 88.9 307.3 177.7 461.1 266.2 c 7.6 4.4 10.3 9.1 10.3 17.8 c -0.3 179.1 -0.2 358.3 0 537.4 c 0 8.1 -2.4 12.8 -9.7 17.1 c -154.5 88.9 -308.8 178.1 -462.9 267.5 c -9 5.2 -15.5 5.3 -24.6 0.1 c -153.9 -89.2 -307.9 -178 -462.1 -266.8 C 3 838.8 0 833.9 0 825.1 c 0.3 -179.1 0.2 -358.3 0 -537.4 c 0 -8.6 2.6 -13.6 10.2 -18 C 164.4 180.9 318.4 92 472.4 3 C 477 -1.5 494.3 -0.7 498.3 3.7 Z M 48.8 555.3 c 0 79.9 0.2 159.9 -0.2 239.8 c -0.1 10 3 15.6 11.7 20.6 c 137.2 78.8 274.2 157.8 411 237.3 c 9.9 5.7 17 5.7 26.8 0.1 c 137.5 -79.8 275.2 -159.2 412.9 -238.5 c 7.4 -4.3 10.5 -8.9 10.5 -17.8 c -0.3 -160.2 -0.3 -320.5 0 -480.7 c 0 -8.8 -2.8 -13.6 -10.3 -18 C 772.1 218 633.1 137.8 494.2 57.4 c -6.5 -3.8 -11.5 -4.5 -18.5 -0.5 C 336.8 137.4 197.9 217.7 58.8 297.7 c -7.7 4.4 -10.2 9.2 -10.2 17.9 C 48.9 395.5 48.8 475.4 48.8 555.3 Z" />
<path d="M 184.4 555.9 c 0 -33.3 -1 -66.7 0.3 -100 c 1.9 -48 24.1 -86 64.7 -110.9 c 54.8 -33.6 110.7 -65.5 167 -96.6 c 45.7 -25.2 92.9 -24.7 138.6 1 c 54.4 30.6 108.7 61.5 162.2 93.7 c 44 26.5 67.3 66.8 68 118.4 c 0.9 63.2 0.9 126.5 0 189.7 c -0.7 50.6 -23.4 90.7 -66.6 116.9 c -55 33.4 -110.8 65.4 -167.1 96.5 c -43.4 24 -89 24.2 -132.3 0.5 c -57.5 -31.3 -114.2 -64 -170 -98.3 c -41 -25.1 -62.9 -63.7 -64.5 -112.2 C 183.5 621.9 184.3 588.9 184.4 555.9 Z M 232.9 556.3 c 0 29.5 0.5 59.1 -0.1 88.6 c -0.8 39.2 16.9 67.1 50.2 86.2 c 51.2 29.4 102.2 59.2 153.4 88.4 c 31.4 17.9 63.6 18.3 95 0.6 c 53.7 -30.3 107.1 -61.2 160.3 -92.5 c 29.7 -17.5 45 -44.5 45.3 -78.8 c 0.6 -61.7 0.5 -123.5 0 -185.2 c -0.3 -34.4 -15.3 -61.5 -44.9 -79 C 637.7 352.6 583 320.8 527.9 290 c -27.5 -15.4 -57.2 -16.1 -84.7 -0.7 c -56.9 31.6 -113.4 64 -169.1 97.6 c -26.4 15.9 -40.7 41.3 -41.1 72.9 C 232.6 491.9 232.9 524.1 232.9 556.3 Z" />
<path d="M 484.9 424.4 c 69.8 -2.8 133.2 57.8 132.6 132 C 617 630 558.5 688.7 484.9 689.1 c -75.1 0.4 -132.6 -63.6 -132.7 -132.7 C 352.1 485 413.4 421.5 484.9 424.4 Z M 401.3 556.7 c -3.4 37.2 30.5 83.6 83 84.1 c 46.6 0.4 84.8 -37.6 84.9 -84 c 0.1 -46.6 -37.2 -84.4 -84.2 -84.6 C 432.2 472.1 397.9 518.3 401.3 556.7 Z" />
</g>
</svg>
export default () => (
<svg viewBox="0 0 1133.9 1133.9">
<g>
<path d="M 498.3 3.7 c 153.6 88.9 307.3 177.7 461.1 266.2 c 7.6 4.4 10.3 9.1 10.3 17.8 c -0.3 179.1 -0.2 358.3 0 537.4 c 0 8.1 -2.4 12.8 -9.7 17.1 c -154.5 88.9 -308.8 178.1 -462.9 267.5 c -9 5.2 -15.5 5.3 -24.6 0.1 c -153.9 -89.2 -307.9 -178 -462.1 -266.8 C 3 838.8 0 833.9 0 825.1 c 0.3 -179.1 0.2 -358.3 0 -537.4 c 0 -8.6 2.6 -13.6 10.2 -18 C 164.4 180.9 318.4 92 472.4 3 C 477 -1.5 494.3 -0.7 498.3 3.7 Z M 48.8 555.3 c 0 79.9 0.2 159.9 -0.2 239.8 c -0.1 10 3 15.6 11.7 20.6 c 137.2 78.8 274.2 157.8 411 237.3 c 9.9 5.7 17 5.7 26.8 0.1 c 137.5 -79.8 275.2 -159.2 412.9 -238.5 c 7.4 -4.3 10.5 -8.9 10.5 -17.8 c -0.3 -160.2 -0.3 -320.5 0 -480.7 c 0 -8.8 -2.8 -13.6 -10.3 -18 C 772.1 218 633.1 137.8 494.2 57.4 c -6.5 -3.8 -11.5 -4.5 -18.5 -0.5 C 336.8 137.4 197.9 217.7 58.8 297.7 c -7.7 4.4 -10.2 9.2 -10.2 17.9 C 48.9 395.5 48.8 475.4 48.8 555.3 Z" />
<path d="M 184.4 555.9 c 0 -33.3 -1 -66.7 0.3 -100 c 1.9 -48 24.1 -86 64.7 -110.9 c 54.8 -33.6 110.7 -65.5 167 -96.6 c 45.7 -25.2 92.9 -24.7 138.6 1 c 54.4 30.6 108.7 61.5 162.2 93.7 c 44 26.5 67.3 66.8 68 118.4 c 0.9 63.2 0.9 126.5 0 189.7 c -0.7 50.6 -23.4 90.7 -66.6 116.9 c -55 33.4 -110.8 65.4 -167.1 96.5 c -43.4 24 -89 24.2 -132.3 0.5 c -57.5 -31.3 -114.2 -64 -170 -98.3 c -41 -25.1 -62.9 -63.7 -64.5 -112.2 C 183.5 621.9 184.3 588.9 184.4 555.9 Z M 232.9 556.3 c 0 29.5 0.5 59.1 -0.1 88.6 c -0.8 39.2 16.9 67.1 50.2 86.2 c 51.2 29.4 102.2 59.2 153.4 88.4 c 31.4 17.9 63.6 18.3 95 0.6 c 53.7 -30.3 107.1 -61.2 160.3 -92.5 c 29.7 -17.5 45 -44.5 45.3 -78.8 c 0.6 -61.7 0.5 -123.5 0 -185.2 c -0.3 -34.4 -15.3 -61.5 -44.9 -79 C 637.7 352.6 583 320.8 527.9 290 c -27.5 -15.4 -57.2 -16.1 -84.7 -0.7 c -56.9 31.6 -113.4 64 -169.1 97.6 c -26.4 15.9 -40.7 41.3 -41.1 72.9 C 232.6 491.9 232.9 524.1 232.9 556.3 Z" />
<path d="M 484.9 424.4 c 69.8 -2.8 133.2 57.8 132.6 132 C 617 630 558.5 688.7 484.9 689.1 c -75.1 0.4 -132.6 -63.6 -132.7 -132.7 C 352.1 485 413.4 421.5 484.9 424.4 Z M 401.3 556.7 c -3.4 37.2 30.5 83.6 83 84.1 c 46.6 0.4 84.8 -37.6 84.9 -84 c 0.1 -46.6 -37.2 -84.4 -84.2 -84.6 C 432.2 472.1 397.9 518.3 401.3 556.7 Z" />
</g>
</svg>
);

View File

@@ -46,7 +46,9 @@ function dipOrPercent(value) {
console.log(value);
return value === 'auto'
? 'Auto'
: typeof value === 'string' && /%$/.test(value) ? 'Percent' : 'Dip';
: typeof value === 'string' && /%$/.test(value)
? 'Percent'
: 'Dip';
}
function getValue(value) {

View File

@@ -49,7 +49,7 @@ export default class URLShortener extends Component<{}, State> {
window.ga('send', {
hitType: 'event',
eventCategory: 'URLShortener',
eventAction: 'created'
eventAction: 'created',
});
}

View File

@@ -6862,9 +6862,9 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
prettier@^1.10.2:
version "1.10.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93"
prettier@1.12.1:
version "1.12.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325"
pretty-bytes@^4.0.2:
version "4.0.2"

View File

@@ -12,6 +12,7 @@ JNI_TARGET = '//lib/jni:jni'
FBJNI_TARGET = '//lib/fb:fbjni'
FBJNI_JAVA_TARGET = '//lib/fb/src/main/java/com/facebook/jni:jni'
APPCOMPAT_TARGET = '//lib/appcompat:appcompat'
APPLE = ''
ANDROID = ''
ANDROID_SUPPORT_TARGET = '//lib/android-support:android-support'
ANDROID_TARGET = '//android:android'
@@ -21,95 +22,82 @@ ANDROID_SAMPLE_JAVA_TARGET = '//android/sample/java/com/facebook/samples/yoga:yo
ANDROID_SAMPLE_RES_TARGET = '//android/sample:res'
CXX_LIBRARY_WHITELIST = [
'//:yoga',
'//lib/fb:fbjni',
'//java:jni',
'//:yoga',
'//lib/fb:fbjni',
'//java:jni',
]
BASE_COMPILER_FLAGS = [
'-fno-omit-frame-pointer',
'-fexceptions',
'-Wall',
'-Werror',
'-O3',
'-ffast-math',
'-fno-omit-frame-pointer',
'-fexceptions',
'-Wall',
'-Werror',
'-O3',
'-ffast-math',
]
LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [
'-fPIC',
'-fPIC',
]
def yoga_dep(dep):
return '//' + dep
return '//' + dep
_original_android_aar = android_aar
def android_aar(*args, **kwargs):
_original_android_aar(*args, **kwargs)
def yoga_android_aar(*args, **kwargs):
native.android_aar(*args, **kwargs)
_original_android_binary = android_binary
def android_binary(*args, **kwargs):
_original_android_binary(*args, **kwargs)
def yoga_android_binary(*args, **kwargs):
native.android_binary(*args, **kwargs)
_original_android_library = android_library
def android_library(*args, **kwargs):
_original_android_library(*args, **kwargs)
def yoga_android_library(*args, **kwargs):
native.android_library(*args, **kwargs)
_original_android_resource = android_resource
def android_resource(*args, **kwargs):
_original_android_resource(*args, **kwargs)
def yoga_android_resource(*args, **kwargs):
native.android_resource(*args, **kwargs)
_original_apple_library = apple_library
def apple_library(*args, **kwargs):
_original_apple_library(*args, **kwargs)
def yoga_apple_library(*args, **kwargs):
native.apple_library(*args, **kwargs)
_original_apple_test = apple_test
def apple_test(*args, **kwargs):
_original_apple_test(*args, **kwargs)
def yoga_apple_test(*args, **kwargs):
native.apple_test(*args, **kwargs)
_original_cxx_library = cxx_library
def cxx_library(*args, **kwargs):
# Currently unused
kwargs.pop("platforms", None)
_original_cxx_library(*args, **kwargs)
def yoga_cxx_library(*args, **kwargs):
# Currently unused
kwargs.pop("platforms", None)
native.cxx_library(*args, **kwargs)
_original_cxx_test = cxx_test
def cxx_test(*args, **kwargs):
_original_cxx_test(*args, **kwargs)
def yoga_cxx_test(*args, **kwargs):
native.cxx_test(*args, **kwargs)
_original_java_binary = java_binary
def java_binary(*args, **kwargs):
_original_java_binary(*args, **kwargs)
def yoga_java_binary(*args, **kwargs):
native.java_binary(*args, **kwargs)
_original_java_library = java_library
def java_library(*args, **kwargs):
_original_java_library(*args, **kwargs)
def yoga_java_library(*args, **kwargs):
native.java_library(*args, **kwargs)
_original_java_test = java_test
def java_test(*args, **kwargs):
_original_java_test(*args, **kwargs)
def yoga_java_test(*args, **kwargs):
native.java_test(*args, **kwargs)
_original_prebuilt_cxx_library = prebuilt_cxx_library
def prebuilt_cxx_library(*args, **kwargs):
_original_prebuilt_cxx_library(*args, **kwargs)
def yoga_prebuilt_cxx_library(*args, **kwargs):
native.prebuilt_cxx_library(*args, **kwargs)
_original_prebuilt_jar = prebuilt_jar
def prebuilt_jar(*args, **kwargs):
_original_prebuilt_jar(*args, **kwargs)
def yoga_prebuilt_jar(*args, **kwargs):
native.prebuilt_jar(*args, **kwargs)
def is_apple_platform():
return True
return True