Updated the sample gradle modules

This commit is contained in:
Sambo Chea 2022-07-09 10:42:05 +07:00
parent 0b768ee073
commit 32b8d4a2d1
Signed by: sombochea
GPG Key ID: 3C7CF22A05D95490
3 changed files with 24 additions and 27 deletions

View File

@ -1,28 +1,32 @@
# Sample Modules
- Including parent deps
- Spring Boot
- Spring Boot with Kotlin
- Spring Dependency Management
- Gradle with Kotlin DSL (6.6.1)
- Kotlin Langauge
- Gradle with Kotlin DSL
# Development
- Clone the modules
```shell
git clone https://git.cubetiqs.com/CUBETIQ/sample-modules.git --recurse-submodules --remote-submodules
```
### Add Submodule by using git submodule (Example)
```shell
git submodule add https://git.cubetiqs.com/CUBETIQ/gradle-sample-module-example.git
```
### Register module in ```settings.gradle.kts``` or ```settings.gradle```
```gradle
rootProject.name = "sample-modules"
include("gradle-sample-module-example")
```
### Implementation module in ```build.gradle.kts```
```gradle
implementation(project(":gradle-sample-module-example"))
```

View File

@ -1,33 +1,15 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id("org.springframework.boot") version "2.4.0" apply false
id("io.spring.dependency-management") version "1.0.10.RELEASE" apply false
kotlin("jvm") version "1.4.10" apply false
kotlin("plugin.spring") version "1.4.10" apply false
id("org.springframework.boot") version "2.7.1" apply false
id("io.spring.dependency-management") version "1.0.12.RELEASE" apply false
kotlin("jvm") version "1.7.10" apply false
kotlin("plugin.spring") version "1.7.10" apply false
}
allprojects {
group = "com.cubetiqs.modules"
version = "0.0.1-SNAPSHOT"
tasks.withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
}
subprojects {
@ -38,4 +20,15 @@ subprojects {
apply {
plugin("io.spring.dependency-management")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
}

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists