Skip to content

Commit

Permalink
Migrate yoga defs to Skylark syntax.
Browse files Browse the repository at this point in the history
Summary: https://our.intern.facebook.com/intern/dex/buck/python-to-skylark/

Reviewed By: adamjernst

Differential Revision: D6411822

fbshipit-source-id: 2abe2c183d1b1a28349d0c7bd765754688ec4441
  • Loading branch information
ttsugriy authored and facebook-github-bot committed Nov 27, 2017
1 parent afaafb4 commit dec1172
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 24 deletions.
2 changes: 1 addition & 1 deletion BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
include_defs("//yoga_defs.bzl")

GMOCK_OVERRIDE_FLAGS = [
# gmock does not mark mocked methods as override, ignore the warnings in tests
Expand Down
2 changes: 1 addition & 1 deletion YogaKit/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
include_defs("//yoga_defs.bzl")

COMPILER_FLAGS = [
"-fobjc-arc",
Expand Down
2 changes: 1 addition & 1 deletion android/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET")

android_aar(
name = "android",
Expand Down
2 changes: 1 addition & 1 deletion android/sample/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This source code is licensed under the license found in the
# LICENSE-examples file in the root directory of this source tree.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_RES_TARGET")

android_binary(
name = "sample",
Expand Down
2 changes: 1 addition & 1 deletion android/sample/java/com/facebook/samples/yoga/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "ANDROID_SUPPORT_TARGET", "SOLOADER_TARGET")

android_library(
name = "yoga",
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/facebook/yoga/android/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET")

android_library(
name = "android",
Expand Down
2 changes: 1 addition & 1 deletion benchmark/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "yoga_dep")

cxx_binary(
name = "benchmark",
Expand Down
2 changes: 1 addition & 1 deletion csharp/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# of patent rights can be found in the PATENTS file in the same directory.

load("@xplat//configurations/buck:default_platform_defs", "is_apple_platform")
load("//:YOGA_DEFS", "BASE_COMPILER_FLAGS", "yoga_dep", "cxx_library")
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "yoga_dep", "cxx_library")

COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]

Expand Down
2 changes: 1 addition & 1 deletion java/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
include_defs("//yoga_defs.bzl")

cxx_library(
name = "jni",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "YOGA_ROOTS")

java_library(
name = "annotations",
Expand Down
2 changes: 1 addition & 1 deletion lib/android-support/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "YOGA_ROOTS")

prebuilt_jar(
name = "android-support",
Expand Down
2 changes: 1 addition & 1 deletion lib/appcompat/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "YOGA_ROOTS")

android_prebuilt_aar(
name = "appcompat",
Expand Down
2 changes: 1 addition & 1 deletion lib/fb/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
include_defs("//yoga_defs.bzl")

prebuilt_cxx_library(
name = "ndklog",
Expand Down
2 changes: 1 addition & 1 deletion lib/fb/src/main/java/com/facebook/jni/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "JSR_305_TARGET")

java_library(
name = "jni",
Expand Down
2 changes: 1 addition & 1 deletion lib/gtest/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
include_defs("//yoga_defs.bzl")

COMPILER_FLAGS = [
"-std=c++11",
Expand Down
2 changes: 1 addition & 1 deletion lib/infer-annotations/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "YOGA_ROOTS")

prebuilt_jar(
name = "infer-annotations-jar",
Expand Down
2 changes: 1 addition & 1 deletion lib/jsr-305/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "YOGA_ROOTS")

prebuilt_jar(
name = "jsr305-jar",
Expand Down
2 changes: 1 addition & 1 deletion lib/junit/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "YOGA_ROOTS")

prebuilt_jar(
name = "junit-jar",
Expand Down
2 changes: 1 addition & 1 deletion lib/soloader/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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.

include_defs("//YOGA_DEFS")
load("//:yoga_defs.bzl", "YOGA_ROOTS")

android_prebuilt_aar(
name = "soloader",
Expand Down
7 changes: 2 additions & 5 deletions YOGA_DEFS → yoga_defs.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Provides macros for working with yoga library."""

YOGA_ROOTS = ['//...']
JAVA_TARGET = '//java:java'
Expand Down Expand Up @@ -38,10 +39,6 @@ LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [
'-fPIC',
]


def yoga_dep(dep):
return '//' + dep

with allow_unsafe_import():
import os.path
def isdir(filename):
return os.path.isdir(filename)

0 comments on commit dec1172

Please sign in to comment.