Skip to content

Commit 0fc0e78

Browse files
authored
Merge pull request swiftlang#317 from apple/update-build-dir-location
Update the build dir to be at top level for projects
2 parents 2af9503 + 79d46a2 commit 0fc0e78

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

project_future.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,15 @@ def target_param(self):
9999
def get_build_command(self, incremental=False):
100100
project_param = self.project_param
101101
target_param = self.target_param
102-
build_dir = os.path.join(os.path.dirname(self._project),
103-
'build')
102+
try:
103+
build_parent_dir = common.check_execute_output([
104+
'git', '-C', os.path.dirname(self._project),
105+
'rev-parse', '--show-toplevel']).rstrip()
106+
except common.ExecuteCommandFailure as error:
107+
build_parent_dir = os.path.dirname(self._project)
108+
109+
build_dir = os.path.join(build_parent_dir, 'build')
110+
104111
build = ['clean', 'build']
105112
if incremental:
106113
build = ['build']

0 commit comments

Comments
 (0)