
어플리케이션이나 라이브러리같은 빌드될 수 있는 소프트웨어의 집합
Gradle이 수행할 작업들의 스탭과 상세 정보들
각각의 프로젝트들은 하나 이상의 build scripts를 가질 수 있음
각각의 프로젝트들은 Gradle이 빌드할 때 필요한 모든 종속성을 알아서 관리함
테스트하거나 컴파일하는 기본적인 작업단계
각각의 플젝들은 플러그인이나 빌드 스크립트에 포함된 하나이상의 task가 있음
Plugins are used to extend Gradle’s capability and optionally contribute tasks to a project.

1. Gradle directory to store wrapper files and more
2. Gradle version catalog for dependency management
3. Gradle wrapper scripts
4. Gradle settings file to define a root project name and subprojects
5. Gradle build scripts of the two subprojects - subproject-a and subproject-b
6. Source code and/or additional files for the projects
commandLine에서
$ gradle build
명령어로 실행 가능
다만 Gradle Wrapper를 사용하는 것을 더 추천함
$ gradlew build // linux or osx
$ gradlew.bat build //window
맨 위 구조 사진에서 Gradle 블럭 전체를 말한다.
Wrapper Script는 그래들 버전을 지정하고 필요하다면 사전에 필요한 파일들을 다운받는다. 이 작업들로 인해 개발자는 빠르게 그래들 플젝들 실행시킬 수 있다.
The primary purpose of the settings file is to add subprojects to your build.
Gradle supports single and multi-project builds.
For single-project builds, the settings file is optional.
For multi-project builds, the settings file is mandatory and declares all subprojects.
Settings 오브젝트를 생성한다. 해당 오브젝트의 목적은 빌드에 포함된 모든 플젝에서 사용하기 위함이다.중요
There is a one-to-one correspondence between a Settings instance and a settings.gradle(.kts) file.
kts Setting doc
settings script에 속한 많은 top-level properties, block은 Setting API로 이루어져있습니다.
예를들어 루트 플젝이름이 있습니다.
settings.rootProject.name = "root"
자주 사용되는 프로퍼티
| Name | Description |
|---|---|
| buildCache | The build cache configuration. |
| plugins | The container of plugins that have been applied to the settings. |
| rootDir | The root directory of the build. The root directory is the project directory of the root project. |
| rootProject | The root project of the build. |
| settings | Returns this settings object. |
주요 사용되는 함수
| Name | Description |
|---|---|
| include() | Adds the given projects to the build. |
| includeBuild() | Includes a build at the specified path to the composite build. |
그래들 스크립트의 경우 kts, Groovy를 지원한다. 이번 글에서는 kts를 기준으로 작성
rootProject.name = "root-project"
include("sub-project-a")
include("sub-project-b")
include("sub-project-c")
플젝이름 설정 및 서브 프로젝트 추가
멀티모듈의 경우 해당 모듈들을 추가

1. Define the location of plugins
2. Apply settings plugins.
3. Define the root project name.
4. Define dependency resolution strategies.
5. Add subprojects to the build.
플러그인을 어디서 제공할지 지정
옵셔널한 부분으로 플젝세팅에 필요한 플러그인을 적용함 주로 Develocity plugin or Toolchain Resolver pulgin을 사용한다고함
rootProject.name = "루트 플젝"
옵셔널한 부분으로 플젝의 dependency resolution 해결의 규칙과 설정을 할 수 있다.
