Skip to content

Instantly share code, notes, and snippets.

@girisagar46
Created August 18, 2021 08:38
Show Gist options
  • Save girisagar46/36ab2997eb03cde9b5ea1d028da4be96 to your computer and use it in GitHub Desktop.
Save girisagar46/36ab2997eb03cde9b5ea1d028da4be96 to your computer and use it in GitHub Desktop.
build.gradle sample
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