Skip to content

Commit

Permalink
Add printProjects task
Browse files Browse the repository at this point in the history
  • Loading branch information
Virtlink committed Jul 23, 2024
1 parent fd027ef commit f914c76
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project are documented in this file, based on [Keep
## [Unreleased]


## [1.7.4] - 2024-07-24
- Add `printProjects` task that prints the GAV coordinates of all projects.


## [1.7.3] - 2024-07-22
- No changes.

Expand All @@ -30,7 +34,7 @@ All notable changes to this project are documented in this file, based on [Keep


## [1.6.2] - 2024-07-16
- When creating a forced snapshot version, the snapshot version should be the same regardless of whether the current `HEAD` commit has a relwase tag or not.
- When creating a forced snapshot version, the snapshot version should be the same regardless of whether the current `HEAD` commit has a release tag or not.
- By default, set `firstParentOnly` to `true`.


Expand Down
19 changes: 19 additions & 0 deletions plugin/src/main/kotlin/mb/gitonium/GitoniumPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class GitoniumPlugin : Plugin<Project> {
// Register tasks
registerCheckSnapshotDependenciesTask(project, extension)
registerPrintVersionTask(project)
registerPrintProjectsTask(project)
registerAssertNotDirtyTask(project)
registerWriteBuildPropertiesTask(project, extension)
}
Expand Down Expand Up @@ -66,6 +67,24 @@ class GitoniumPlugin : Plugin<Project> {
}
}

/**
* Registers a task that prints the GAV coordinates of all projects in the build to STDOUT.
*
* @param project The project for which to register the task.
*/
private fun registerPrintProjectsTask(project: Project) {
project.tasks.register("printProjects") {
this.group = "help"
this.description = "Prints the GAV coordinates of all projects in the build."

doLast {
project.allprojects.forEach {
println("${it.group}:${it.name}:${it.version}")
}
}
}
}

/**
* Registers a task that asserts that the current version of the project is not 'dirty',
* i.e., has changes not in the current version tag.
Expand Down

0 comments on commit f914c76

Please sign in to comment.