1

I am a Java developer and just joined a project which already uses Gradle. In build.gradle file, I have statements like below

springBoot {
  backupSource = false
}

checkstyle {
  configProperties = [basedir: projectDir]
}

task bowerInstall(type: Exec, dependsOn: npmInstall) {
  commandLine 'node', 'node_modules/bower/bin/bower', 'install', '-F', '-s'
}

task gulpBuild(type: Exec, dependsOn: [npmInstall, bowerInstall]) {
  commandLine 'node', 'node_modules/gulp/bin/gulp', 'build', '--release', '--silent'
}

Here I understand bowerInstall and gulpBuild are custom tasks as they have the keyword "task" in the beginning. But what about other statements like springBoot and checkstyle. It doesn't have the "task" prefix, but it looks like task.

Are they called as tasks ? Can you please clarify my doubt ? Also do you think learning groovy syntax mandatory to write the build.gradle file ?

Opal
  • 81,889
  • 28
  • 189
  • 210
vijayashankard
  • 721
  • 1
  • 7
  • 23

1 Answers1

1

Yes, bowerInstall and gulpBuild are plain gradle tasks of type Exec. The two other blocks you're asking: springBoot and checkstyle are extensions, please have a look a this link, the piece of code presented there is pretty self-explanatory.

Opal
  • 81,889
  • 28
  • 189
  • 210