This is my first post . Apologies , if i sound stupid.
I have worked with make , ant and maven in past but now as it’s gradle craze everywhere . I am trying to learn it.
I have started with user-guide ( very big one ) and practicing in parallel . I am finding it difficult in terms of syntax and worried about retaining lot of information . Sometimes i feel discouraged to move ahead but then i muster my courage , as no way out
No doubt , user guide is great masterpiece and quite interesting .
I am curious to know , how others learn and start with gradle ? Did you also find it tough in first attempt ?
I would be grateful , if you could please share your experiences and journey.
Thank you so much in advance .
P.S : Admins , could you please move my post to relevant forum , if this is not right place to ask for.
i have made one-pass to user-guide somehow ( 600+ pages , God bless me! ) to understand what gradle is all about. Trust me few chapters are very tricky and difficult specially “VI. THE SOFTWARE MODEL” etc.
Now have started going through guides ( and practicing) you referred above . Very useful .
In the code example below you are applying the Java plugin - that means you will automatically introduce all conventions of the Java plugin to the project consuming your plugin. It’s possible that the consuming project isn’t even a Java plugin but you change the flavor of it by making the assumption. In most cases this can be avoided.
project.getPlugins().withType(JavaPlugin.class, ... says: If the consuming project already applies the Java plugin then configure it in a specific way. Otherwise don’t do it.
Now i get it , so here we don’t make consuming project --> a java plugin based one , “forcefully” . This code checks if it is a “java plugin based” or not and hence action accordingly.
Interestingly , so this way “I react” to java plugin .
I would recommend that rather than trying to learn Gradle, your shift your goal to achieving something that has meaning in the context of the project.
One good exercise is finding a project with a complex Maven build and trying to replicate the results in Gradle. Then your questions will be a lot more concrete and your knowledge would stick to the practical problems you needed to solve.
Regarding the software model, I found it interesting about 2 years ago and read a bit through the docs to get the idea, but at the time it looked a bit half-baked, so I decided to wait for it to mature and accumulate a critical mass of plugins that I can look to for examples of best practices - I am still waiting