Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from praqma-training/task-creation
Browse files Browse the repository at this point in the history
Clean up and expand the task-creation kata
  • Loading branch information
sofusalbertsen authored Mar 16, 2020
2 parents f94a919 + 5c84d69 commit 5e3bd1c
Showing 1 changed file with 33 additions and 11 deletions.
44 changes: 33 additions & 11 deletions task-creation/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
# Task creation
# Gradle Kata: Task creation

## Hello, world
## Setup

Create a task called `hello` that prints `Hello, world!` when executed.
Run `source setup.sh`

## Task

### Creating your first Gradle task

- You are in a newly created Gradle project. Examine the available tasks using `./gradlew tasks`
- Create your first task by copying the following code to `build.gradle`
```
task hello {
println "Hello, friend!"
}
```
- Run `./gradlew`
- Q: Did Gradle print `Hello, world!`? If so, what happened?
- Q: Did Gradle print `Hello, friend!`? What happened? Inspect the full output from the command
- Run `./gradlew hello`
- Q: Was the output as expected?
- How can you avoid `Hello, world!` be printed out in the configuration phase?
## Task properties
### Task properties
- Run `./gradlew tasks`
- Q: Is your 'hello' task listed?
- Q: Can you get `./gradlew tasks` to list it anyway?
- Q: Is the "hello" task listed?
- Run `./gradlew tasks --all`
- Q: Is the "hello" task listed now? In which group?
- Add a Group and a Description to the task:
```
task hello {
group "Greeting"
description "prints a warm greeting"
println "Hello, friend!"
}
```
- Run `./gradlew tasks`
- Q: Is your tasks visible? In the correct group? And with the correct description?
Configure the group and description of your task.
- Run `./gradlew tasks`
- Q: Is your tasks visible and defined according to its purpose?
## Useful commands
- `./gradlew tasks`
- `./gradlew tasks --all`

0 comments on commit 5e3bd1c

Please sign in to comment.