Skip to content

An example repo to demonstrate in-workspace execution in Pants plugins

License

Notifications You must be signed in to change notification settings

pantsbuild/example-workspace-execution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pantsbuild - Workspace Execution Example

This example project demonstrates the "in-workspace" execution support in Pants which allows running processes directly in a project's repository instead of the usual execution sandbox. The workspace execution support is accessible via the new experimental_workspace_environment target type.

Overview

This example project integrates Pants with Bazel to build a small Java program. (Pants has Java support so this example is very much contrived, but the point is demonstrate integration with a third party build tool, not to focus too much on details of this particular example.)

Some items to be aware of:

  • Bazel sources. The Bazel workspace is under the bazel-jvm directory.

  • Pants configuration. Pants has been configured to only look in BUILD.pants for targets so that Pants does not try to read any BUILD.bazel files.

Running

  1. Ensure you have Bazel and Docker both installed somewhere on the PATH.

  2. Run pants run //:project_image. This will produce a Docker image with the jar file produced by Bazel and run the resulting image. You should see the output: Hello!

Additional Reading

For futher context, see the original "In-Workspace Process Execution" design document.

About

An example repo to demonstrate in-workspace execution in Pants plugins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published