Skip to content

Commit

Permalink
Move task.py out of backend/core.
Browse files Browse the repository at this point in the history
It's a core pants concept and not part of what we
usually mean by "backend".  This is a step one of
sorting out the mess in backend/core.

Points all pants code to the new location of task.py,
which is a new top-level 'task' package. A future change
will move ConsoleTask and other task-related stuff to there.

There are forwarding aliases in the original task.py, with a
deprecation warning, so external plugins shouldn't break.

Testing Done:
CI passes: https://travis-ci.org/pantsbuild/pants/builds/91325801

Reviewed at https://rbcommons.com/s/twitter/r/3130/
  • Loading branch information
benjyw authored and Benjy committed Nov 21, 2015
1 parent 3484a8f commit aa791b0
Show file tree
Hide file tree
Showing 61 changed files with 695 additions and 666 deletions.
2 changes: 1 addition & 1 deletion contrib/cpp/src/python/pants/contrib/cpp/tasks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ python_library(
dependencies=[
'contrib/cpp/src/python/pants/contrib/cpp/toolchain:toolchain',
'contrib/cpp/src/python/pants/contrib/cpp/targets:targets',
'src/python/pants/backend/core/tasks:common',
'src/python/pants/base:exceptions',
'src/python/pants/base:workunit',
'src/python/pants/task',
'src/python/pants/util:dirutil',
],
)
2 changes: 1 addition & 1 deletion contrib/cpp/src/python/pants/contrib/cpp/tasks/cpp_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import subprocess

from pants.backend.core.tasks.task import Task
from pants.base.exceptions import TaskError
from pants.task.task import Task

from pants.contrib.cpp.targets.cpp_binary import CppBinary
from pants.contrib.cpp.targets.cpp_library import CppLibrary
Expand Down
4 changes: 2 additions & 2 deletions contrib/go/src/python/pants/contrib/go/tasks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ python_library(
'3rdparty/python/twitter/commons:twitter.common.collections',
'3rdparty/python:ansicolors',
'contrib/go/src/python/pants/contrib/go/tasks:go_workspace_task',
'src/python/pants/backend/core/tasks:task',
'src/python/pants/base:exceptions',
'src/python/pants/task',
]
)

Expand All @@ -100,7 +100,7 @@ python_library(
'contrib/go/src/python/pants/contrib/go/targets:go_library',
'contrib/go/src/python/pants/contrib/go/targets:go_local_source',
'contrib/go/src/python/pants/contrib/go/targets:go_remote_library',
'src/python/pants/backend/core/tasks:task',
'src/python/pants/task',
'src/python/pants/util:memo',
]
)
Expand Down
2 changes: 1 addition & 1 deletion contrib/go/src/python/pants/contrib/go/tasks/go_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from abc import abstractmethod

from colors import green, red, yellow
from pants.backend.core.tasks.task import QuietTaskMixin
from pants.base.exceptions import TaskError
from pants.task.task import QuietTaskMixin
from twitter.common.collections import OrderedSet

from pants.contrib.go.tasks.go_workspace_task import GoWorkspaceTask
Expand Down
2 changes: 1 addition & 1 deletion contrib/go/src/python/pants/contrib/go/tasks/go_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)

from pants.backend.core.tasks.task import Task
from pants.task.task import Task
from pants.util.memo import memoized_property

from pants.contrib.go.subsystems.go_distribution import GoDistribution
Expand Down
2 changes: 1 addition & 1 deletion contrib/node/src/python/pants/contrib/node/tasks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ python_library(
'contrib/node/src/python/pants/contrib/node/targets:node_remote_module',
'contrib/node/src/python/pants/contrib/node/targets:npm_package',
'contrib/node/src/python/pants/contrib/node/targets:npm_test',
'src/python/pants/backend/core/tasks:task',
'src/python/pants/base:workunit',
'src/python/pants/task',
'src/python/pants/util:memo',
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)

from pants.backend.core.tasks.task import Task
from pants.base.workunit import WorkUnit, WorkUnitLabel
from pants.task.task import Task
from pants.util.memo import memoized_property

