I have a scenario where I need to capture below details in the init.gradle file.
Can we get all the activity of task ?
the Inputs params for UploadArchive and
A task to list the same be made as below
publishing {
publications {
maven(MavenPublication) {
groupId = 'abc.xyz'
artifactId = 'overr-name'
version = '1.1-OV'
from components.java
}
}
repositories {
maven {
url = uri("$buildDir/repos/releases")
}
maven {
url = uri("$buildDir/repos/snaps")
}
}
}
task printML() {
doLast {
tasks.findAll {task ->
if (task.name.matches("publish.*PublicationToMavenLocal")) {
def publication = task.publicationInternal
println("Local => $publication.artifactId $publication.groupId $publication.version")
}
if (task.name.matches("publish.*PublicationTo.*Repository")) {
def publication = task.publicationInternal
println("Remote => $publication.artifactId $publication.groupId $publication.version $task.repository.url")
}
}
}
}
Sample output
> Task :printML
Remote => overr-name abc.xyz 1.1-OV file:/Users/projects/Store/combined-samples/build/repos/snaps
Local => overr-name abc.xyz 1.1-OV
Remote => overr-name abc.xyz 1.1-OV file:/Users/projects/Store/combined-samples/build/repos/releases