forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dmcclanahan/python-dist-c++-sources
- Loading branch information
Showing
33 changed files
with
489 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
contrib/buildrefactor/src/python/pants/contrib/buildrefactor/buildozer_binary.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# coding=utf-8 | ||
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, | ||
unicode_literals, with_statement) | ||
|
||
import logging | ||
|
||
from pants.base.build_environment import get_buildroot | ||
from pants.base.exceptions import TaskError | ||
from pants.binaries.binary_tool import NativeTool | ||
from pants.util.process_handler import subprocess | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class BuildozerBinary(NativeTool): | ||
options_scope = 'buildozer-binary' | ||
name = 'buildozer' | ||
default_version = '0.6.0.dce8b3c287652cbcaf43c8dd076b3f48c92ab44c' | ||
|
||
replaces_scope = 'buildozer' | ||
replaces_name = 'version' | ||
|
||
# TODO: Move this to bin/buildozer - buildozer is a native binary. | ||
@classmethod | ||
def get_support_dir(cls): | ||
return 'scripts/buildozer' | ||
|
||
def execute(self, buildozer_command, spec, context=None): | ||
try: | ||
subprocess.check_call([self.select(context), buildozer_command, spec], cwd=get_buildroot()) | ||
except subprocess.CalledProcessError as err: | ||
if err.returncode == 3: | ||
logger.warn('{} ... no changes were made'.format(buildozer_command)) | ||
else: | ||
raise TaskError('{} ... exited non-zero ({}).'.format(buildozer_command, err.returncode)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.