]> www.git.dmfe.net Git - dmfe-website/commitdiff
Add Gradle Settings File Basics page.
authorDmitry Fedotov <dm.fe@yandex.ru>
Sun, 14 Apr 2024 10:45:00 +0000 (13:45 +0300)
committerDmitry Fedotov <dm.fe@yandex.ru>
Sun, 14 Apr 2024 10:45:00 +0000 (13:45 +0300)
docs/gradle/core-concepts/settings-file-basics.md [new file with mode: 0644]
docusaurus.config.js

diff --git a/docs/gradle/core-concepts/settings-file-basics.md b/docs/gradle/core-concepts/settings-file-basics.md
new file mode 100644 (file)
index 0000000..7dec86c
--- /dev/null
@@ -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:
+<Tabs>
+  <TabItem value="kotlin" label="Kotlin" default>
+        ```kotlin title="󱈙 settings.gradle.kts"
+        rootProject.name = "root-project"   (1)
+
+        include("sub-project-a")            (2) 
+        include("sub-project-b")
+        include("sub-project-c")
+        ```
+  </TabItem>
+  <TabItem value="groovy" label="Groovy">
+        ```groovy title=" settings.gradle"
+        rootProject.name = 'root-project'   (1)
+
+        include('sub-project-a')            (2)
+        include('sub-project-b')
+        include('sub-project-c')
+        ```
+  </TabItem>
+</Tabs>
+
+(1) Define the project name.  
+(2) Add subprojects.
+
index 9b62b2f4db5fb227bad4647854083a0e39618486..f1f438112ca084e01651bd26cf6f2f8117ca5825 100644 (file)
@@ -103,6 +103,7 @@ const config = {
       prism: {
         theme: prismThemes.github,
         darkTheme: prismThemes.dracula,
+        additionalLanguages: ['groovy'],
       },
       colorMode: {
         defaultMode: 'dark',