Skip to content

Commit

Permalink
Make TARGETS file portable
Browse files Browse the repository at this point in the history
Summary:
Instead of hard coding the path of the internal repo.
Make TARGETS file work anywhere in fbcode
Closes facebook#2586

Differential Revision: D5428122

Pulled By: IslamAbdelRahman

fbshipit-source-id: 21adec82bfbff14ea93532bee789b5f5bbee5b01
  • Loading branch information
IslamAbdelRahman authored and facebook-github-bot committed Jul 14, 2017
1 parent ccf5f08 commit 1320133
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion TARGETS
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
6 changes: 5 additions & 1 deletion buckifier/targets_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
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 = [
Expand Down

0 comments on commit 1320133

Please sign in to comment.