How about...
a)
uplaodArchives.doFirst {
// check for username/password and set credentials as dynamic properties on
the uploadArchives task
}
... or
b)
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(uploadArchives)) {
// check for username/password and set credentials as dynamic properties on
the uploadArchives task
}
}
Regards, Etienne
On 17.07.2011, at 15:41, Hani Suleiman wrote:
> Hi all,
>
> I'd like to prompt the user for a username/password when uploading an archive.
>
> I can define a task that prompts the user. The problem I'm running into is a
> side effect of the configuration vs evaluation passes that Gradle does. What
> happens now seems to be:
>
> - Configuration pass evaluates the uploadArchives credentials
> - Prompt task is invoked
>
> If I move the prompt task into uploadArchives, then it's always performed
> (even when not running uploadArchives) as part of the configuration pass.
>
> If this isn't clear, I can send the code examples.
>
> What I'd like is to be able to prompt the user for credentials only when
> uploadArchives is invoked, and have those credentials used for the upload.
> Any suggestions on how best to accomplish that?
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email