Pants BUILD Dictionary
A BUILD
file defines one or more build targets.
A target represents a set of source files, dependencies or other 'nouns' that
build commands can act on. The type of a target determines what actions
apply to it. For example, a jvm_binary
target can be compiled and run.
Target Types
-
android_binary
: An Android binary.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) build_tools_version = ..., API for the Build Tools (separate from SDK version). Defaults to the latest full release. (default: 19.1.0) manifest = ..., path/to/file of 'AndroidManifest.xml' (required name). Paths are relative to the BUILD file's directory. (default: None) *args = ..., None
-
-
android_dependency
: Artifacts that Android targets depend on.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) jars = ..., List of `jar <#jar>`_\s to depend upon. (default: None) managed_dependencies = ..., Address of a managed_jar_dependencies() target to use. If omitted, uses the default managed_jar_dependencies() target set by --jar-dependency-management-default-target. (default: None)
-
-
android_library
: Android library projects that access Android API or Android resources.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) build_tools_version = ..., API for the Build Tools (separate from SDK version). Defaults to the latest full release. (default: 19.1.0) manifest = ..., path/to/file of 'AndroidManifest.xml' (required name). Paths are relative to the BUILD file's directory. (default: None) libraries = ..., List of addresses of `android_dependency <#android_dependency>`_ targets. (default: None) include_patterns = ..., fileset patterns to include from the archive (default: None) exclude_patterns = ..., fileset patterns to exclude from the archive (default: None)
-
-
android_resources
: Android resources used to generate R.java.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) build_tools_version = ..., API for the Build Tools (separate from SDK version). Defaults to the latest full release. (default: 19.1.0) manifest = ..., path/to/file of 'AndroidManifest.xml' (required name). Paths are relative to the BUILD file's directory. (default: None) resource_dir = ..., path/to/directory containing Android resource files, often named 'res'. (default: None)
-
-
annotation_processor
: A Java library containing annotation processors.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) *args = ..., None provides = ..., An optional Dependency object indicating the The ivy artifact to export. (default: None) processors = ..., A list of the fully qualified class names of the annotation processors this library exports. (default: None) *args = ..., None resources = ..., An optional list of file paths (DEPRECATED) or ``resources`` targets (which in turn point to file paths). The paths indicate text file resources to place in this module's jar. (default: None)
-
-
benchmark
: A caliper benchmark.-
Run it with the ``bench`` goal.
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None)
-
-
contrib_plugin
: A contributed pants plugin published by pantsbuild.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) resources = ..., non-Python resources, e.g. templates, keys, other data (it is recommended that your application uses the pkgutil package to access these resources in a .zip-module friendly way.) (default: None) resource_targets = ..., (default: None) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) compatibility = ..., either a string or list of strings that represents interpreter compatibility for this target, using the Requirement-style format, e.g. ``'CPython>=3', or just ['>=2.7','<3']`` for requirements agnostic to interpreter class. (default: None) dependencies = ..., Other targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``python_antlr_library`` and so forth) or ``python_requirement_library`` targets. (default: None) distribution_name = ..., The name of the plugin package; must start with 'pantsbuild.pants.'. (default: None) description = ..., A brief description of what the plugin provides. (default: None) additional_classifiers = ..., Any additional trove classifiers that apply to the plugin, see: https://pypi.python.org/pypi?%3Aaction=list_classifiers (default: None) build_file_aliases = ..., If `True`, register.py:build_file_aliases must be defined and registers the 'build_file_aliases' 'pantsbuild.plugin' entrypoint. (default: False) global_subsystems = ..., If `True`, register.py:global_subsystems must be defined and registers the 'global_subsystems' 'pantsbuild.plugin' entrypoint. (default: False) register_goals = ..., If `True`, register.py:register_goals must be defined and registers the 'register_goals' 'pantsbuild.plugin' entrypoint. (default: False)
-
-
cpp_binary
: A C++ binary.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) libraries = ..., Libraries that this target depends on that are not pants targets. For example, 'm' or 'rt' that are expected to be installed on the local system. (default: None) *args = ..., None
-
-
cpp_library
: A statically linked C++ library.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) *args = ..., None
-
-
credentials
: <Add description>-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) username = ..., A constant username value. (default: None) password = ..., A constant password value. (default: None) name = ..., The name of these credentials. (default: None)
-
-
go_binary
: A local Go main package.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False)
-
-
go_library
: A local Go package.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False)
-
-
go_remote_libraries
: A remote Go package.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) pkg = ..., The package import path within the remote library; by default the root package path (equivalent to passing `pkg='.'` or `pkg=''`). (default: ) rev = ..., Identifies which version of the remote library to download. This could be a commit SHA (git), node id (hg), etc. If left unspecified the version will default to the latest available. It's highly recommended to not accept the default and instead pin the rev explicitly for repeatable builds. (default: )
-
-
go_remote_library
: A remote Go package.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) pkg = ..., The package import path within the remote library; by default the root package path (equivalent to passing `pkg='.'` or `pkg=''`). (default: ) rev = ..., Identifies which version of the remote library to download. This could be a commit SHA (git), node id (hg), etc. If left unspecified the version will default to the latest available. It's highly recommended to not accept the default and instead pin the rev explicitly for repeatable builds. (default: )
-
-
go_thrift_library
: A Go library generated from Thrift IDL files.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) import_path = ..., Go code will import this (default: None) sources = ..., thrift source files (default: None)
-
-
jar_library
: A set of external JAR files.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) jars = ..., List of `jar <#jar>`_\s to depend upon. (default: None) managed_dependencies = ..., Address of a managed_jar_dependencies() target to use. If omitted, uses the default managed_jar_dependencies() target set by --jar-dependency-management-default-target. (default: None)
-
-
java_agent
: A Java agent entrypoint.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) *args = ..., None provides = ..., An optional Dependency object indicating the The ivy artifact to export. (default: None) *args = ..., None provides = ..., The ``artifact`` to publish that represents this target outside the repo. (default: None) resources = ..., An optional list of file paths (DEPRECATED) or ``resources`` targets (which in turn point to file paths). The paths indicate text file resources to place in this module's jar. (default: None) name = ..., sources = ..., (default: None) excludes = ..., (default: None) resources = ..., (default: None) premain = ..., When an agent is specified at JVM launch time this attribute specifies the agent class. Exactly one of ``premain`` or ``agent_class`` must be specified. (default: None) agent_class = ..., If an implementation supports a mechanism to start agents sometime after the VM has started then this attribute specifies the agent class. Exactly one of ``premain`` or ``agent_class`` must be specified. (default: None) can_redefine = ..., `True` if the ability to redefine classes is needed by this agent; `False` by default. (default: False) can_retransform = ..., `True` if the ability to retransform classes is needed by this agent; `False` by default. (default: False) can_set_native_method_prefix = ..., `True` if the ability to set he native method prefix is needed by this agent; `False` by default. (default: False)
-
-
java_antlr_library
: A Java library generated from Antlr grammar files.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) name = ..., (default: None) sources = ..., (default: None) provides = ..., The ``artifact`` to publish that represents this target outside the repo. (default: None) excludes = ..., (default: None) compiler = ..., The name of the compiler used to compile the ANTLR files. Currently only supports 'antlr3' and 'antlr4' (default: antlr3) package = ..., (antlr4 only) A string which specifies the package to be used on the dependent sources. If unset, the package will be based on the path to the sources. Note that if the sources are spread among different files, this must be set as the package cannot be inferred. (default: None)
-
-
java_library
: A Java library.-
Normally has conceptually-related sources; invoking the ``compile`` goal
on this target compiles Java and generates classes. Invoking the ``jar``
goal on this target creates a ``.jar``; but that's an unusual thing to do.
Instead, a ``jvm_binary`` might depend on this library; that binary is a
more sensible thing to bundle.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) *args = ..., None provides = ..., An optional Dependency object indicating the The ivy artifact to export. (default: None) *args = ..., None provides = ..., The ``artifact`` to publish that represents this target outside the repo. (default: None) resources = ..., An optional list of file paths (DEPRECATED) or ``resources`` targets (which in turn point to file paths). The paths indicate text file resources to place in this module's jar. (default: None)
-
-
java_protobuf_library
: A Java library generated from Protocol Buffer IDL files.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) buildflags = ..., Unused, and will be removed in a future release. (default: None) imports = ..., List of addresses of `jar_library <#jar_library>`_ targets which contain .proto definitions. (default: None)
-
-
java_ragel_library
: A Java library generated from a Ragel file.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None)
-
-
java_tests
: JUnit tests.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) cwd = ..., working directory (relative to the build root) for the tests under this target. If unspecified (None), the working directory will be controlled by junit_run's --cwd. (default: None) test_platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for running tests (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the same one used for compilation. (default: None) timeout = ..., A timeout (in seconds) which covers the total runtime of all tests in this target. Only applied if `--test-junit-timeouts` is set to True. (default: None) extra_jvm_options = ..., A list of key value pairs of jvm options to use when running the tests. Example: ['-Dexample.property=1'] If unspecified, no extra jvm options will be added. (default: None) extra_env_vars = ..., A map of environment variables to set when running the tests, e.g. { 'FOOBAR': 12 }. Using `None` as the value will cause the variable to be unset. (default: None) concurrency = ..., One of 'SERIAL', 'PARALLEL_CLASSES', 'PARALLEL_METHODS', or 'PARALLEL_BOTH'. Overrides the setting of --test-junit-default-parallel or --test-junit-parallel-methods options. (default: None) threads = ..., Use the specified number of threads when running the test. Overrides the setting of --test-junit-parallel-threads. (default: None)
-
-
java_thrift_library
: A Java library generated from Thrift IDL files.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) compiler = ..., The compiler used to compile the thrift files. The default is defined in the global options under ``--thrift-default-compiler``. (default: None) language = ..., The language used to generate the output files. The default is defined in the global options under ``--thrift-default-language``. (default: None) rpc_style = ..., An optional rpc style to generate service stubs with. The default is defined in the global options under ``--thrift-default-rpc-style``. (default: None) namespace_map = ..., An optional dictionary of namespaces to remap {old: new} (default: None) thrift_linter_strict = ..., If True, fail if thrift linter produces any warnings. (default: None)
-
-
java_wire_library
: A Java library generated from Wire IDL files.-
Supports Wire 1.x only.
For an example Wire 2.x interface that generates service stubs see:
https://github.com/ericzundel/mvn2pants/tree/master/src/python/squarepants/plugins/sake_wire_codegen
But note this requires you to write a custom wire code generator with a command line interface.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) *args = ..., None provides = ..., An optional Dependency object indicating the The ivy artifact to export. (default: None) service_writer = ..., the name of the class to pass as the --service_writer option to the Wire compiler (For wire 1.0 only) (default: None) service_writer_options = ..., A list of options to pass to the service writer (For wire 1.x only) (default: None) roots = ..., passed through to the --roots option of the Wire compiler (default: None) registry_class = ..., fully qualified class name of RegistryClass to create. If in doubt, specify com.squareup.wire.SimpleServiceWriter (default: None) enum_options = ..., list of enums to pass to as the --enum-enum_options option, # optional (default: None) no_options = ..., boolean that determines if --no_options flag is passed (default: None)
-
-
javac_plugin
: A Java compiler plugin.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) *args = ..., None provides = ..., An optional Dependency object indicating the The ivy artifact to export. (default: None) *args = ..., None provides = ..., The ``artifact`` to publish that represents this target outside the repo. (default: None) resources = ..., An optional list of file paths (DEPRECATED) or ``resources`` targets (which in turn point to file paths). The paths indicate text file resources to place in this module's jar. (default: None) classname = ..., The fully qualified plugin class name - required. (default: None) plugin = ..., The name of the plugin. Defaults to name if not supplied. These are the names passed to javac's -Xplugin flag. (default: None) *args = ..., None
-
-
jaxb_library
: A Java library generated from JAXB xsd files.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) package = ..., java package (com.company.package) in which to generate the output java files. If unspecified, Pants guesses it from the file path leading to the schema (xsd) file. This guess is accurate only if the .xsd file is in a path like ``.../com/company/package/schema.xsd``. Pants looks for packages that start with 'com', 'org', or 'net'. (default: None) language = ..., only 'java' is supported. Default: 'java' (default: java)
-
-
junit_tests
: JUnit tests.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) cwd = ..., working directory (relative to the build root) for the tests under this target. If unspecified (None), the working directory will be controlled by junit_run's --cwd. (default: None) test_platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for running tests (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the same one used for compilation. (default: None) timeout = ..., A timeout (in seconds) which covers the total runtime of all tests in this target. Only applied if `--test-junit-timeouts` is set to True. (default: None) extra_jvm_options = ..., A list of key value pairs of jvm options to use when running the tests. Example: ['-Dexample.property=1'] If unspecified, no extra jvm options will be added. (default: None) extra_env_vars = ..., A map of environment variables to set when running the tests, e.g. { 'FOOBAR': 12 }. Using `None` as the value will cause the variable to be unset. (default: None) concurrency = ..., One of 'SERIAL', 'PARALLEL_CLASSES', 'PARALLEL_METHODS', or 'PARALLEL_BOTH'. Overrides the setting of --test-junit-default-parallel or --test-junit-parallel-methods options. (default: None) threads = ..., Use the specified number of threads when running the test. Overrides the setting of --test-junit-parallel-threads. (default: None)
-
-
jvm_app
: A deployable JVM application.-
Invoking the ``bundle`` goal on one of these targets creates a
self-contained artifact suitable for deployment on some other machine.
The artifact contains the executable jar, its dependencies, and
extra files like config files, startup scripts, etc.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) name = ..., (default: None) binary = ..., Target spec of the ``jvm_binary`` that contains the app main. (default: None) bundles = ..., One or more ``bundle``\s describing "extra files" that should be included with this app (e.g.: config files, startup scripts). (default: None) basename = ..., Name of this application, if different from the ``name``. Optionally pants uses this in the ``bundle`` goal to name the distribution artifact. Note this is unsafe because of the possible conflict when multiple bundles are built. (default: None)
-
-
jvm_binary
: A JVM binary.-
Below are a summary of how key goals affect targets of this type:
* ``bundle`` - Creates a self-contained directory with the binary and all
its dependencies, optionally archived, suitable for deployment.
* ``binary`` - Create an executable jar of the binary. On the JVM
this means the jar has a manifest specifying the main class.
* ``run`` - Executes the main class of this binary locally.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) name = ..., (default: None) main = ..., The name of the ``main`` class, e.g., ``'org.pantsbuild.example.hello.main.HelloMain'``. This class may be present as the source of this target or depended-upon library. (default: None) basename = ..., Base name for the generated ``.jar`` file, e.g., ``'hello'``. (By default, uses ``name`` param) Note this is unsafe because of the possible conflict when multiple binaries are built. (default: None) source = ..., Name of one ``.java`` or ``.scala`` file (a good place for a ``main``). (default: None) deploy_excludes = ..., List of `exclude <#exclude>`_\s to apply at deploy time. If you, for example, deploy a java servlet that has one version of ``servlet.jar`` onto a Tomcat environment that provides another version, they might conflict. ``deploy_excludes`` gives you a way to build your code but exclude the conflicting ``jar`` when deploying. (default: None) deploy_jar_rules = ..., `Jar rules <#jar_rules>`_ for packaging this binary in a deploy jar. (default: None) manifest_entries = ..., dict that specifies entries for `ManifestEntries <#manifest_entries>`_ for adding to MANIFEST.MF when packaging this binary. (default: None) shading_rules = ..., Optional list of shading rules to apply when building a shaded (aka monolithic aka fat) binary jar. The order of the rules matters: the first rule which matches a fully-qualified class name is used to shade it. See shading_relocate(), shading_exclude(), shading_relocate_package(), and shading_exclude_package(). (default: None) dependencies = ..., Targets (probably ``java_library`` and ``scala_library`` targets) to "link" in. (default: None)
-
-
jvm_prep_command
: A command (defined in a Java target) that must be run before other tasks in a goal.-
For example, you can use `jvm_prep_command()` to execute a script that sets up tunnels to database
servers. These tunnels could then be leveraged by integration tests.
You can define a jvm_prep_command() target as follows:
jvm_prep_command(
name='foo',
goal='test',
mainclass='com.example.myproject.BeforeTestMain',
args=['--foo', 'bar'],
jvm_options=['-Xmx256M', '-Dmy.property=baz'],
dependencies=[
'myproject/src/main/java:lib',
],
)
Pants will execute the `jvm_prep_command()` when processing the specified goal. They will be
triggered when running targets that depend on the `prep_command()` target or when the
target is referenced from the command line.
See also prep_command for running shell commands.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) mainclass = ..., The path to the executable that should be run. (default: None) args = ..., A list of command-line args to the excutable. (default: None) jvm_options = ..., extra options to pass the JVM (default: None) goal = ..., Pants goal to run this command in [test, binary or compile]. If not specified, runs in 'test' (default: None)
-
-
managed_jar_dependencies
: A set of pinned external artifact versions to apply transitively.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) artifacts = ..., List of `jar <#jar>`_\s or specs to jar_library targets with pinned versions. Versions are pinned per (org, name, classifier, ext) artifact coordinate (excludes, etc are ignored for the purposes of pinning). (default: None)
-
-
netrc_credentials
: A Credentials subclass that uses a Netrc file to compute credentials.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False)
-
-
node_module
: A Node module.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) package_name = ..., The remote module package name, if not supplied the target name is used. (default: None) sources = ..., Javascript and other source code files that make up this module; paths are relative to the BUILD file's directory. (default: None)
-
-
node_preinstalled_module
: A NodeModule which resolves deps by downloading an archived node_modules directory.-
This is basically an example, to demonstrate how additional types of NodeModule targets with
their own resolvers (in this case NodePreinstalledModuleResolver), which still work with
NodeTest, can be registered. To be generallly correct, this target type and associated resolver
would have to use platform- and Node-version-specific node_modules archives, rather than just
a single dependencies_archive_url used verbatim. Consider NodePreinstalledModule and
NodePreinstalledModuleResolver subject to future change or removal for now.
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) package_name = ..., The remote module package name, if not supplied the target name is used. (default: None) sources = ..., Javascript and other source code files that make up this module; paths are relative to the BUILD file's directory. (default: None) dependencies_archive_url = ..., (default: None) sources = ..., (default: None) url = ..., The location of a tar.gz file containing containing a node_modules directory. (default: None)
-
-
node_remote_module
: A remote Node module.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) package_name = ..., The remote module package name, if not supplied the target name is used. (default: None) version = ..., The version constraint for the remote node module. Any of the forms accepted by npm including '' or '*' for unconstrained (the default) are acceptable. See: https://docs.npmjs.com/files/package.json#dependencies (default: None)
-
-
node_test
: Javascript tests run via a script specified in a package.json file.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) script_name = ..., The tests script name in package.json. Defaults to "test". (default: None) timeout = ..., The test target timeout. (default: None)
-
-
page
: A documentation page.-
Here is an example, that shows a markdown page providing a wiki page on an Atlassian Confluence
wiki: ::
page(name='mypage',
source='mypage.md',
provides=[
wiki_artifact(wiki=Wiki('foozle', <url builder>),
space='my_space',
title='my_page',
parent='my_parent'),
],
)
A ``page`` can have more than one ``wiki_artifact`` in its ``provides``
(there might be more than one place to publish it).
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) source = ..., Path to page source file. (default: None) format = ..., Page's format, ``md`` or ``rst``. By default, Pants infers from ``source`` file extension: ``.rst`` is ReStructured Text; anything else is Markdown. (default: None) links = ..., Other ``page`` targets that this `page` links to. (default: None) resources = ..., An optional list of Resources objects. (default: None) provides = ..., Optional "Addresses" at which this page is published. E.g., a wiki location. (default: None)
-
-
pants_plugin
: A pants plugin published by pantsbuild.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) resources = ..., non-Python resources, e.g. templates, keys, other data (it is recommended that your application uses the pkgutil package to access these resources in a .zip-module friendly way.) (default: None) resource_targets = ..., (default: None) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) compatibility = ..., either a string or list of strings that represents interpreter compatibility for this target, using the Requirement-style format, e.g. ``'CPython>=3', or just ['>=2.7','<3']`` for requirements agnostic to interpreter class. (default: None) dependencies = ..., Other targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``python_antlr_library`` and so forth) or ``python_requirement_library`` targets. (default: None) distribution_name = ..., The name of the plugin package; must start with 'pantsbuild.pants.'. (default: None) description = ..., A brief description of what the plugin provides. (default: None) additional_classifiers = ..., Any additional trove classifiers that apply to the plugin, see: https://pypi.python.org/pypi?%3Aaction=list_classifiers (default: None) build_file_aliases = ..., If `True`, register.py:build_file_aliases must be defined and registers the 'build_file_aliases' 'pantsbuild.plugin' entrypoint. (default: False) global_subsystems = ..., If `True`, register.py:global_subsystems must be defined and registers the 'global_subsystems' 'pantsbuild.plugin' entrypoint. (default: False) register_goals = ..., If `True`, register.py:register_goals must be defined and registers the 'register_goals' 'pantsbuild.plugin' entrypoint. (default: False)
-
-
prep_command
: A shell command to be run prior to running a goal.-
For example, you can use `prep_command()` to execute a script that sets up tunnels to database
servers. These tunnels could then be leveraged by integration tests.
Pants will only execute the `prep_command()` under the specified goal, when processing targets
that depend on the `prep_command()` target. If not otherwise specified, prep_commands
execute in the test goal.
See also jvm_prep_command for running tasks defined by a JVM language.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) prep_executable = ..., The path to the executable that should be run. (default: None) prep_args = ..., A list of command-line args to the excutable. (default: None) prep_environ = ..., If True, the output of the command will be treated as a \\0-separated list of key=value pairs to insert into the environment. Note that this will pollute the environment for all future tests, so avoid it if at all possible. (default: False) goal = ..., Pants goal to run this command in [test, binary or compile]. If not specified, runs in the 'test' goal. (default: None)
-
-
python_antlr_library
: A Python library generated from Antlr grammar files.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) resources = ..., non-Python resources, e.g. templates, keys, other data (it is recommended that your application uses the pkgutil package to access these resources in a .zip-module friendly way.) (default: None) resource_targets = ..., (default: None) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) compatibility = ..., either a string or list of strings that represents interpreter compatibility for this target, using the Requirement-style format, e.g. ``'CPython>=3', or just ['>=2.7','<3']`` for requirements agnostic to interpreter class. (default: None) dependencies = ..., Other targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``python_antlr_library`` and so forth) or ``python_requirement_library`` targets. (default: None) module = ..., everything beneath module is relative to this module name, None if root namespace (default: None) antlr_version = ..., (default: 3.1.3) *args = ..., None
-
-
python_binary
: A Python binary.-
Python binaries are pex files, self-contained executable shell
scripts that contain a complete Python environment capable of
running the target. For more information about pex files see
http://pantsbuild.github.io/python-readme.html#how-pex-files-work.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) resources = ..., non-Python resources, e.g. templates, keys, other data (it is recommended that your application uses the pkgutil package to access these resources in a .zip-module friendly way.) (default: None) resource_targets = ..., (default: None) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) compatibility = ..., either a string or list of strings that represents interpreter compatibility for this target, using the Requirement-style format, e.g. ``'CPython>=3', or just ['>=2.7','<3']`` for requirements agnostic to interpreter class. (default: None) dependencies = ..., Other targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``python_antlr_library`` and so forth) or ``python_requirement_library`` targets. (default: None) source = ..., relative path to one python source file that becomes this binary's __main__. If None specified, drops into an interpreter by default. (default: None) entry_point = ..., the default entry point for this binary. if None, drops into the entry point that is defined by source. Something like "pants.bin.pants_exe:main", where "pants.bin.pants_exe" is the package name and "main" is the function name (if ommitted, the module is executed directly, presuming it has a ``__main.py__``). (default: None) inherit_path = ..., inherit the sys.path of the environment that this binary runs in (default: False) zip_safe = ..., whether or not this binary is safe to run in compacted (zip-file) form (default: True) always_write_cache = ..., whether or not the .deps cache of this PEX file should always be written to disk. (default: False) repositories = ..., a list of repositories to query for dependencies. (default: None) indices = ..., a list of indices to use for packages. (default: None) ignore_errors = ..., should we ignore inability to resolve dependencies? (default: False) platforms = ..., extra platforms to target when building this binary. If this is, e.g., ``['current', 'linux-x86_64', 'macosx-10.4-x86_64']``, then when building the pex, then for any platform-dependent modules, Pants will include ``egg``\s for Linux (64-bit Intel), Mac OS X (version 10.4 or newer), and the current platform (whatever is being used when making the PEX). (default: ()) sources = ..., Overridden by source. To specify more than one source file, use a python_library and have the python_binary depend on that library. (default: None) compatibility = ..., either a string or list of strings that represents interpreter compatibility for this target, using the Requirement-style format, e.g. ``'CPython>=3', or just ['>=2.7','<3']`` for requirements agnostic to interpreter class. (default: None)
-
-
python_library
: A Python library.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) resources = ..., non-Python resources, e.g. templates, keys, other data (it is recommended that your application uses the pkgutil package to access these resources in a .zip-module friendly way.) (default: None) resource_targets = ..., (default: None) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) compatibility = ..., either a string or list of strings that represents interpreter compatibility for this target, using the Requirement-style format, e.g. ``'CPython>=3', or just ['>=2.7','<3']`` for requirements agnostic to interpreter class. (default: None) dependencies = ..., Other targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``python_antlr_library`` and so forth) or ``python_requirement_library`` targets. (default: None)
-
-
python_requirement_library
: A set of pip requirements.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) requirements = ..., pip requirements as `python_requirement <#python_requirement>`_\s. (default: None)
-
-
python_tests
: Python tests.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) resources = ..., non-Python resources, e.g. templates, keys, other data (it is recommended that your application uses the pkgutil package to access these resources in a .zip-module friendly way.) (default: None) resource_targets = ..., (default: None) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) compatibility = ..., either a string or list of strings that represents interpreter compatibility for this target, using the Requirement-style format, e.g. ``'CPython>=3', or just ['>=2.7','<3']`` for requirements agnostic to interpreter class. (default: None) dependencies = ..., Other targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``python_antlr_library`` and so forth) or ``python_requirement_library`` targets. (default: None) coverage = ..., the module(s) whose coverage should be generated, e.g. 'twitter.common.log' or ['twitter.common.log', 'twitter.common.http'] (default: None) timeout = ..., A timeout (in seconds) which covers the total runtime of all tests in this target. Only applied if `--test-pytest-timeouts` is set to True. (default: None)
-
-
python_thrift_library
: A Python library generated from Thrift IDL files.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None) resources = ..., non-Python resources, e.g. templates, keys, other data (it is recommended that your application uses the pkgutil package to access these resources in a .zip-module friendly way.) (default: None) resource_targets = ..., (default: None) provides = ..., The `setup_py <#setup_py>`_ to publish that represents this target outside the repo. (default: None) compatibility = ..., either a string or list of strings that represents interpreter compatibility for this target, using the Requirement-style format, e.g. ``'CPython>=3', or just ['>=2.7','<3']`` for requirements agnostic to interpreter class. (default: None) dependencies = ..., Other targets that this target depends on. These dependencies may be ``python_library``-like targets (``python_library``, ``python_thrift_library``, ``python_antlr_library`` and so forth) or ``python_requirement_library`` targets. (default: None) sources = ..., thrift source files (If more than one tries to use the same namespace, beware https://issues.apache.org/jira/browse/THRIFT-515) (default: None) resources = ..., non-Python resources, e.g. templates, keys, other data (it is recommended that your application uses the pkgutil package to access these resources in a .zip-module friendly way.) (default: None)
-
-
resources
: JVM resource files.-
Looking for loose files in your application bundle? Those are
`bundle <#bundle>`_\s.
Resources are Java-style resources accessible via the ``Class.getResource``
and friends API. In the ``jar`` goal, the resource files are placed in the resulting `.jar`.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Files to "include". Paths are relative to the BUILD file's directory. (default: None)
-
-
scala_js_binary
: A binary javascript blob built from a collection of ScalaJSLibrary targets.-
Extends NodeModule to allow consumption by NPM and node.
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) package_name = ..., The remote module package name, if not supplied the target name is used. (default: None) sources = ..., Javascript and other source code files that make up this module; paths are relative to the BUILD file's directory. (default: None)
-
-
scala_js_library
: A library with scala sources, intended to be compiled to Javascript.-
Linking multiple libraries together into a shippable blob additionally requires a
ScalaJSBinary target.
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Scala source that makes up this module; paths are relative to the BUILD file's directory. (default: None)
-
-
scala_library
: A Scala library.-
Normally has conceptually-related sources; invoking the ``compile`` goal
on this target compiles scala and generates classes. Invoking the ``bundle``
goal on this target creates a ``.jar``; but that's an unusual thing to do.
Instead, a ``jvm_binary`` might depend on this library; that binary is a
more sensible thing to bundle.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) *args = ..., None provides = ..., An optional Dependency object indicating the The ivy artifact to export. (default: None) java_sources = ..., Java libraries this library has a *circular* dependency on. If you don't have the particular problem of circular dependencies forced by splitting interdependent java and scala into multiple targets, don't use this at all. Prefer using ``dependencies`` to express non-circular dependencies. (default: None) resources = ..., An optional list of paths (DEPRECATED) or ``resources`` targets containing resources that belong on this library's classpath. (default: None)
-
-
scalac_plugin
: A Scala compiler plugin.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) *args = ..., None provides = ..., An optional Dependency object indicating the The ivy artifact to export. (default: None) java_sources = ..., Java libraries this library has a *circular* dependency on. If you don't have the particular problem of circular dependencies forced by splitting interdependent java and scala into multiple targets, don't use this at all. Prefer using ``dependencies`` to express non-circular dependencies. (default: None) resources = ..., An optional list of paths (DEPRECATED) or ``resources`` targets containing resources that belong on this library's classpath. (default: None) classname = ..., The fully qualified plugin class name - required. (default: None) plugin = ..., The name of the plugin. Defaults to name if not supplied. (default: None) *args = ..., None
-
-
spindle_thrift_library
: A Scala library generated from Spindle IDL files.-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) sources = ..., Source code files to build. Paths are relative to the BUILD file's directory. (default: None) provides = ..., (default: None) excludes = ..., List of `exclude <#exclude>`_\s to filter this target's transitive dependencies against. (default: None) resources = ..., (default: None) services = ..., A dict mapping service interface names to the classes owned by this target that implement them. Keys are fully qualified service class names, values are lists of strings, each string the fully qualified class name of a class owned by this target that implements the service interface and should be discoverable by the jvm service provider discovery mechanism described here: https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html (default: None) platform = ..., The name of the platform (defined under the jvm-platform subsystem) to use for compilation (that is, a key into the --jvm-platform-platforms dictionary). If unspecified, the platform will default to the first one of these that exist: (1) the default_platform specified for jvm-platform, (2) a platform constructed from whatever java version is returned by DistributionLocator.cached().version. (default: None) strict_deps = ..., When True, only the directly declared deps of the target will be used at compilation time. This enforces that all direct deps of the target are declared, and can improve compilation speed due to smaller classpaths. Transitive deps are always provided at runtime. (default: None) fatal_warnings = ..., Whether to turn warnings into errors for this target. If present, takes priority over the language's fatal-warnings option. (default: None) *args = ..., None provides = ..., An optional Dependency object indicating the The ivy artifact to export. (default: None) *args = ..., None
-
-
target
: A generic target used to group dependencies.-
The baseclass for all pants targets.
Handles registration of a target amongst all parsed targets as well as location of the target
parse context.
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False)
-
-
unpacked_jars
: A set of sources extracted from JAR files.-
:API: public
-
name = ..., dependencies = ..., (default: []) description = ..., (default: None) tags = ..., (default: None) no_cache = ..., (default: False) libraries = ..., addresses of jar_library targets that specify the jars you want to unpack (default: None) include_patterns = ..., fileset patterns to include from the archive (default: None) exclude_patterns = ..., fileset patterns to exclude from the archive. Exclude patterns are processed before include_patterns. (default: None)
-
Other BUILD Symbols
-
ConfluencePublish
: A task to publish Page targets to Confluence wikis.-
*args = ..., None
-
-
DirectoryReMapper
: A mapper that maps files relative to a base directory into a destination directory.-
base = ..., the relative path to get_buildroot() dest = ..., the dest path in the bundle
-
-
Duplicate
: A rule that indicates how duplicate entries should be handled when building a jar.-
apply_pattern = ..., A regular expression that matches duplicate jar entries this rule applies to. action = ..., An action to take to handle one or more duplicate entries. Must be one of: ``Duplicate.SKIP``, ``Duplicate.REPLACE``, ``Duplicate.CONCAT``, ``Duplicate.CONCAT_TEXT``, or ``Duplicate.FAIL``.
-
-
Skip
: A rule that skips adding matched entries to a jar.-
apply_pattern = ..., payload = ..., (default: None)
-
-
Wiki
: Identifies a wiki where pages can be published.-
name = ..., url_builder = ..., Function that accepts a page target and an optional wiki config dict.
-
-
artifact
: Represents a publishable jvm artifact ala maven or ivy.-
Used in the ``provides`` parameter to *jvm*\_library targets.
:API: public
-
org = ..., Organization of this artifact, or groupId in maven parlance. name = ..., Name of the artifact, or artifactId in maven parlance. repo = ..., The ``repo`` this artifact is published to. publication_metadata = ..., Optional extra publication metadata required by the ``repo``. (default: None)
-
-
buildfile_path
: <Add description> -
-
bundle
: A set of files to include in an application bundle.-
To learn about application bundles, see
`bundles <JVMProjects.html#jvm-bundles>`_.
Looking for Java-style resources accessible via the ``Class.getResource`` API?
Those are `resources <build_dictionary.html#resources>`_.
Files added to the bundle will be included when bundling an application target.
By default relative paths are preserved. For example, to include ``config``
and ``scripts`` directories: ::
bundles=[
bundle(fileset=[rglobs('config/*', 'scripts/*'), 'my.cfg']),
]
To include files relative to some path component use the ``relative_to`` parameter.
The following places the contents of ``common/config`` in a ``config`` directory
in the bundle. ::
bundles=[
bundle(relative_to='common', fileset=globs('common/config/*'))
]
-
rel_path = ..., Base path of the "source" file paths. By default, path of the BUILD file. Useful for assets that don't live in the source code repo. (default: None) mapper = ..., Function that takes a path string and returns a path string. Takes a path in the source tree, returns a path to use in the resulting bundle. By default, an identity mapper. (default: None) relative_to = ..., Set up a simple mapping from source path to bundle path. (default: None) fileset = ..., The set of files to include in the bundle. A string filename, or list of filenames, or a Fileset object (e.g. globs()). E.g., ``relative_to='common'`` removes that prefix from all files in the application bundle. (default: None)
-
-
contrib_setup_py
: Creates the setup_py for a pants contrib plugin artifact.-
:param str name: The name of the package; must start with 'pantsbuild.pants.contrib.'.
:param str description: A brief description of what the plugin provides.
:param list additional_classifiers: Any additional trove classifiers that apply to the plugin,
see: https://pypi.python.org/pypi?%3Aaction=list_classifiers
:param kwargs: Any additional keyword arguments to be passed to `setuptools.setup
<https://pythonhosted.org/setuptools/setuptools.html>`_.
:returns: A setup_py suitable for building and publishing pants components.
-
name = ..., The name of the package; must start with 'pantsbuild.pants.contrib.'. description = ..., A brief description of what the plugin provides. additional_classifiers = ..., Any additional trove classifiers that apply to the plugin, see: https://pypi.python.org/pypi?%3Aaction=list_classifiers (default: None) kwargs = ..., Any additional keyword arguments to be passed to `setuptools.setup <https://pythonhosted.org/setuptools/setuptools.html>`_. (default: None)
-
-
developer
: Corresponds to the maven POM <developer/> element.-
Refer to the schema here: http://maven.apache.org/maven-v4_0_0.xsd
-
user_id = ..., The user id of the developer; typically the one used to access the scm. (default: None) name = ..., The developer's full name. (default: None) email = ..., the developer's email address. (default: None) url = ..., An optional url pointing to more information about the developer. (default: None) organization = ..., An optional name for the organization the developer works on the library for. (default: None) organization_url = ..., An optional url pointing to more information about the developer's organization. (default: None) roles = ..., An optional list of role names that apply to this developer on this project. (default: None)
-
-
exclude
: Represents a dependency exclude pattern to filter transitive dependencies against.-
:API: public
-
org = ..., Organization of the artifact to filter, known as groupId in Maven parlance. name = ..., Name of the artifact to filter in the org, or filter everything if unspecified. (default: None)
-
-
from_target
: Used in a BUILD file to redirect the value of the sources= attribute to another target.-
address = ..., A target address.
-
-
get_buildroot
: Returns the pants build root, calculating it if needed.-
:API: public
-
-
-
github
: Creates an `Scm` for a github repo.-
:param string user: The github user or organization name the repo is hosted under.
:param string repo: The repository name.
:returns: An `Scm` representing the github repo.
-
user = ..., The github user or organization name the repo is hosted under. repo = ..., The repository name.
-
-
globs
: Matches files in the BUILD file's directory.-
E.g., - ``sources = globs('*java'),`` to get .java files in this directory.
- ``globs('*',exclude=[globs('*.java'), 'foo.py'])`` to get all files in this directory
except ``.java`` files and ``foo.py``.
-
*patterns = ..., None
-
-
intransitive
: Creates a dependency which is intransitive.-
This dependency will not be seen by dependees of this target. The syntax for this feature is
experimental and may change in the future.
-
address = ..., A target address.
-
-
jar
: A pre-built Maven repository dependency.-
:API: public
-
org = ..., The Maven ``groupId`` of this dependency. name = ..., The Maven ``artifactId`` of this dependency. rev = ..., The Maven ``version`` of this dependency. If unspecified the latest available version is used. (default: None) force = ..., Force this specific artifact revision even if other transitive dependencies specify a different revision. This requires specifying the ``rev`` parameter. (default: False) ext = ..., Extension of the artifact if different from the artifact type. This is sometimes needed for artifacts packaged with Maven bundle type but stored as jars. (default: None) url = ..., URL of this artifact, if different from the Maven repo standard location (specifying this parameter is unusual). (default: None) apidocs = ..., URL of existing javadocs, which if specified, pants-generated javadocs will properly hyperlink {\ @link}s. (default: None) classifier = ..., Classifier specifying the artifact variant to use. (default: None) mutable = ..., Inhibit caching of this mutable artifact. A common use is for Maven -SNAPSHOT style artifacts in an active development/integration cycle. (default: None) intransitive = ..., Declares this Dependency intransitive, indicating only the jar for the dependency itself should be downloaded and placed on the classpath (default: False) excludes = ..., Transitive dependencies of this jar to exclude. (default: None)
-
-
jar_rules
: A set of rules for packaging up a deploy jar.-
Deploy jars are executable jars with fully self-contained classpaths and as such, assembling them
presents problems given jar semantics.
One issue is signed jars that must be included on the
classpath. These have a signature that depends on the jar contents and assembly of the deploy jar
changes the content of the jar, breaking the signatures. For cases like these the signed jars
must be verified and then the signature information thrown away. The `Skip <#Skip>`_
rule supports this sort of issue by allowing outright entry exclusion in the final deploy jar.
Another issue is duplicate jar entries. Although the underlying zip format supports these, the
java jar tool and libraries do not. As such some action must be taken for each duplicate entry
such that there are no duplicates in the final deploy jar. The four
`Duplicate <#Duplicate>`_ rules support resolution of these cases by allowing 1st wins,
last wins, concatenation of the duplicate entry contents or raising an exception.
:API: public
-
rules = ..., One or more rules that will be applied in order to jar entries being packaged in a deploy jar. `Skip <#Skip>`_ rules can go here. (default: None) default_dup_action = ..., The default action to take when a duplicate entry is encountered and no explicit rules apply to the entry. (default: SKIP)
-
-
license
: Corresponds to the maven POM <license/> element.-
Refer to the schema here: http://maven.apache.org/maven-v4_0_0.xsd
-
name = ..., The full official name of the license. url = ..., An url pointing to the license text. comments = ..., Optional comments clarifying the license. (default: None)
-
-
managed_jar_libraries
: Creates a managed_jar_dependencies(), and also generates a jar_library for each artifact.-
Using this factory saves a lot of duplication. For example, this: ::
managed_jar_libraries(name='managed',
artifacts=[
jar('org.foobar', 'foobar', '1.2'),
jar('com.example', 'example', '8'),
],
)
Is equivalent to: ::
managed_jar_dependencies(name='managed',
artifacts=[
jar('org.foobar', 'foobar', '1.2'),
jar('com.example', 'example', '8'),
],
)
jar_library(name='org.foobar.foobar',
jars=[jar('org.foobar', 'foobar')],
managed_dependencies=':managed',
)
jar_library(name='com.example.example',
jars=[jar('com.example', 'example')],
managed_dependencies=':managed',
)
Which is also equivalent to: ::
managed_jar_dependencies(name='managed',
artifacts=[
':org.foobar.foobar',
':com.example.example',
],
)
jar_library(name='org.foobar.foobar',
jars=[jar('org.foobar', 'foobar')],
managed_dependencies=':managed',
)
jar_library(name='com.example.example',
jars=[jar('com.example', 'example')],
managed_dependencies=':managed',
)
-
name = ..., The name of the generated managed_jar_dependencies() target. artifacts = ..., List of `jar <#jar>`_\s or specs to jar_library targets with pinned versions. Versions are pinned per (org, name, classifier, ext) artifact coordinate (excludes, etc are ignored for the purposes of pinning). (default: None)
-
-
netrc
: Fetches username and password from ~/.netrc for logged in user. -
-
ossrh
: Corresponds to the Sonatype required fields for jars published to OSSRH.-
See: http://central.sonatype.org/pages/requirements.html#sufficient-metadata
-
description = ..., A description of the library. url = ..., An url pointing to more information about the library. licenses = ..., The licenses that apply to the library. developers = ..., The developers who work on the library. scm = ..., The primary scm system hosting the library source code. name = ..., The optional full name of the library. If not supplied an appropriate name will be synthesized. (default: None)
-
-
pants_library
: <Add description>-
description = ...,
-
-
pants_requirement
: Exports a `python_requirement_library` pointing at the active pants' corresponding sdist.-
This requirement is useful for custom plugin authors who want to build and test their plugin with
pants itself. Using the resulting target as a dependency of their plugin target ensures the
dependency stays true to the surrounding repo's version of pants.
NB: The requirement generated is for official pants releases on pypi; so may not be appropriate
for use in a repo that tracks `pantsbuild/pants` or otherwise uses custom pants sdists.
:API: public
-
name = ..., The name to use for the target, defaults to the parent dir name. (default: None)
-
-
pants_setup_py
: Creates the setup_py for a pants artifact.-
:param str name: The name of the package.
:param str description: A brief description of what the package provides.
:param list additional_classifiers: Any additional trove classifiers that apply to the package,
see: https://pypi.python.org/pypi?%3Aaction=list_classifiers
:param kwargs: Any additional keyword arguments to be passed to `setuptools.setup
<https://pythonhosted.org/setuptools/setuptools.html>`_.
:returns: A setup_py suitable for building and publishing pants components.
-
name = ..., The name of the package. description = ..., A brief description of what the package provides. additional_classifiers = ..., Any additional trove classifiers that apply to the package, see: https://pypi.python.org/pypi?%3Aaction=list_classifiers (default: None) kwargs = ..., Any additional keyword arguments to be passed to `setuptools.setup <https://pythonhosted.org/setuptools/setuptools.html>`_. (default: None)
-
-
pants_version
: Returns the pants semantic version number as a string: http://semver.org/ -
-
provided
: Creates an intransitive dependency with scope='compile test'.-
This mirrors the behavior of the "provided" scope found in other build systems, such as Gradle,
Maven, and IntelliJ.
The syntax for this feature is experimental and may change in the future.
-
address = ..., A target address.
-
-
public
: An artifact repository, such as a maven repo.-
:API: public
-
-
-
python_artifact
: Represents a Python setup.py-based project.-
kwargs = ..., Passed to `setuptools.setup <https://pythonhosted.org/setuptools/setuptools.html>`_. (default: None)
-
-
python_requirement
: Pants wrapper around pkg_resources.Requirement-
Describes an external dependency as understood by ``easy_install`` or
``pip``. It takes
a single non-keyword argument of the `Requirement`-style string, e.g. ::
python_requirement('django-celery')
python_requirement('tornado==2.2')
python_requirement('kombu>=2.1.1,<3.0')
Pants resolves the dependency *and its transitive closure*.
For example, `django-celery` pulls also pulls down its
dependencies: `celery>=2.5.1`, `django-picklefield>=0.2.0`, `ordereddict`,
`python-dateutil`,
`kombu>=2.1.1,<3.0`, `anyjson>=0.3.1`, `importlib`, and `amqplib>=1.0`.
To let other Targets depend on this ``python_requirement``, put it in a
`python_requirement_library <#python_requirement_library>`_.
:API: public
-
requirement = ..., name = ..., (default: None) repository = ..., (default: None) use_2to3 = ..., (default: False) compatibility = ..., (default: None)
-
-
python_requirements
: Translates a pip requirements file into an equivalent set of python_requirements-
If the ``requirements.txt`` file has lines ``foo>=3.14`` and ``bar>=2.7``,
then this is roughly like::
python_requirement_library(name="foo", requirements=[
python_requirement("foo>=3.14"),
])
python_requirement_library(name="bar", requirements=[
python_requirement("bar>=2.7"),
])
NB some requirements files can't be unambiguously translated; ie: multiple
find links. For these files a ValueError will be raised that points out the issue.
See the requirements file spec here:
https://pip.pypa.io/en/latest/reference/pip_install.html#requirements-file-format
-
requirements_relpath = ..., The relpath from this BUILD file to the requirements file. Defaults to a `requirements.txt` file sibling to the BUILD file. (default: requirements.txt)
-
-
repository
: An artifact repository, such as a maven repo.-
:API: public
-
name = ..., (default: None) url = ..., Optional URL of the repository. (default: None) push_db_basedir = ..., Push history file base directory. (default: None)
-
-
rglobs
: Matches files recursively under the BUILD file's directory.-
E.g., ``bundle(fileset=rglobs('config/*'))`` to bundle up all files in the config,
config/foo, config/foo/bar directories.
-
*patterns = ..., None
-
-
scala_artifact
: Extends Artifact to append the configured Scala version.-
:API: public
-
org = ..., Organization of this artifact, or groupId in maven parlance. name = ..., Name of the artifact, or artifactId in maven parlance. repo = ..., The ``repo`` this artifact is published to. publication_metadata = ..., Optional extra publication metadata required by the ``repo``. (default: None)
-
-
scala_jar
: A JarDependency with the configured 'scala-compile: platform-version' automatically appended.-
This allows for more natural consumption of cross-published scala libraries, which have their
scala version/platform appended to the artifact name.
-
org = ..., The Maven ``groupId`` of this dependency. name = ..., The Maven ``artifactId`` of this dependency. rev = ..., The Maven ``version`` of this dependency. If unspecified the latest available version is used. (default: None) force = ..., Force this specific artifact revision even if other transitive dependencies specify a different revision. This requires specifying the ``rev`` parameter. (default: False) ext = ..., Extension of the artifact if different from the artifact type. This is sometimes needed for artifacts packaged with Maven bundle type but stored as jars. (default: None) url = ..., URL of this artifact, if different from the Maven repo standard location (specifying this parameter is unusual). (default: None) apidocs = ..., URL of existing javadocs, which if specified, pants-generated javadocs will properly hyperlink {\ @link}s. (default: None) classifier = ..., Classifier specifying the artifact variant to use. (default: None) mutable = ..., Inhibit caching of this mutable artifact. A common use is for Maven -SNAPSHOT style artifacts in an active development/integration cycle. (default: None) intransitive = ..., Declares this Dependency intransitive, indicating only the jar for the dependency itself should be downloaded and placed on the classpath (default: False) excludes = ..., Transitive dependencies of this jar to exclude. (default: None)
-
-
scm
: Corresponds to the maven POM <scm/> element.-
Refer to the schema here: http://maven.apache.org/maven-v4_0_0.xsd
-
connection = ..., The scm connection string for read-only access to the scm. developer_connection = ..., The scm connection string for read-write access to the scm. url = ..., An url pointing to a browseable web interface for the scm. tag = ..., An optional tag corresponding to the published release. This will be populated by pants during publish runs. (default: None)
-
-
scoped
: Convenience factory which constructs an intermediary target with the appropriate attributes.-
This makes the syntax:
```
jar_library(name='gson',
jars=[...],
)
target(name='foo',
dependencies=[
scoped(':gson', scope='runtime'),
],
)
```
Equivalent to:
```
jar_library(name='gson',
jars=[...],
)
target(name='gson-runtime',
dependencies=[
':gson',
],
scope='runtime',
)
target(name='foo',
dependencies=[
':gson-runtime',
],
)
```
The syntax for this feature is experimental and may change in the future.
-
address = ..., A target address. scope = ..., The scope of this dependency. (default: None)
-
-
setup_py
: Represents a Python setup.py-based project.-
kwargs = ..., Passed to `setuptools.setup <https://pythonhosted.org/setuptools/setuptools.html>`_. (default: None)
-
-
shading_exclude
: Creates a rule which excludes the given pattern from shading.-
Examples: ::
# Don't shade the org.foobar.example.Main class
shading_exclude('org.foobar.example.Main')
# Don't shade anything under org.foobar.example
shading_exclude('org.foobar.example.**')
:param string pattern: Any fully-qualified classname which matches this pattern will NOT be
shaded. '*' is a wildcard that matches any individual package component, and '**' is a
wildcard that matches any trailing pattern (ie the rest of the string).
-
pattern = ..., Any fully-qualified classname which matches this pattern will NOT be shaded. '*' is a wildcard that matches any individual package component, and '**' is a wildcard that matches any trailing pattern (ie the rest of the string).
-
-
shading_exclude_package
: Convenience constructor for a package exclusion rule.-
Essentially equivalent to just using ``shading_exclude('package_name.**')``.
:param string package_name: Package name to exclude (eg, ``org.pantsbuild.example``).
:param bool recursive: Whether to exclude everything under any subpackage of ``package_name``,
or just direct children of the package. (Defaults to True).
-
package_name = ..., Package name to exclude (eg, ``org.pantsbuild.example``). recursive = ..., Whether to exclude everything under any subpackage of ``package_name``, or just direct children of the package. (Defaults to True). (default: True)
-
-
shading_keep
: Creates a rule which marks classes matching the given pattern as roots.-
If any keep rules are set, all classes that are not reachable from roots are removed from the
jar.
Examples: ::
# Only include classes reachable from Main.
shading_keep('org.foobar.example.Main')
# Only keep classes reachable from the example package.
shading_keep('org.foobar.example.*')
:param string pattern: Any fully-qualified classname which matches this pattern will be kept as
a root. '*' is a wildcard that matches any individual package component, and '**' is a
wildcard that matches any trailing pattern (ie the rest of the string).
-
pattern = ..., Any fully-qualified classname which matches this pattern will be kept as a root. '*' is a wildcard that matches any individual package component, and '**' is a wildcard that matches any trailing pattern (ie the rest of the string).
-
-
shading_keep_package
: Convenience constructor for a package keep rule.-
Essentially equivalent to just using ``shading_keep('package_name.**')``.
:param string package_name: Package name to keep (eg, ``org.pantsbuild.example``).
:param bool recursive: Whether to keep everything under any subpackage of ``package_name``,
or just direct children of the package. (Defaults to True).
-
package_name = ..., Package name to keep (eg, ``org.pantsbuild.example``). recursive = ..., Whether to keep everything under any subpackage of ``package_name``, or just direct children of the package. (Defaults to True). (default: True)
-
-
shading_relocate
: Creates a rule which shades jar entries from one pattern to another.-
Examples: ::
# Rename everything in the org.foobar.example package
# to __shaded_by_pants__.org.foobar.example.
shading_relocate('org.foobar.example.**')
# Rename org.foobar.example.Main to __shaded_by_pants__.org.foobar.example.Main
shading_relocate('org.foobar.example.Main')
# Rename org.foobar.example.Main to org.foobar.example.NotMain
shading_relocate('org.foobar.example.Main', 'org.foobar.example.NotMain')
# Rename all 'Main' classes under any direct subpackage of org.foobar.
shading_relocate('org.foobar.*.Main')
# Rename org.foobar package to com.barfoo package
shading_relocate('org.foobar.**', 'com.barfoo.@1')
# Rename everything in org.foobar.example package to __hello__.org.foobar.example
shading_relocate('org.foobar.example.**', shade_prefix='__hello__')
:param string from_pattern: Any fully-qualified classname which matches this pattern will be
shaded. '*' is a wildcard that matches any individual package component, and '**' is a
wildcard that matches any trailing pattern (ie the rest of the string).
:param string shade_pattern: The shaded pattern to use, where ``@1``, ``@2``, ``@3``, etc are
references to the groups matched by wildcards (groups are numbered from left to right). If
omitted, this pattern is inferred from the input pattern, prefixed by the ``shade_prefix``
(if provided). (Eg, a ``from_pattern`` of ``com.*.foo.bar.**`` implies a default
``shade_pattern`` of ``__shaded_by_pants__.com.@1.foo.@2``)
:param string shade_prefix: Prefix to prepend when generating a ``shade_pattern`` (if a
``shade_pattern`` is not provided by the user). Defaults to '``__shaded_by_pants__.``'.
-
from_pattern = ..., Any fully-qualified classname which matches this pattern will be shaded. '*' is a wildcard that matches any individual package component, and '**' is a wildcard that matches any trailing pattern (ie the rest of the string). shade_pattern = ..., The shaded pattern to use, where ``@1``, ``@2``, ``@3``, etc are references to the groups matched by wildcards (groups are numbered from left to right). If omitted, this pattern is inferred from the input pattern, prefixed by the ``shade_prefix`` (if provided). (Eg, a ``from_pattern`` of ``com.*.foo.bar.**`` implies a default ``shade_pattern`` of ``__shaded_by_pants__.com.@1.foo.@2``) (default: None) shade_prefix = ..., Prefix to prepend when generating a ``shade_pattern`` (if a ``shade_pattern`` is not provided by the user). Defaults to '``__shaded_by_pants__.``'. (default: None)
-
-
shading_relocate_package
: Convenience constructor for a package relocation rule.-
Essentially equivalent to just using ``shading_relocate('package_name.**')``.
:param string package_name: Package name to shade (eg, ``org.pantsbuild.example``).
:param string shade_prefix: Optional prefix to apply to the package. Defaults to
``__shaded_by_pants__.``.
:param bool recursive: Whether to rename everything under any subpackage of ``package_name``,
or just direct children of the package. (Defaults to True).
-
package_name = ..., Package name to shade (eg, ``org.pantsbuild.example``). shade_prefix = ..., Optional prefix to apply to the package. Defaults to ``__shaded_by_pants__.``. (default: None) recursive = ..., Whether to rename everything under any subpackage of ``package_name``, or just direct children of the package. (Defaults to True). (default: True)
-
-
shading_zap
: Creates a rule which removes matching classes from the jar.-
Examples: ::
# Remove the main class.
shading_zap('org.foobar.example.Main')
# Remove everything in the example package.
shading_keep('org.foobar.example.*')
:param string pattern: Any fully-qualified classname which matches this pattern will removed
from the jar. '*' is a wildcard that matches any individual package component, and '**' is a
wildcard that matches any trailing pattern (ie the rest of the string).
-
pattern = ..., Any fully-qualified classname which matches this pattern will removed from the jar. '*' is a wildcard that matches any individual package component, and '**' is a wildcard that matches any trailing pattern (ie the rest of the string).
-
-
shading_zap_package
: Convenience constructor for a package zap rule.-
Essentially equivalent to just using ``shading_zap('package_name.**')``.
:param string package_name: Package name to remove (eg, ``org.pantsbuild.example``).
:param bool recursive: Whether to remove everything under any subpackage of ``package_name``,
or just direct children of the package. (Defaults to True).
-
package_name = ..., Package name to remove (eg, ``org.pantsbuild.example``). recursive = ..., Whether to remove everything under any subpackage of ``package_name``, or just direct children of the package. (Defaults to True). (default: True)
-
-
testing
: An artifact repository, such as a maven repo.-
:API: public
-
-
-
wiki_artifact
: Binds a single documentation page to a wiki instance.-
This object allows you to specify which wiki a page should be published to, along with additional
wiki-specific parameters, such as the title, parent page, etc.
-
wiki = ..., target spec of a ``wiki``. kwargs = ..., a dictionary that may contain configuration directives for your particular wiki. For example, the following keys are supported for Atlassian's Confluence: * ``space`` -- A wiki space in which to place the page (used in Confluence) * ``title`` -- A title for the wiki page * ``parent`` -- The title of a wiki page that will denote this page as a child. (default: None)
-
-
zglobs
: Matches files in the BUILD file's dir using zsh-style globs, including ``**/`` to recurse.-
*patterns = ..., None
-
Generated by publish_docs
from dist/reference/build_dictionary_body.html 2016-05-19T16:15:18.119390