gradle-http-plugin
gradle-http-plugin copied to clipboard
Does not work inside of a doLast block
I wrote a dead simple post request and tested that it works. Only issue was that it ran every time I synced my project. So I put it inside of a doLast block, and now I get this error message:
A configuration closure or consumer must be provided either globally or by the task configuration
task exportTranslations(group: "crowdin", type: HttpTask) {
doLast {
config {
request.uri = "https://api.crowdin.com/api/project/$PROJECT_IDENTIFIER/export?key=$API_KEY"
}
post {
response.success {
println("Export successful")
}
}
}
}
Thanks. I have flagged it as a bug. You are welcome to provide a fix if you want. :-)
I was able to work around it by using doFirst instead