Skip to content

Commit 1bcd2ef

Browse files
committed
F: Only register version for the current project
The main challenge is that currently the plugin is partially registering it self with subprojects, but not fully doing so. It should be updated to fully register and handle versioning everywhere or only do it for the project configured. This change moves it to only register for the currently configured project. I thought of making the existing behavior conditional, however even then it didn't feel like the correct change.
1 parent 098a5db commit 1bcd2ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/me/qoomon/gradle/gitversioning/GitVersioningPlugin.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ public void apply(@Nonnull Project project) {
1414

1515
project.getExtensions().create("gitVersioning", GitVersioningPluginExtension.class, project);
1616

17-
project.getAllprojects().forEach(it -> it.getTasks().create("version", VersionTask.class));
17+
// Only Register version task for current project so the plugin may be applied
18+
// on
19+
// sub projects. It would be nice to only define this once for all project in
20+
// a multi-module project, however there are a few other considerations that
21+
// need
22+
// to be made and this current change will make this plugin more composable.
23+
project.getTasks().register("version", VersionTask.class);
1824
}
1925
}
2026

0 commit comments

Comments
 (0)