diff --git a/eden/fs/cli/TARGETS b/eden/fs/cli/TARGETS new file mode 100644 index 0000000000..2434a351da --- /dev/null +++ b/eden/fs/cli/TARGETS @@ -0,0 +1,50 @@ +include_defs('//eden/DEFS') + +if is_facebook_internal(): + edenfs_target = '@/eden/fs/service:edenfs' +else: + edenfs_target = '@/eden/fs/service:edenfs-oss' + +python_binary( + name = 'cli', + py_version = "<3", + srcs = glob(['*.py'], excludes = ['__init__.py']), + gen_srcs = { + edenfs_target: 'eden-server', + }, + main_module = 'eden/fs/cli/main', + deps = [ + ':glue', + '@/eden/fs/importer/git:git', + '@/eden/fs/inodes:inodes', + '@/eden/fs/service:thrift-py', + '@/libfb/py:parutil', + ], +) + +python_library( + name = 'glue', + srcs = [ + '__init__.py', + ], + base_module = 'glue', + deps = [ + ':_glue', + ], +) + +cpp_python_extension( + name = '_glue', + base_module = 'glue', + srcs = [ + '_glue.pyx', + ], + cython_args = [ + '--cplus', + '-3', + ], + compiler_flags=['-fno-strict-aliasing'], + deps = [ + '@/eden/fs/importer/git:git', + ], +) diff --git a/eden/fs/config/TARGETS b/eden/fs/config/TARGETS new file mode 100644 index 0000000000..8e593eb038 --- /dev/null +++ b/eden/fs/config/TARGETS @@ -0,0 +1,9 @@ +cpp_library( + name = 'config', + srcs = glob(['*.cpp']), + headers = glob(['*.h']), + deps = [ + '@/eden/utils:utils', + '@/folly:folly', + ], +) diff --git a/eden/fs/config/test/TARGETS b/eden/fs/config/test/TARGETS new file mode 100644 index 0000000000..36aeaa38cf --- /dev/null +++ b/eden/fs/config/test/TARGETS @@ -0,0 +1,12 @@ +cpp_unittest( + name = 'test', + srcs = glob(['*Test.cpp']), + deps = [ + '@/eden/fs/config:config', + '@/eden/utils:utils', + ], + external_deps = [ + ('boost', 'any'), + 'gtest', + ], +) diff --git a/eden/fs/importer/git/TARGETS b/eden/fs/importer/git/TARGETS new file mode 100644 index 0000000000..190ce4f5cf --- /dev/null +++ b/eden/fs/importer/git/TARGETS @@ -0,0 +1,26 @@ +MAIN_SRCS = ['main.cpp'] + +cpp_library( + name = 'git', + srcs = glob(['*.cpp'], excludes = MAIN_SRCS), + headers = glob(['*.h']), + deps = [ + '@/eden/fs/model:model', + '@/eden/fs/store:store', + '@/folly:folly', + ], + external_deps = [ + ('boost', 'any'), # Just in case? + ('libgit2', None, 'git2'), + ('openssl', None, 'ssl'), + ], +) + +cpp_binary( + name = 'main', + srcs = MAIN_SRCS, + deps = [ + ':git', + '@/folly/init:init', + ], +) diff --git a/eden/fs/importer/git/test/TARGETS b/eden/fs/importer/git/test/TARGETS new file mode 100644 index 0000000000..4a29bbffc5 --- /dev/null +++ b/eden/fs/importer/git/test/TARGETS @@ -0,0 +1,14 @@ +python_unittest( + name = 'test', + py_version = "<3", + srcs = [ + 'integration_test.py', + ], + gen_srcs = { + '@/eden/fs/importer/git:main': 'main', + }, + deps = [ + '@/libfb/py:parutil', + '@/eden/fs/importer/git:main', + ], +) diff --git a/eden/fs/inodes/TARGETS b/eden/fs/inodes/TARGETS new file mode 100644 index 0000000000..a51013df0b --- /dev/null +++ b/eden/fs/inodes/TARGETS @@ -0,0 +1,15 @@ +cpp_library( + name = 'inodes', + srcs = glob(['*.cpp']), + headers = glob(['*.h']), + deps = [ + '@/folly:folly', + '@/eden/fs/model:model', + '@/eden/fs/overlay:overlay', + '@/eden/fs/store:store', + '@/eden/fuse:fusell', + ], + external_deps = [ + ('boost', 'any'), + ], +) diff --git a/eden/fs/integration/TARGETS b/eden/fs/integration/TARGETS new file mode 100644 index 0000000000..1d5da5c542 --- /dev/null +++ b/eden/fs/integration/TARGETS @@ -0,0 +1,12 @@ +python_unittest( + name='integration', + py_version="<3", + srcs=glob(['*.py']), + gen_srcs = { + '@/eden/fs/cli:cli': 'eden-cli', + }, + deps=[ + '@/libfb/py:parutil', + '@/eden/fs/cli:cli', + ], +) diff --git a/eden/fs/mercurial/TARGETS b/eden/fs/mercurial/TARGETS new file mode 100644 index 0000000000..0ac26ca0a1 --- /dev/null +++ b/eden/fs/mercurial/TARGETS @@ -0,0 +1,9 @@ +cpp_library( + name="mercurial", + srcs=glob(['*.cpp']), + headers=glob(['*.h']), + deps=[ + "@/folly:folly", + "@/eden/fuse:fusell", + ], +) diff --git a/eden/fs/model/TARGETS b/eden/fs/model/TARGETS new file mode 100644 index 0000000000..5dd2bbb282 --- /dev/null +++ b/eden/fs/model/TARGETS @@ -0,0 +1,12 @@ +cpp_library( + name = 'model', + srcs = glob(['*.cpp']), + headers = glob(['*.h']), + deps = [ + '@/folly:folly', + '@/eden/utils:utils', + ], + external_deps = [ + ('boost', 'any'), + ], +) diff --git a/eden/fs/model/git/TARGETS b/eden/fs/model/git/TARGETS new file mode 100644 index 0000000000..fa7fdfc958 --- /dev/null +++ b/eden/fs/model/git/TARGETS @@ -0,0 +1,12 @@ +cpp_library( + name = 'git', + srcs = glob(['*.cpp']), + headers = glob(['*.h']), + deps = [ + '@/folly:folly', + '@/eden/fs/model:model', + ], + external_deps = [ + ('libgit2', None, 'git2'), + ], +) diff --git a/eden/fs/model/git/test/TARGETS b/eden/fs/model/git/test/TARGETS new file mode 100644 index 0000000000..c7cd2828d8 --- /dev/null +++ b/eden/fs/model/git/test/TARGETS @@ -0,0 +1,15 @@ +cpp_unittest( + name = 'test', + srcs = glob(['*Test.cpp']), + deps = [ + '@/eden/fs/model:model', + '@/eden/fs/model/git:git', + '@/folly:folly', + '@/crypto/lib/cpp:fbcrypto-base', + ], + external_deps = [ + 'glog', + 'gmock', + 'gtest', + ], +) diff --git a/eden/fs/model/test/TARGETS b/eden/fs/model/test/TARGETS new file mode 100644 index 0000000000..ff83995385 --- /dev/null +++ b/eden/fs/model/test/TARGETS @@ -0,0 +1,10 @@ +cpp_unittest( + name = 'test', + srcs = glob(['*Test.cpp']), + deps = [ + '@/eden/fs/model:model', + ], + external_deps = [ + 'gtest', + ], +) diff --git a/eden/fs/overlay/TARGETS b/eden/fs/overlay/TARGETS new file mode 100644 index 0000000000..e1f6ca2e0f --- /dev/null +++ b/eden/fs/overlay/TARGETS @@ -0,0 +1,21 @@ +cpp_library( + name = 'overlay', + srcs = glob(['*.cpp']), + headers = glob(['*.h']), + deps = [ + '@/folly:folly', + '@/eden/utils:utils', + ], + external_deps = [ + ('boost', 'any'), + ], +) + +cpp_unittest( + name = "test_overlay", + srcs = glob(['test/*Test.cpp']), + deps = [ + ':overlay', + '@/folly/experimental:test_util', + ], +) diff --git a/eden/fs/rocksdb/TARGETS b/eden/fs/rocksdb/TARGETS new file mode 100644 index 0000000000..b31ac5709a --- /dev/null +++ b/eden/fs/rocksdb/TARGETS @@ -0,0 +1,11 @@ +cpp_library( + name = 'rocksdb', + srcs = glob(['*.cpp']), + headers = glob(['*.h']), + deps = [ + '@/folly:folly', + ], + external_deps = [ + 'rocksdb', + ], +) diff --git a/eden/fs/service/TARGETS b/eden/fs/service/TARGETS new file mode 100644 index 0000000000..7aa69b3fc0 --- /dev/null +++ b/eden/fs/service/TARGETS @@ -0,0 +1,63 @@ +include_defs('//eden/DEFS') +include_defs('//eden/fs/service/DEFS') + +create_eden_fs_rules( + suffix = '-oss', + subdir = 'out.oss', + server_srcs = ['oss/EdenServer.cpp'], + server_deps = [], +) + +thrift_library( + name = 'thrift', + thrift_args = ['--strict'], + thrift_srcs = { + 'eden.thrift': ['EdenService'], + }, + py_base_module = 'facebook', + languages = ['cpp2', 'java', 'py'], + deps = ['@/common/fb303/if:fb303'], +) + +if is_facebook_internal(): + include_defs('//eden/fs/service/facebook/DEFS') + create_eden_fs_rules( + suffix = '', + subdir = 'out.fb', + server_srcs = ['facebook/EdenServer.cpp'], + server_deps = ['@/common/services/cpp:cpp'], + ) + +# JAVA BINDINGS FOR THRIFT ENDPOINT +# +# There are two JAR files that we expect Java clients to use: +# 1. A JAR that defines Eden's Thrift API. +# 2. A JAR that contains the general Java library for Thrift. +# +# For 1, when eden.thrift changes, run: +# +# buck build //eden/fs/service:thrift#java +# +# Copy the resulting JAR (`buck --show-output //eden/fs/service:thrift#java`) to +# the project where you are using Eden in Java. +# +# For 2, you should only have to build this once: +# +# buck build //eden/fs/service:java-thrift-dependencies +# +# Copy the resulting JAR +# (`buck --show-output //eden/fs/service:java-thrift-dependencies`) to any +# project where you are using Thrift in Java. In theory, if the Java bindings +# for Thrift change, you will have to rebuild this, but it's unclear whether +# that code sees much activity these days. To be safe, you could always update +# this JAR when you update the Eden JAR. + +# This java_binary() exists as a simple way to get //thrift/lib/java/src:thrift +# and all of its transitive dependencies into one JAR file. +java_binary( + name = 'java-thrift-dependencies', + deps = [ + '//common/fb303/if:fb303#java', + '//thrift/lib/java/src:thrift', + ], +) diff --git a/eden/fs/store/TARGETS b/eden/fs/store/TARGETS new file mode 100644 index 0000000000..2e31b3dbec --- /dev/null +++ b/eden/fs/store/TARGETS @@ -0,0 +1,14 @@ +cpp_library( + name = 'store', + srcs = glob(['*.cpp']), + headers = glob(['*.h']), + deps = [ + '@/eden/fs/rocksdb:rocksdb', + '@/eden/fs/model:model', + '@/eden/fs/model/git:git', + '@/folly:folly', + ], + external_deps = [ + 'rocksdb', + ], +) diff --git a/eden/fs/store/test/TARGETS b/eden/fs/store/test/TARGETS new file mode 100644 index 0000000000..1860616b6c --- /dev/null +++ b/eden/fs/store/test/TARGETS @@ -0,0 +1,14 @@ +cpp_unittest( + name = 'test', + srcs = glob(['*Test.cpp']), + deps = [ + '@/crypto/lib/cpp:fbcrypto-base', + '@/eden/fs/model:model', + '@/eden/fs/store:store', + '@/folly:folly', + '@/folly/experimental:test_util', + ], + external_deps = [ + 'gtest', + ], +) diff --git a/eden/fuse/TARGETS b/eden/fuse/TARGETS new file mode 100644 index 0000000000..d7a2a7c959 --- /dev/null +++ b/eden/fuse/TARGETS @@ -0,0 +1,14 @@ +cpp_library( + name = "fusell", + srcs = glob(["*.cpp", "passthru/*.cpp"]), + headers = glob(["*.h", "passthru/*.h"]), + deps = [ + "@/folly:folly", + "@/wangle:wangle", + "@/eden/fuse/privhelper:privhelper", + "@/eden/utils:utils", + ], + external_deps = [ + ('fuse', None, 'fuse'), + ], +) diff --git a/eden/fuse/privhelper/TARGETS b/eden/fuse/privhelper/TARGETS new file mode 100644 index 0000000000..9ba1c2c926 --- /dev/null +++ b/eden/fuse/privhelper/TARGETS @@ -0,0 +1,9 @@ +cpp_library( + name = "privhelper", + srcs = glob(["*.cpp"]), + headers = glob(["*.h"]), + deps = [ + "@/folly/io:iobuf", + "@/folly:folly", + ], +) diff --git a/eden/fuse/privhelper/test/TARGETS b/eden/fuse/privhelper/test/TARGETS new file mode 100644 index 0000000000..7273dee709 --- /dev/null +++ b/eden/fuse/privhelper/test/TARGETS @@ -0,0 +1,11 @@ +cpp_unittest( + name = "privhelper_test", + srcs = [ + "PrivHelperTest.cpp", + "PrivHelperTestServer.cpp", + ], + deps = [ + "@/eden/fuse/privhelper:privhelper", + "@/folly/experimental:test_util", + ], +) diff --git a/eden/utils/TARGETS b/eden/utils/TARGETS new file mode 100644 index 0000000000..3a2ffc3b29 --- /dev/null +++ b/eden/utils/TARGETS @@ -0,0 +1,19 @@ +cpp_library( + name = "utils", + srcs = glob(['*.cpp'], excludes=['**/*Test.cpp']), + headers = glob(['*.h']), + deps = [ + "@/folly:evicting_cache_map", + "@/folly:folly", + "@/folly/futures:futures", + "@/folly:subprocess", + ], +) + +cpp_unittest( + name = "test_utils", + srcs = glob(['**/*Test.cpp']), + deps = [ + ':utils' + ], +)