]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Make TARGETS file portable
authorIslam AbdelRahman <tec@fb.com>
Fri, 14 Jul 2017 22:36:20 +0000 (15:36 -0700)
committerYi Wu <yiwu@fb.com>
Fri, 21 Jul 2017 00:28:53 +0000 (17:28 -0700)
Summary:
Instead of hard coding the path of the internal repo.
Make TARGETS file work anywhere in fbcode
Closes https://github.com/facebook/rocksdb/pull/2586

Differential Revision: D5428122

Pulled By: IslamAbdelRahman

fbshipit-source-id: 21adec82bfbff14ea93532bee789b5f5bbee5b01

TARGETS
buckifier/targets_cfg.py

diff --git a/TARGETS b/TARGETS
index efdb434dda38b54eeccc96a89f242bc4e1ba6462..8390c7e991b4a2612bac351414c2a4d92e1656bb 100644 (file)
--- a/TARGETS
+++ b/TARGETS
@@ -1,4 +1,8 @@
-REPO_PATH = "internal_repo_rocksdb/repo/"
+
+import os
+
+TARGETS_PATH = os.path.dirname(__file__)
+REPO_PATH = TARGETS_PATH[(TARGETS_PATH.find('fbcode/') + len('fbcode/')):] + "/"
 BUCK_BINS = "buck-out/gen/" + REPO_PATH
 TEST_RUNNER = REPO_PATH + "buckifier/rocks_test_runner.sh"
 rocksdb_compiler_flags = [
index de504e4d925e8fa2c2761326585f20b267dd39a5..079b892a75dfe163a67d9e628aa08a066fc3ffd6 100644 (file)
@@ -2,7 +2,11 @@ from __future__ import absolute_import
 from __future__ import division
 from __future__ import print_function
 from __future__ import unicode_literals
-rocksdb_target_header = """REPO_PATH = "internal_repo_rocksdb/repo/"
+rocksdb_target_header = """
+import os
+
+TARGETS_PATH = os.path.dirname(__file__)
+REPO_PATH = TARGETS_PATH[(TARGETS_PATH.find('fbcode/') + len('fbcode/')):] + "/"
 BUCK_BINS = "buck-out/gen/" + REPO_PATH
 TEST_RUNNER = REPO_PATH + "buckifier/rocks_test_runner.sh"
 rocksdb_compiler_flags = [