Rename directories

Reviewed By: gkassabli

Differential Revision: D4284681

Summary: Rename csslayout directories to yoga

fbshipit-source-id: f0c6855c2c6e4389b7867f48f72cbb697830fc5a
This commit is contained in:
Emil Sjolander
2016-12-07 05:12:11 -08:00
committed by Facebook Github Bot
parent 40371cbf2d
commit b11155423c
89 changed files with 82 additions and 83 deletions

View File

@@ -21,7 +21,7 @@ before_install:
- export PATH=$JAVA_HOME/bin:$PATH
script:
- buck test //:CSSLayout
- buck test //:yoga
- buck test //java:java
- buck test //YogaKit:YogaKit --config cxx.default_platform=iphonesimulator-x86_64 --config cxx.cflags=-DTRAVIS_CI
- sh csharp/tests/Facebook.Yoga/test_macos.sh

10
BUCK
View File

@@ -24,14 +24,14 @@ COMPILER_FLAGS = BASE_COMPILER_FLAGS + ['-std=c11', '-fPIC']
TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + ['-std=c++11']
cxx_library(
name = 'CSSLayout',
srcs = glob(['CSSLayout/*.c']),
name = 'yoga',
srcs = glob(['yoga/*.c']),
tests=[':tests'],
exported_headers = subdir_glob([('', 'CSSLayout/*.h')]),
exported_headers = subdir_glob([('', 'yoga/*.h')]),
header_namespace = '',
compiler_flags = COMPILER_FLAGS,
deps = [] if THIS_IS_FBOBJC else [
csslayout_dep('lib/fb:ndklog'),
yoga_dep('lib/fb:ndklog'),
],
visibility = ['PUBLIC'],
)
@@ -42,7 +42,7 @@ cxx_test(
srcs = glob(['tests/*.cpp']),
compiler_flags = TEST_COMPILER_FLAGS,
deps = [
':CSSLayout',
':yoga',
GTEST_TARGET,
],
visibility = ['PUBLIC'],

View File

@@ -1,5 +1,5 @@
CSSLAYOUT_ROOT = '//...'
YOGA_ROOT = '//...'
INFER_ANNOTATIONS_TARGET = '//lib/infer-annotations:infer-annotations'
JSR_305_TARGET = '//lib/jsr-305:jsr-305'
JUNIT_TARGET = '//lib/junit:junit'
@@ -12,12 +12,12 @@ FBJNI_TARGET = '//lib/fb:fbjni'
THIS_IS_FBOBJC = False
CXX_LIBRARY_WHITELIST = [
'//:CSSLayout',
'//:yoga',
'//lib/fb:fbjni',
'//java:jni',
]
def csslayout_dep(dep):
def yoga_dep(dep):
return '//' + dep
class allow_unsafe_import:

View File

@@ -7,7 +7,7 @@
include_defs('//YOGA_DEFS')
UIKIT_CSSLAYOUT_COMPILER_FLAGS = [
COMPILER_FLAGS = [
'-fobjc-arc',
'-Wconditional-uninitialized',
'-Wdangling-else',
@@ -29,7 +29,7 @@ UIKIT_CSSLAYOUT_COMPILER_FLAGS = [
apple_library(
name = 'YogaKit',
compiler_flags = UIKIT_CSSLAYOUT_COMPILER_FLAGS,
compiler_flags = COMPILER_FLAGS,
tests = [':YogaKitTests'],
srcs = glob(['*.m']),
exported_headers = glob(['*.h']),
@@ -38,14 +38,14 @@ apple_library(
'$SDKROOT/System/Library/Frameworks/UIKit.framework',
],
deps = [
csslayout_dep(':CSSLayout'),
yoga_dep(':yoga'),
],
visibility = ['PUBLIC'],
)
apple_test(
name = 'YogaKitTests',
compiler_flags = UIKIT_CSSLAYOUT_COMPILER_FLAGS,
compiler_flags = COMPILER_FLAGS,
info_plist = 'Tests/Info.plist',
srcs = glob(['Tests/**/*.m']),
frameworks = [

View File

@@ -8,7 +8,7 @@
*/
#import <UIKit/UIKit.h>
#import <CSSLayout/Yoga.h>
#import <yoga/Yoga.h>
@interface UIView (Yoga)

View File

@@ -21,7 +21,7 @@ cxx_binary(
'-std=c11',
],
deps = [
csslayout_dep(':CSSLayout'),
yoga_dep(':yoga'),
],
visibility = ['PUBLIC'],
)

View File

@@ -9,7 +9,7 @@
#include "YGBenchmark.h"
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
static YGSize _measure(YGNodeRef node,
float width,

View File

@@ -6,14 +6,14 @@
# of patent rights can be found in the PATENTS file in the same directory.
csharp_library(
name = 'csslibnet46',
name = 'yogalibnet46',
dll_name = 'Facebook.Yoga.dll',
framework_ver = 'net46',
srcs = glob(['**/*.cs']),
)
csharp_library(
name = 'csslibnet45',
name = 'yogalibnet45',
dll_name = 'Facebook.Yoga.dll',
framework_ver = 'net45',
srcs = glob(['**/*.cs']),

View File

@@ -28,13 +28,13 @@ namespace Facebook.Yoga
public static extern IntPtr YGNodeNew();
[DllImport(DllName)]
public static extern void YGNodeInit(IntPtr cssNode);
public static extern void YGNodeInit(IntPtr node);
[DllImport(DllName)]
public static extern void YGNodeFree(IntPtr cssNode);
public static extern void YGNodeFree(IntPtr node);
[DllImport(DllName)]
public static extern void YGNodeReset(IntPtr cssNode);
public static extern void YGNodeReset(IntPtr node);
[DllImport(DllName)]
public static extern int YGNodeGetInstanceCount();

View File

@@ -9,7 +9,7 @@
#pragma once
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
YG_EXTERN_C_BEGIN

View File

@@ -150,16 +150,16 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\CSSLayout\Yoga.h" />
<ClInclude Include="..\..\CSSLayout\YGMacros.h" />
<ClInclude Include="..\..\CSSLayout\YGNodeList.h" />
<ClInclude Include="..\..\yoga\Yoga.h" />
<ClInclude Include="..\..\yoga\YGMacros.h" />
<ClInclude Include="..\..\yoga\YGNodeList.h" />
<ClInclude Include="YGInterop.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\CSSLayout\Yoga.c" />
<ClCompile Include="..\..\CSSLayout\YGNodeList.c" />
<ClCompile Include="..\..\yoga\Yoga.c" />
<ClCompile Include="..\..\yoga\YGNodeList.c" />
<ClCompile Include="YGInterop.cpp" />
<ClCompile Include="dllmain.cpp">
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>

View File

@@ -21,13 +21,13 @@
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\CSSLayout\Yoga.h">
<ClInclude Include="..\..\yoga\Yoga.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\CSSLayout\YGMacros.h">
<ClInclude Include="..\..\yoga\YGMacros.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\CSSLayout\YGNodeList.h">
<ClInclude Include="..\..\yoga\YGNodeList.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="YGInterop.h">
@@ -41,10 +41,10 @@
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\CSSLayout\Yoga.c">
<ClCompile Include="..\..\yoga\Yoga.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\CSSLayout\YGNodeList.c">
<ClCompile Include="..\..\yoga\YGNodeList.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="YGInterop.cpp">

View File

@@ -28,6 +28,6 @@ if [ -d $NUNIT \
rm NUnit-2.6.4.zip
fi
clang -g -Wall -Wextra -dynamiclib -o libyoga.dylib -I../../.. ../../../CSSLayout/*.c ../../Yoga/YGInterop.cpp
clang -g -Wall -Wextra -dynamiclib -o libyoga.dylib -I../../.. ../../../yoga/*.c ../../Yoga/YGInterop.cpp
mcs -debug -t:library -r:$NUNIT/nunit.framework.dll -out:YogaTest.dll *.cs ../../../csharp/Facebook.Yoga/*cs
MONO_PATH=$NUNIT mono --arch=64 --debug $NUNIT/nunit-console.exe YogaTest.dll

View File

@@ -114,7 +114,7 @@ def to_java_upper(symbol):
root = os.path.dirname(__file__)
# write out C header
with open(root + '/CSSLayout/YGEnums.h', 'w') as f:
with open(root + '/yoga/YGEnums.h', 'w') as f:
f.write(LICENSE)
f.write('#pragma once\n\n')
f.write('#include "YGMacros.h"\n\n')
@@ -133,7 +133,7 @@ with open(root + '/CSSLayout/YGEnums.h', 'w') as f:
# write out java files
for name, values in ENUMS.items():
with open(root + '/java/com/facebook/csslayout/Yoga%s.java' % name, 'w') as f:
with open(root + '/java/com/facebook/yoga/Yoga%s.java' % name, 'w') as f:
f.write(LICENSE)
f.write('package com.facebook.yoga;\n\n')
f.write('import com.facebook.proguard.annotations.DoNotStrip;\n\n')

View File

@@ -29,7 +29,6 @@ clang-format \
SpaceAfterCStyleCast: true, \
UseTab: Never, \
}" "$@" \
-i $(dirname $0)/CSSLayout/*.{h,c,cpp} \
$(dirname $0)/tests/CSSLayoutTestUtils/*.{h,c,cpp} \
-i $(dirname $0)/yoga/*.{h,c,cpp} \
$(dirname $0)/benchmarks/*.{h,c,cpp} \
$(dirname $0)/java/jni/*.{h,c,cpp}

View File

@@ -20,7 +20,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
emitPrologue:{value:function() {
this.push([
'#include <CSSLayout/Yoga.h>',
'#include <yoga/Yoga.h>',
'#include <gtest/gtest.h>',
'',
]);

View File

@@ -40,7 +40,7 @@ Dir['fixtures/*.html'].each do |file|
f.write eval(logs[0].message.sub(/^[^"]*/, ''))
f.close
f = File.open("../java/tests/com/facebook/csslayout/#{name}.java", 'w')
f = File.open("../java/tests/com/facebook/yoga/#{name}.java", 'w')
f.write eval(logs[1].message.sub(/^[^"]*/, '')).sub('YogaTest', name)
f.close

View File

@@ -24,16 +24,16 @@ cxx_library(
deps = [
FBJNI_TARGET,
JNI_TARGET,
csslayout_dep(':CSSLayout'),
yoga_dep(':yoga'),
],
visibility = ['PUBLIC'],
)
java_library(
name = 'java',
srcs = glob(['com/facebook/csslayout/*.java']),
srcs = glob(['com/facebook/yoga/*.java']),
tests=[
csslayout_dep('java:tests'),
yoga_dep('java:tests'),
],
source = '1.7',
target = '1.7',

View File

@@ -13,5 +13,5 @@ java_library(
source = '1.7',
target = '1.7',
deps = [],
visibility = [CSSLAYOUT_ROOT],
visibility = [YOGA_ROOT],
)

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <fb/fbjni.h>
#include <iostream>

View File

@@ -13,7 +13,7 @@ prebuilt_cxx_library(
exported_platform_linker_flags = [
('android.*', ['-llog']),
],
visibility = [CSSLAYOUT_ROOT],
visibility = [YOGA_ROOT],
)
cxx_library(

View File

@@ -23,5 +23,5 @@ cxx_library(
header_namespace = '',
compiler_flags = COMPILER_FLAGS,
deps = [],
visibility = [CSSLAYOUT_ROOT],
visibility = [YOGA_ROOT],
)

View File

@@ -17,5 +17,5 @@ java_library(
exported_deps = [
':infer-annotations-jar',
],
visibility = [CSSLAYOUT_ROOT],
visibility = [YOGA_ROOT],
)

View File

@@ -17,5 +17,5 @@ java_library(
exported_deps = [
':jsr305-jar',
],
visibility = [CSSLAYOUT_ROOT],
visibility = [YOGA_ROOT],
)

View File

@@ -17,5 +17,5 @@ java_library(
exported_deps = [
':junit-jar',
],
visibility = [CSSLAYOUT_ROOT],
visibility = [YOGA_ROOT],
)

View File

@@ -10,5 +10,5 @@ include_defs('//YOGA_DEFS')
android_prebuilt_aar(
name = 'soloader',
aar = 'soloader-0.1.0.aar',
visibility = [CSSLAYOUT_ROOT],
visibility = [YOGA_ROOT],
)

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, absolute_layout_width_height_start_top) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, align_content_flex_start) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, align_items_stretch) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, align_self_center) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, border_no_size) {

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, dirty_propagation) {

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, start_overrides) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, flex_direction_column_no_height) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, flex_basis_flex_grow_column) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, wrap_column) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, justify_content_row_flex_start) {

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
static YGSize _measure(YGNodeRef node,

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, assert_default_values) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, margin_start) {

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
static YGSize _measureMax(YGNodeRef node,

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
struct _MeasureConstraint {

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
static YGSize _measure(YGNodeRef node,

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
extern int32_t gNodeInstanceCount;

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, max_width) {

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, padding_no_size) {

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, dont_cache_computed_flex_basis_between_layouts) {

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
static YGSize _measureFloor(YGNodeRef node,

View File

@@ -9,7 +9,7 @@
// @Generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, rounding_flex_basis_flex_grow_row_width_of_100) {

View File

@@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <CSSLayout/Yoga.h>
#include <yoga/Yoga.h>
#include <gtest/gtest.h>
TEST(YogaTest, copy_style_same) {

View File

@@ -2653,21 +2653,21 @@ inline bool YGIsExperimentalFeatureEnabled(YGExperimentalFeature feature) {
return experimentalFeatures[feature];
}
void YGSetMemoryFuncs(YGMalloc YGMalloc, YGCalloc YGCalloc, YGRealloc YGRealloc, YGFree YGFree) {
void YGSetMemoryFuncs(YGMalloc ygmalloc, YGCalloc yccalloc, YGRealloc ygrealloc, YGFree ygfree) {
YG_ASSERT(gNodeInstanceCount == 0, "Cannot set memory functions: all node must be freed first");
YG_ASSERT((YGMalloc == NULL && YGCalloc == NULL && YGRealloc == NULL && YGFree == NULL) ||
(YGMalloc != NULL && YGCalloc != NULL && YGRealloc != NULL && YGFree != NULL),
YG_ASSERT((ygmalloc == NULL && yccalloc == NULL && ygrealloc == NULL && ygfree == NULL) ||
(ygmalloc != NULL && yccalloc != NULL && ygrealloc != NULL && ygfree != NULL),
"Cannot set memory functions: functions must be all NULL or Non-NULL");
if (YGMalloc == NULL || YGCalloc == NULL || YGRealloc == NULL || YGFree == NULL) {
if (ygmalloc == NULL || yccalloc == NULL || ygrealloc == NULL || ygfree == NULL) {
gYGMalloc = &malloc;
gYGCalloc = &calloc;
gYGRealloc = &realloc;
gYGFree = &free;
} else {
gYGMalloc = YGMalloc;
gYGCalloc = YGCalloc;
gYGRealloc = YGRealloc;
gYGFree = YGFree;
gYGMalloc = ygmalloc;
gYGCalloc = yccalloc;
gYGRealloc = ygrealloc;
gYGFree = ygfree;
}
}

View File

@@ -175,6 +175,6 @@ WIN_EXPORT void YGSetExperimentalFeatureEnabled(YGExperimentalFeature feature, b
WIN_EXPORT bool YGIsExperimentalFeatureEnabled(YGExperimentalFeature feature);
WIN_EXPORT void
YGSetMemoryFuncs(YGMalloc cssMalloc, YGCalloc cssCalloc, YGRealloc cssRealloc, YGFree cssFree);
YGSetMemoryFuncs(YGMalloc ygmalloc, YGCalloc yccalloc, YGRealloc ygrealloc, YGFree ygfree);
YG_EXTERN_C_END