Skip to content

Instantly share code, notes, and snippets.

@amadeu01
Created March 13, 2018 19:36
Show Gist options
  • Save amadeu01/3016c46d47961f5b66b8d00bfdfe37b8 to your computer and use it in GitHub Desktop.
Save amadeu01/3016c46d47961f5b66b8d00bfdfe37b8 to your computer and use it in GitHub Desktop.
Test some gradle stuff while lern it
println 'Above all stuff'
task hello {
println 'Inside hello, before doLast'
doLast {
println "Hello World"
println 'Inside hello, Inside do doLast'
}
println 'Inside hello, after doLast'
}
println 'Between hello and date'
task date(dependsOn: hello) { // Can put a collection
// dependsOn hello
dependsOn 'hi', 'whatUp'
println 'Inside date, before doLast'
doLast {
println new Date()
}
}
println 'After every stuff'
task hi(type: Greeting)
task whatUp(type: Greeting) {
user = 'Amadeu'
}
class Greeting extends DefaultTask {
String user = 'Pedro'
@TaskAction
void sayHello() {
println "Hello, $user!"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment