Uploaded August 2019 | Updated November 2026, 2 hours ago
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
tasks.register('hello') {
def kitty = """ /\\____/\\ __
.' \"\"\"\" `,-' `--.__
__,- : - - ; " :: `-. -.__
,-sssss `._ `' _,'" ,'~~~::`.sssss-.
|ssssss ,' ,_`--'_ __,' :: ` `.ssssss|
|sssssss `-._____~ `,,'_______,---_;; ssssss|
|ssssssssss `--'~{__ ____ ,'ssssss|
`-ssssssssssssssssss ~~~~~~~~~~~~ ssss.-'
`---.sssssssssssssssssssss.---'"""
println kitty
}
```
To run this task you would run `gradle hello` in the same directory as the build.gradle file you added this to.
If you want to learn how to install Gradle, learn more here: docs.gradle.org/current/userguide/installation.html
Gradle's docs are available on their website: guides.gradle.org/writing-gradle-tasks
More documentation and example use cases of the Gradle `exec` API: docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html
Join the World of Zero Discord Server: discord.gg/hU5Kq2u
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
tasks.register('hello') {
def kitty = """ /\\____/\\ __
.' \"\"\"\" `,-' `--.__
__,- : - - ; " :: `-. -.__
,-sssss `._ `' _,'" ,'~~~::`.sssss-.
|ssssss ,' ,_`--'_ __,' :: ` `.ssssss|
|sssssss `-._____~ `,,'_______,---_;; ssssss|
|ssssssssss `--'~{__ ____ ,'ssssss|
`-ssssssssssssssssss ~~~~~~~~~~~~ ssss.-'
`---.sssssssssssssssssssss.---'"""
println kitty
}
```
To run this task you would run `gradle hello` in the same directory as the build.gradle file you added this to.
If you want to learn how to install Gradle, learn more here: docs.gradle.org/current/userguide/installation.html
Gradle's docs are available on their website: guides.gradle.org/writing-gradle-tasks
More documentation and example use cases of the Gradle `exec` API: docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html
Join the World of Zero Discord Server: discord.gg/hU5Kq2u







**: A new copy of your service will be constructed every time it is requested by an object.
* **[Scoped](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicecollectionserviceextensions.addscoped)**: Your service will be instantiated once for the entire execution scope - usually covering a single web request. Every reference to the service within that scope will share the same copy of the service.
* **[Singleton](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicecollectionserviceextensions.addsingleton)**: Your service will be instantiated once - the first time it is requested - and then that instance will be reused everywhere else it is needed for the entire time your application is running.
You can learn more about using .NETs Dependency Injection features at these links:
* http://aka.ms/usingdotnetdependencyinjection
* https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection
If youre interested in using Dependency Injection in Spring Boot and Java you can learn more about that here: https://youtu.be/EsbMbg34CpQ
If youre interested in learning more about how to use Dependency Injection in your Unity games you can learn more about that here: https://youtu.be/e0KWsizPYAw
***
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Using Dependency Injection in ASP.NET](https://i.ytimg.com/vi/T2hD6Imb6y8/mqdefault.jpg)


