-
-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed a few names, and put each task in its own file, for uniformity. Also replaced the first=True argument to run_prep_command's install with a comment explaining that it must be first in its register.py, and another comment in extension_loader explaining that core_tasks must be registered first. The reason is that first=True was no less fragile - if anything else registered into the 'test' goal with first=True later on, it would preempt run_prep_command, with no comment. At least this way the comments are clear, and we can maybe (??) move towards deprecating first=True, or at least relying on it less. Testing Done: CI passes: https://travis-ci.org/pantsbuild/pants/builds/94466648 Reviewed at https://rbcommons.com/s/twitter/r/3199/
- Loading branch information
Showing
16 changed files
with
116 additions
and
143 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# coding=utf-8 | ||
# Copyright 2014 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) | ||
|
||
from pants.task.task import Task | ||
from pants.util.dirutil import safe_rmtree | ||
|
||
|
||
class Clean(Task): | ||
"""Delete all build products, creating a clean workspace.""" | ||
|
||
def execute(self): | ||
safe_rmtree(self.get_options().pants_workdir) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# coding=utf-8 | ||
# Copyright 2014 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.reporting.reporting_server import ReportingServerManager | ||
from pants.task.task import QuietTaskMixin, Task | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class ReportingServerKill(QuietTaskMixin, Task): | ||
"""Kill the reporting server.""" | ||
|
||
def execute(self): | ||
server = ReportingServerManager(self.context, self.get_options()) | ||
|
||
if not server.is_alive(): | ||
logger.info('No server found.') | ||
return | ||
|
||
pid = server.pid | ||
|
||
try: | ||
logger.info('Killing server with {pid} at http://localhost:{port}' | ||
.format(pid=pid, port=server.socket)) | ||
server.terminate() | ||
except ReportingServerManager.NonResponsiveProcess: | ||
logger.info('Failed to kill server with pid {pid}!'.format(pid=pid)) |
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
File renamed without changes.
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.