Skip to content

Commit

Permalink
Register tasks earlier
Browse files Browse the repository at this point in the history
@jnehlmeier noticed that it can be difficult to create other settings
plugins that build off the tag/push tasks that reckon registers due to
them being registered after projectLoaded.

Since these are only added to the root project, its a trivial tweak to
just register directly on rootProject and avoid the extra ordering
confusion for downstream authors.

Fixes #200
  • Loading branch information
ajoberstar committed Dec 30, 2023
1 parent ad8ccdd commit 018a0e3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public void apply(Settings settings) {
prj.setVersion(sharedVersion);
});

settings.getGradle().projectsLoaded(gradle -> {
var tag = createTagTask(settings.getGradle().getRootProject(), extension);
var push = createPushTask(settings.getGradle().getRootProject(), extension);
settings.getGradle().rootProject(rootProject -> {
var tag = createTagTask(rootProject, extension);
var push = createPushTask(rootProject, extension);
push.configure(t -> t.dependsOn(tag));
});
}
Expand Down

0 comments on commit 018a0e3

Please sign in to comment.