5 Aralık 2021 Pazar

init Task - Gradle Wrapper Üretir

Giriş
Bu task ile gradle wrapper dosyaları oluşturulur. Gradle wrapper kullanmanın iyi yanları şöyle
The Gradle wrapper is a script you add to your Gradle project and use to execute your build. The advantages are:

- you don’t need to have Gradle installed on your machine to build the project
- the wrapper guarantees you’ll be using the version of Gradle required by the project
- you can easily update the project to a newer version of Gradle, and push those changes to version control so other team members use the newer version
Açıklaması şöyle
By default the Gradle wrapper created by running gradle init or gradle wrapper will use the version of Gradle installed on your machine.
Örnek
Şöyle yaparız
gradle init
4 tane dosya oluşturulur. Bu dosyaları git'e commitlemek gerekir. Dosyalar şöyle
gradle-wrapper.jar code required for downloading the correct Gradle version when you run the build
gradle-wrapper.properties file to configure the wrapper’s properties such as the Gradle version
gradlew a shell script for executing the build on Linux
gradlew.bat a script for executing the build on Windows
gradle-wrapper.properties Dosyası
Dosya şöyle
$ cat gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Örnek - Create a Gradle project
Açıklaması şöyle
gradle init

You’ll be asked several questions. Here are the values that I used for my project.

Select type of project to generate: application
Select implementation language: java
Split functionality across multiple subprojects?: no
Select build script DSL: Kotlin
Generate build using new APIs and behavior: yes
Select test framework: JUnit Jupyter
Project name: apachebeamtraining
Source package: apachebeamtraining

Hiç yorum yok:

Yorum Gönder

Gradle Daemon Nedir?

Giriş Açıklaması  şöyle . Gradle Daemon arka planda çalışır. Çünkü Gradle'ı ayağa kaldırmak ve ilklendirmek çok uzun sürüyor.  Gradle ru...