Gradle

install

sdk install gradle
brew install gradle

run

gradle build
gradle build -x test
gradle bootRun

Simple Start

mkdir basic-demo
cd basic-demo
touch build.gradle

gradle tasks

gradle tasks --all
gradle tasks
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :tasks

------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------

Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'bin'.
components - Displays the components produced by root project 'bin'. [incubating]
dependencies - Displays all dependencies declared in root project 'bin'.
dependencyInsight - Displays the insight into a specific dependency in root project 'bin'.
dependentComponents - Displays the dependent components of components in root project 'bin'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'bin'. [incubating]
projects - Displays the sub-projects of root project 'bin'.
properties - Displays the properties of root project 'bin'.
tasks - Displays the tasks runnable from root project 'bin'.

To see all tasks and more detail, run gradle tasks --all

To see more detail about a task, run gradle help --task <task>


BUILD SUCCESSFUL in 4s
1 actionable task: 1 executed

Dependency scope

Simple task

task copy(type: Copy) {
  from 'src'
  into 'dest'
}
./gradlew tasks --all
./gradlew copy
gradle copy

gradle daemon

Plugin

plugins {
  id 'base'
}

task copy...

task zip(type: Zip) {
  from 'src'
}
./gradlew tasks --all

gradle wrapper

gradle wrapper
.
β”œβ”€β”€ build.gradle
β”œβ”€β”€ gradle
β”‚   └── wrapper
β”‚       β”œβ”€β”€ gradle-wrapper.jar
β”‚       └── gradle-wrapper.properties
β”œβ”€β”€ gradlew
└── gradlew.bat

custom repository

repositories {
  maven {
    url 'http://repo.mycompany.com/maven2'
  }
}

Parameter

ref

What Else?
inflearn react api server -50% 할인쿠폰: 15108-f2af1e086101 buy me a coffee