Created
March 13, 2018 19:36
-
-
Save amadeu01/3016c46d47961f5b66b8d00bfdfe37b8 to your computer and use it in GitHub Desktop.
Test some gradle stuff while lern it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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