Created
August 18, 2021 08:38
-
-
Save girisagar46/36ab2997eb03cde9b5ea1d028da4be96 to your computer and use it in GitHub Desktop.
build.gradle sample
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
plugins { | |
id 'java' | |
} | |
group 'com.github.girisagar46' | |
version '1.0' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2' | |
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2' | |
} | |
test { | |
useJUnitPlatform() | |
} | |
// this is the external property. | |
ext.person = "Sagar" | |
task hello { | |
doLast { | |
println "Hello! $person" | |
} | |
} | |
// The doFirst and doLast can be executed multiple times inside a task | |
task hi(dependsOn: hello) { | |
doFirst { | |
println("Running doFirst of hi task") | |
} | |
doLast { | |
println "Hi! $person" | |
} | |
doLast { | |
println "Second doLast" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment