]> www.git.dmfe.net Git - dmfe-website/commitdiff
Add Gradle Wrapper basicis page.
authorDmitry Fedotov <dm.fe@yandex.ru>
Sat, 13 Apr 2024 08:42:14 +0000 (11:42 +0300)
committerDmitry Fedotov <dm.fe@yandex.ru>
Sat, 13 Apr 2024 08:42:14 +0000 (11:42 +0300)
docs/gradle/basics.md
docs/gradle/core-concepts/gradle_basics.md
docs/gradle/core-concepts/gradle_wrapper_basics.md [new file with mode: 0644]

index ca985791e0e3193c6ec14f6f576cdb7b34d34dd5..07e51ca2d16e1ab5d9ab9644739c97221f88e909 100644 (file)
@@ -1,5 +1,8 @@
 ---
 sidebar_position: 1
+tags:
+    - gradle
+    - build tool
 ---
 
 # Why Gradle
index cca2232ef6edc1b0d7568c1731f85199a9a871ad..d78d2b6d14a739045855b089d303ce7fc3fb79aa 100644 (file)
@@ -1,5 +1,9 @@
 ---
 sidebar_position: 1
+tags:
+    - gradle
+    - build tool
+    - basics
 ---
 
 # Gradle Basics
diff --git a/docs/gradle/core-concepts/gradle_wrapper_basics.md b/docs/gradle/core-concepts/gradle_wrapper_basics.md
new file mode 100644 (file)
index 0000000..fc4fedc
--- /dev/null
@@ -0,0 +1,48 @@
+---
+sidebar_position: 2
+tags:
+    - gradle
+    - build tool
+    - wrapper
+---
+
+# Gradle Wrapper Basics
+
+Gradle wrapper is the recommended way to execute Gradle build.
+The Wrapper script downloads a declared version of Gradle if necessary and execute it.
+```mermaid
+flowchart LR
+    gb[Gradle Build] -- 1. Download distribution --> srv[Server]
+    gb -- 2. Store and unpack distribution --> gh[Gradle User Home]
+    gh -- 3. Use distribution --> gb
+```
+
+The Wrapper is available as a `gradlew` or `gradlew.bat` file and provides the following benefits:
+- Standardizes a project on a given Gradle version.
+- Provisions the same Gradle version for different users.
+- Provisions the same Gradle version for different execution environments.
+
+## Using the Gradle Wrapper
+
+It is always recommended to execute a build with the Wrapper.
+Depending on the operation system, you use `gradlew` or `gradlew.bat` script.
+Gradle invocation:
+```bash
+$ gradle build
+```
+
+To run the Wrapper:
+```bash
+$ ./gradlew build     # Linux or OSX
+$ .\gradlew.bat build # Windows
+```
+
+Demo of using the Wrapper on a Linux machine for a Java-based project:
+```bash
+./gradlew build
+Downloading https://services.gradle.org/distributions/gradle-8.2.1-bin.zip
+............10%............20%............30%.............40%............50%............60%............70%.............80%............90%............100%
+
+BUILD SUCCESSFUL in 26s
+7 actionable tasks: 7 executed
+```