Skip to content

Commit a8fbfca

Browse files
authored
Merge pull request #97 from ericmaino/fix-task-registration
fix: Only register version for the current project
2 parents 9487285 + 1bcd2ef commit a8fbfca

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)