from pants.contrib.node.subsystems.node_distribution import NodeDistribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python_library(
dependencies=[
'3rdparty/python:six',
'pants-plugins/3rdparty/python:beautifulsoup4',
'src/python/pants/backend/core/tasks:task',
'src/python/pants/base:exceptions',
'src/python/pants/task',
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import pystache
from six.moves import range

from pants.backend.core.tasks.task import Task
from pants.base.exceptions import TaskError
from pants.task.task import Task


"""Static Site Generator for the Pants Build documentation site.
Expand Down
6 changes: 3 additions & 3 deletions src/python/pants/backend/android/tasks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ python_library(
name = 'android_task',
sources = ['android_task.py'],
dependencies = [
'src/python/pants/backend/core/tasks:common',
'src/python/pants/backend/android:android_distribution',
'src/python/pants/task',
],
)

Expand Down Expand Up @@ -82,10 +82,10 @@ python_library(
'src/python/pants/backend/android:android_config_util',
'src/python/pants/backend/android:keystore_resolver',
'src/python/pants/backend/android/targets:android',
'src/python/pants/backend/core/tasks:common',
'src/python/pants/base:exceptions',
'src/python/pants/base:workunit',
'src/python/pants/java/distribution:distribution',
'src/python/pants/task',
'src/python/pants/util:dirutil',
],
)
Expand All @@ -95,14 +95,14 @@ python_library(
sources = ['unpack_libraries.py'],
dependencies = [
'src/python/pants/backend/android/targets:android',
'src/python/pants/backend/core/tasks:task',
'src/python/pants/backend/jvm/targets:jvm',
'src/python/pants/backend/jvm/tasks:jar_import_products',
'src/python/pants/backend/jvm:jar_dependency_utils',
'src/python/pants/base:build_environment',
'src/python/pants/base:fingerprint_strategy',
'src/python/pants/build_graph',
'src/python/pants/fs',
'src/python/pants/task',
],
)

Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/android/tasks/android_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
unicode_literals, with_statement)

from pants.backend.android.distribution.android_distribution import AndroidDistribution
from pants.backend.core.tasks.task import Task
from pants.task.task import Task


class AndroidTask(Task):
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/android/tasks/sign_apk.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from pants.backend.android.android_config_util import AndroidConfigUtil
from pants.backend.android.keystore.keystore_resolver import KeystoreResolver
from pants.backend.android.targets.android_binary import AndroidBinary
from pants.backend.core.tasks.task import Task
from pants.base.exceptions import TaskError
from pants.base.workunit import WorkUnitLabel
from pants.java.distribution.distribution import DistributionLocator
from pants.task.task import Task
from pants.util.dirutil import safe_mkdir


Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/android/tasks/unpack_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from pants.backend.android.targets.android_library import AndroidLibrary
from pants.backend.android.targets.android_resources import AndroidResources
from pants.backend.core.tasks.task import Task
from pants.backend.jvm.jar_dependency_utils import M2Coordinate
from pants.backend.jvm.targets.jar_dependency import JarDependency
from pants.backend.jvm.targets.jar_library import JarLibrary
Expand All @@ -19,6 +18,7 @@
from pants.base.fingerprint_strategy import DefaultFingerprintStrategy
from pants.build_graph.address import Address
from pants.fs.archive import ZIP
from pants.task.task import Task


class AndroidLibraryFingerprintStrategy(DefaultFingerprintStrategy):
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/codegen/tasks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ python_library(
name = 'common',
sources = ['__init__.py'],
dependencies = [
'src/python/pants/backend/core/tasks:task',
'src/python/pants/base:exceptions',
'src/python/pants/task',
]
)

Expand Down Expand Up @@ -115,11 +115,11 @@ python_library(
sources = ['simple_codegen_task.py'],
dependencies = [
'3rdparty/python/twitter/commons:twitter.common.collections',
'src/python/pants/backend/core/tasks:task',
'src/python/pants/base:build_environment',
'src/python/pants/base:exceptions',
'src/python/pants/base:workunit',
'src/python/pants/build_graph',
'src/python/pants/task',
'src/python/pants/util:dirutil',
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

from twitter.common.collections import OrderedSet

from pants.backend.core.tasks.task import Task
from pants.base.build_environment import get_buildroot
from pants.base.exceptions import TaskError
from pants.base.workunit import WorkUnitLabel
from pants.build_graph.address import Address
from pants.build_graph.address_lookup_error import AddressLookupError
from pants.task.task import Task
from pants.util.dirutil import fast_relpath, safe_delete, safe_walk


Expand Down
Loading

0 comments on commit aa791b0

Please sign in to comment.