Skip to content

Instantly share code, notes, and snippets.

@stuhood
Last active April 19, 2019 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuhood/10bed72e5dadf9fc36e9b9c96a8a230d to your computer and use it in GitHub Desktop.
Save stuhood/10bed72e5dadf9fc36e9b9c96a8a230d to your computer and use it in GitHub Desktop.
@rule(Logger, [Workunit])
def logger(workunit):
# Maybe we don't need both `Logger` and `Workunit`?
..
@rule(Classpath, [Logger, Target])
def compile_some_stuff(logger, target):
..
@console_rule(Compile, [Specs])
def compile(specs):
workunit = Workunit('compile')
targets = ..
# Assuming syntax from https://github.com/pantsbuild/pants/issues/7490:
root_classpaths = [yield Get(Classpath, {Target: t, Workunit: w}) for t in targets]
..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment