Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Isolation support #144

Closed
ZakTaccardi opened this issue Feb 22, 2022 · 2 comments · Fixed by #295
Closed

Project Isolation support #144

ZakTaccardi opened this issue Feb 22, 2022 · 2 comments · Fixed by #295
Assignees
Labels
Feature Feature request issue type Kover Gradle Plugin S: in progress Status: implementing or design in process
Milestone

Comments

@ZakTaccardi
Copy link

ZakTaccardi commented Feb 22, 2022

To apply the plugin to all Gradle projects, you only need to apply the plugin to the top-level build file as shown above

With regards to project isolation support (docs), this seems to be a bit of a problem. One project should not access another project.

target.allprojects {
it.applyToProject(providers, agents)
}

Above, the root project is accessing other projects. I somewhat solve this problem by having separate plugins:

com.myPlugin.aggregator
com.myPlugin.subproject

com.myPlugin.subproject is applied to subprojects, and com.myPlugin.aggregator is responsible for aggregating the output from subprojects that apply com.myPlugin.subproject.

Excerpt from Square's herding elephants article on why this feature is important

Eliminate cross-project configuration (think: allprojects and subprojects) so that every module (or "project", to use Gradle terminology) could be configured independently from every other. This should improve the configuration phase of the build, since those APIs defeat configuration on demand; and it also sets us up to be compatible with a new experimental Gradle feature known as project isolation, which holds the promise of making slow Android Studio syncs a thing of the past.

Even though Project Isolation is experimental (and in most cases, not yet practical) - it's important that Gradle plugins (like Kover) design with Project Isolation in mind. For example, having separate plugins and only using allprojects/subprojects { } (if you must) in a dedicated .aggregator plugin. That way, when Gradle releases APIs to avoid the allprojects/subprojects { } APIs, the migration is trivial.

note: I'd definitely recommend reaching out to the Gradle team to see what they recommend here

@shanshin
Copy link
Collaborator

shanshin commented Apr 8, 2022

Relates #19

@shanshin
Copy link
Collaborator

Resolved in 0.7.0-Alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature request issue type Kover Gradle Plugin S: in progress Status: implementing or design in process
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants