Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Refactor rules into configurable phases #141

Merged
merged 8 commits into from
Nov 30, 2018
Merged

Refactor rules into configurable phases #141

merged 8 commits into from
Nov 30, 2018

Conversation

andyscott
Copy link
Member

@andyscott andyscott commented Nov 22, 2018

This refactors the core rules into a series of more isolated and configurable phases that can be run together as a pipeline. Additionally, it enables plugins to insert new phases into the pipeline for a particular rule.

This should enable the following future work:

  • Remove the "scalac" rules and instead have a non-zinc compile phase that can be used for bootstrapping the zinc phase.
  • Scalac plugins that add providers to the output. In particular, I'd like to add a SemanticDB compiler plugin that inserts a SemanticDBInfo provider in the final output.
  • ScalaJS/ScalaNative pipelines that share a lot of the same infrastructure as the existing pipelines.

@andyscott andyscott changed the title [WIP] Refactor rules into configurable phases Refactor rules into configurable phases Nov 23, 2018
@andyscott
Copy link
Member Author

(I think there's one lingering issue where the SingleJar is combining files in a different order than we originally expected, but only in CI.)

This was referenced Nov 23, 2018
# phase will merge it into the final jar.
#

def phase_resources(ctx, g):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a big comment block before each of these phases makes me think they should probably each be in their own file.

Copy link
Member Author

@andyscott andyscott Nov 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so too. I have a few more changes in other PRs to iterate on. These will influence the phase names and interfaces (in the global g struct), so I'll want to do wrap them up before splitting phases to separate files. I'd also like to organize the associated Scala source files along with the phases: the deps checker Scala can sit in the same area as the deps checker Starlark code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@borkaehw
Copy link
Collaborator

Looks good to me. One question though, are we planning on doing similar thing to proto and format?

@andyscott
Copy link
Member Author

I don't think the proto and format rules share the same phases. If they do, then we could perhaps do something similar down the road.

@andyscott
Copy link
Member Author

I am going to go ahead and merge this one, as it heavily impacts future work.

@andyscott andyscott merged commit a9af6a9 into master Nov 30, 2018
@andyscott andyscott deleted the rule-phases branch November 30, 2018 18:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants