Build 도구가 필요한 이유
1. 번거로운 빌드 과정으로 인한 비효율 발생
2. 라이브러리들의 버전 관리의 어려움
Deamon Process: 서비스의 요청에 응답하기 위해 오래 동안 실행중인 백 그라운드 프로세스
2. 빌드 스크립트가 간결하다. (Maven과 달리 XML을 쓰지 않는다.)
3. 커스텀이 쉽다.
- 특정 조건에 따라 설정을 다르게 할 수 있다.
``` groovy
def isCIEnvironment() {
return false
}
myTask.onlyIf { isCIEnvironment() }
```
- 커스텀을 통해 멀티 프로젝트 빌드가 가능하다.
plugins {
id 'java-library'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
api 'org.apache.commons:commons-math3:3.6.1'
implementation 'com.google.guava:guava:31.0.1-jre'
}
Task는 클래스들을 컴파일하고 테스트를 하는 등 다양한 작업을 수행하는 작업 단위이다.
A <- B (dependencies에서 implementation를 통해 A 라이브러리 의존) <- C
A 수정 시 B까지만 재빌드
A <- B (dependencies에서 api를 통해 A 라이브러리 의존) <- C
A 수정 시 C 재빌드
https://docs.gradle.org/current/userguide/what_is_gradle.html#five_things
https://tomgregory.com/top-gradle-benefits-over-maven/
https://jongmin92.github.io/2019/05/09/Gradle/gradle-api-vs-implementation/
https://www.devkuma.com/docs/gradle/repositories/