From f7cbac8781afe35237d0f8fd8188cc8349a59e21 Mon Sep 17 00:00:00 2001 From: Dmitry Fedotov Date: Sun, 14 Apr 2024 13:45:00 +0300 Subject: [PATCH] Add Gradle Settings File Basics page. --- .../core-concepts/settings-file-basics.md | 49 +++++++++++++++++++ docusaurus.config.js | 1 + 2 files changed, 50 insertions(+) create mode 100644 docs/gradle/core-concepts/settings-file-basics.md diff --git a/docs/gradle/core-concepts/settings-file-basics.md b/docs/gradle/core-concepts/settings-file-basics.md new file mode 100644 index 0000000..7dec86c --- /dev/null +++ b/docs/gradle/core-concepts/settings-file-basics.md @@ -0,0 +1,49 @@ +--- +sidebar_position: 4 +tags: + - gradle + - build tool + - settings +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Settings File Basics + +Settings file is the **entry point** of every Gradle project. +The primary purpose of the _settings file_ is to add subprojects to your build. +Gradle supports single and multi-project builds. +- Settings file is optional for single-project builds. +- Settings file is mandatory and declares all subprojects for multi-project builds. + +## Settings script + +The settings file is a script. It is either a `settings.gradle` file written in Groovy +or a `settings.gradle.kts` file in Kotlin. +The _Groovy DSL_ and _Kotlin DSL_ are the only accepted languages for Gradle scripts. +The settings file is typically found in the root directory of the project: + + + ```kotlin title="󱈙 settings.gradle.kts" + rootProject.name = "root-project" (1) + + include("sub-project-a") (2) + include("sub-project-b") + include("sub-project-c") + ``` + + + ```groovy title=" settings.gradle" + rootProject.name = 'root-project' (1) + + include('sub-project-a') (2) + include('sub-project-b') + include('sub-project-c') + ``` + + + +(1) Define the project name. +(2) Add subprojects. + diff --git a/docusaurus.config.js b/docusaurus.config.js index 9b62b2f..f1f4381 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -103,6 +103,7 @@ const config = { prism: { theme: prismThemes.github, darkTheme: prismThemes.dracula, + additionalLanguages: ['groovy'], }, colorMode: { defaultMode: 'dark', -- 2.39.5