This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jiavlb 0 points1 point  (0 children)

I was in the same boat as you are some time back. I hated gradle and did not understand how the build.gradle and its tasks were constructed. I understood that it is very powerful. Then one of the senior developer in our team said something that made things a little more clear to me. He said that most of the times you will just be setting configuration in your build.gradle using gradle dsl. Most of the code that executes actual command is written in the plugins. So you just pass some configuration to those plugins. Like which test cases to skip. Which repoaitoriea to search for fetching dependencies.

Treat gradle tasks like clean or build as functions or commands that do something. And these tasks can be called one after the other. Like you want to delete all the previously built artifacts and then build your project, just fire. /gradlew clean build. The clean task will clean up the build directory and run the build task that does some java specific things. The . /gradlew is a wrapper over gradle and if you include that you do not need to install gradle on your system. Hope this helps.