Skip to content

Conversation

dragos
Copy link
Contributor

@dragos dragos commented Apr 18, 2023

Expose what the incremental compiler is doing behind the scenes. The RunProfiler interface has been part of Zinc for a while, but this allows the build itself, or an Sbt plugin, to hook their own implementation.

We expose a list of such listeners to avoid plugins stepping on each other and replacing an existing listener.

NOTE: this is broken until Sbt upgrades to a new release containing sbt/zinc#1181

This key has been added in 4061dab but it is only available to Sbt itself. Since ExternalHooks is a Java interface, defined in Zinc for a while and fairly stable, I think this should be safe to do.

My main  motivation is to allow installing an InvalidationProfiler from an Sbt plugin, thus gaining access to zinc recompilation decisions. See related PR sbt/zinc#1181
@lightbend-cla-validator

Hi @dragos,

Thank you for your contribution! We really value the time you've taken to put this together.

We see that you have signed the Lightbend Contributors License Agreement before, however, the CLA has changed since you last signed it.
Please review the new CLA and sign it before we proceed with reviewing this pull request:

https://www.lightbend.com/contribute/cla

@dragos
Copy link
Contributor Author

dragos commented Apr 18, 2023

If the PR is approved, this might be safe and desirable to backport to 1.8.x

@eed3si9n eed3si9n added this to the 1.9.0 milestone Apr 24, 2023
@dragos dragos requested a review from eed3si9n April 24, 2023 10:34
@dragos dragos changed the title Make externalHooks public Expose RunProfiler to the build Apr 24, 2023
@dragos dragos force-pushed the expose/external-hooks-public branch from 354525a to 8932e3e Compare April 24, 2023 11:37
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Thanks @dragos!

Expose what the incremental compiler is doing behind the scenes. The RunProfiler interface has been part of Zinc for a while, but this allows the build itself, or an Sbt plugin, to hook their own implementation.

We expose a list of such listeners to avoid plugins stepping on each other and replacing an existing listener.
@dragos dragos force-pushed the expose/external-hooks-public branch from 8932e3e to 6dfebc6 Compare April 25, 2023 10:00
@dragos
Copy link
Contributor Author

dragos commented Apr 25, 2023

I just pushed a little update, modifying the key description to be more readable and similar to the other standard key descriptions.

@eed3si9n eed3si9n merged commit df738ab into sbt:1.9.x Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants