Exploring How To Write Custom Gradle Tasks

preview_player
Показать описание
Gradle is a build tool for Java and other JDK based projects that uses a series of tasks to compile, test and run your projects. One of the advantages of Gradle being based upon tasks instead of specific features is that it is very extensible. This means different tools can add more features to the project as needed (for example a linter can create a `gradle lint` task). It also means *we* can add more features to our projects by creating our own custom tasks.

In this video we're going to explore the basics of creating a new gradle project with `gradle init` and then adding a new custom task that can print information to our terminal or run a custom command line tool.

To register a basic task named `hello` in Gradle you could use. This task will print out a cool cat:

```groovy
def kitty = """ /\\____/\\ __
.' \"\"\"\" `,-' `--.__
__,- : - - ; " :: `-. -.__
,-sssss `._ `' _,'" ,'~~~::`.sssss-.
|ssssss ,' ,_`--'_ __,' :: ` `.ssssss|
|sssssss `-._____~ `,,'_______,---_;; ssssss|
|ssssssssss `--'~{__ ____ ,'ssssss|
`-ssssssssssssssssss ~~~~~~~~~~~~ ssss.-'
println kitty
}
```

Рекомендации по теме
Комментарии
Автор

I do not mind your honestly when things fail but I would move on quickly or just cut out those parts to save the viewers' time. Appreciate your efforts in making this video. Thanks.

AnasMughal
Автор

You got a lot of cool videos. I don't use gradle at the moment. Just want to be here to show support. :)

LeeTGame
Автор

Great explanation, keep up the good work! 👍

ajinkyadande
Автор

Так я себе и представлял людей, которые занимаются этими ебучими настройками для гредла. Сука, там черт ногу сломит...

FessNiklas
Автор

java with visual code? well good luck to you sir, still, thumbs up for spreading knowledge to the world

_slier
Автор

I notice you're in a minecraft folder, do you know how to setup forge with vscode? I'm working on it right now but rarely use java and have never used gradle

joeyweng
Автор

several hiccups, but got a few stuff...

mohsenmadi
Автор

hi please provide 10 fibonacci series in gradle program, , at least provide a link of the program to check what is exact formation.. with out put

manipvmk
join shbcf.ru