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 #15 from praqma-training/wrapper_kata
Browse files Browse the repository at this point in the history
add gradle-wrapper-basics kata
  • Loading branch information
michaelin authored Mar 26, 2020
2 parents 8c6fa79 + a0859fa commit d9aa4fc
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ Feel free to use these exercises, that's why they're public!

## Suggested Learning Path

Setup
- [gradle-wrapper-basics](./gradle-wrapper-basics/README.md) - Use the gradle wrapper to ensure that the correct gradle version is used.

Task creation
- [task-creation](./task-creation/README.md) - Add a simple task and execute it
- [build-phases](./build-phases/README.md) - Creating dependent tasks and ordered execution
Expand Down
28 changes: 28 additions & 0 deletions gradle-wrapper-basics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Gradle Kata: Gradle Wrapper

While you can use Gradle directly to run your build, the setup process is toilsome and having all your developers use the same version is a pain. The Gradle Wrapper script deals with these problems for you, and is the recommended way to use Gradle.

## Setup

Run `. setup.sh`

Then enter the `exercises` directory.

## The task
The `exercises` directory is the root of your new project, where you want to use Gradle to build it.

1. Run `gradlew wrapper`
1. Examine the generated files. The following files and folders have been created:
* .gradle/
* gradle/
* gradlew
* gradlew.bat
1. Run `gradlew --version` and verify that the version is the same as when running `gradle --version`
1. Run `./gradlew wrapper --gradle-version 5.6.4` to update the version used by the gradle wrapper
1. Run `gradlew --version` again
1. Run `gradle --version` again

## Useful commands
* `gradle wrapper`
* `gradle wrapper --gradle-version x.y.z`
* `gradle --version` and `gradlew --version`
12 changes: 12 additions & 0 deletions gradle-wrapper-basics/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
echo "[KATA] Setting up the kata"
echo "[KATA] ------"
echo "[KATA] "

echo "[KATA] Cleaning up old exercise"
rm -rf exercise/

echo "[KATA] Initializing new exercise"
mkdir exercise
cd exercise

echo "[KATA] Done!"

0 comments on commit d9aa4fc

Please sign in to comment.