Compare commits
1 Commits
a27388320f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
32b8d4a2d1
|
14
README.md
14
README.md
@@ -1,28 +1,32 @@
|
|||||||
# Sample Modules
|
# Sample Modules
|
||||||
- Including parent deps
|
|
||||||
- Spring Boot (2.4.1)
|
- Spring Boot with Kotlin
|
||||||
- Spring Dependency Management
|
- Spring Dependency Management
|
||||||
- Gradle with Kotlin DSL (6.6.1)
|
- Gradle with Kotlin DSL
|
||||||
- Kotlin Langauge (1.4.21)
|
|
||||||
|
|
||||||
# Development
|
# Development
|
||||||
|
|
||||||
- Clone the modules
|
- Clone the modules
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone https://git.cubetiqs.com/CUBETIQ/sample-modules.git --recurse-submodules --remote-submodules
|
git clone https://git.cubetiqs.com/CUBETIQ/sample-modules.git --recurse-submodules --remote-submodules
|
||||||
```
|
```
|
||||||
|
|
||||||
### Add Submodule by using git submodule (Example)
|
### Add Submodule by using git submodule (Example)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git submodule add https://git.cubetiqs.com/CUBETIQ/gradle-sample-module-example.git
|
git submodule add https://git.cubetiqs.com/CUBETIQ/gradle-sample-module-example.git
|
||||||
```
|
```
|
||||||
|
|
||||||
### Register module in ```settings.gradle.kts``` or ```settings.gradle```
|
### Register module in ```settings.gradle.kts``` or ```settings.gradle```
|
||||||
|
|
||||||
```gradle
|
```gradle
|
||||||
rootProject.name = "sample-modules"
|
rootProject.name = "sample-modules"
|
||||||
include("gradle-sample-module-example")
|
include("gradle-sample-module-example")
|
||||||
```
|
```
|
||||||
|
|
||||||
### Implementation module in ```build.gradle.kts```
|
### Implementation module in ```build.gradle.kts```
|
||||||
|
|
||||||
```gradle
|
```gradle
|
||||||
implementation(project(":gradle-sample-module-example"))
|
implementation(project(":gradle-sample-module-example"))
|
||||||
```
|
```
|
||||||
@@ -1,33 +1,15 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("org.springframework.boot") version "2.4.2" apply false
|
id("org.springframework.boot") version "2.7.1" apply false
|
||||||
id("io.spring.dependency-management") version "1.0.11.RELEASE" apply false
|
id("io.spring.dependency-management") version "1.0.12.RELEASE" apply false
|
||||||
kotlin("jvm") version "1.4.21" apply false
|
kotlin("jvm") version "1.7.10" apply false
|
||||||
kotlin("plugin.spring") version "1.4.21" apply false
|
kotlin("plugin.spring") version "1.7.10" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = "com.cubetiqs.modules"
|
group = "com.cubetiqs.modules"
|
||||||
version = "0.0.1-SNAPSHOT"
|
version = "0.0.1-SNAPSHOT"
|
||||||
|
|
||||||
tasks.withType<JavaCompile> {
|
|
||||||
sourceCompatibility = "11"
|
|
||||||
targetCompatibility = "11"
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<KotlinCompile> {
|
|
||||||
kotlinOptions {
|
|
||||||
freeCompilerArgs = listOf("-Xjsr305=strict")
|
|
||||||
jvmTarget = "11"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
@@ -39,13 +21,14 @@ subprojects {
|
|||||||
plugin("io.spring.dependency-management")
|
plugin("io.spring.dependency-management")
|
||||||
}
|
}
|
||||||
|
|
||||||
the<io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension>().apply {
|
tasks.withType<KotlinCompile> {
|
||||||
imports {
|
kotlinOptions {
|
||||||
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
|
freeCompilerArgs = listOf("-Xjsr305=strict")
|
||||||
|
jvmTarget = "17"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<org.springframework.boot.gradle.tasks.bundling.BootJar> {
|
tasks.withType<Test> {
|
||||||
enabled = false
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
3
build.sh
3
build.sh
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
bash gradlew clean && bash gradlew build -x test
|
|
||||||
37
demo/.gitignore
vendored
37
demo/.gitignore
vendored
@@ -1,37 +0,0 @@
|
|||||||
HELP.md
|
|
||||||
.gradle
|
|
||||||
build/
|
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
|
||||||
!**/src/main/**/build/
|
|
||||||
!**/src/test/**/build/
|
|
||||||
|
|
||||||
### STS ###
|
|
||||||
.apt_generated
|
|
||||||
.classpath
|
|
||||||
.factorypath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.springBeans
|
|
||||||
.sts4-cache
|
|
||||||
bin/
|
|
||||||
!**/src/main/**/bin/
|
|
||||||
!**/src/test/**/bin/
|
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
|
||||||
.idea
|
|
||||||
*.iws
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
out/
|
|
||||||
!**/src/main/**/out/
|
|
||||||
!**/src/test/**/out/
|
|
||||||
|
|
||||||
### NetBeans ###
|
|
||||||
/nbproject/private/
|
|
||||||
/nbbuild/
|
|
||||||
/dist/
|
|
||||||
/nbdist/
|
|
||||||
/.nb-gradle/
|
|
||||||
|
|
||||||
### VS Code ###
|
|
||||||
.vscode/
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("org.springframework.boot")
|
|
||||||
id("io.spring.dependency-management")
|
|
||||||
kotlin("jvm")
|
|
||||||
kotlin("plugin.spring")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
api(project(":lib"))
|
|
||||||
|
|
||||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
|
||||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
|
||||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
|
||||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Test> {
|
|
||||||
useJUnitPlatform()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tasks.withType<org.springframework.boot.gradle.tasks.bundling.BootJar> {
|
|
||||||
enabled = true
|
|
||||||
}
|
|
||||||
BIN
demo/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
demo/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@@ -1,5 +0,0 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
|
||||||
distributionPath=wrapper/dists
|
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package com.example.demo
|
|
||||||
|
|
||||||
import com.example.lib.MyLib
|
|
||||||
import com.example.lib.MyUtils
|
|
||||||
import org.springframework.boot.CommandLineRunner
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
|
||||||
import org.springframework.boot.runApplication
|
|
||||||
|
|
||||||
@SpringBootApplication
|
|
||||||
class DemoApplication : CommandLineRunner {
|
|
||||||
override fun run(vararg args: String?) {
|
|
||||||
MyLib.doOnMe()
|
|
||||||
|
|
||||||
println()
|
|
||||||
|
|
||||||
println("Hello JJKK: ${MyUtils.helloWorld()}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
|
||||||
runApplication<DemoApplication>(*args)
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package com.example.demo
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest
|
|
||||||
|
|
||||||
@SpringBootTest
|
|
||||||
class DemoApplicationTests {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun contextLoads() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
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
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
37
lib/.gitignore
vendored
37
lib/.gitignore
vendored
@@ -1,37 +0,0 @@
|
|||||||
HELP.md
|
|
||||||
.gradle
|
|
||||||
build/
|
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
|
||||||
!**/src/main/**/build/
|
|
||||||
!**/src/test/**/build/
|
|
||||||
|
|
||||||
### STS ###
|
|
||||||
.apt_generated
|
|
||||||
.classpath
|
|
||||||
.factorypath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.springBeans
|
|
||||||
.sts4-cache
|
|
||||||
bin/
|
|
||||||
!**/src/main/**/bin/
|
|
||||||
!**/src/test/**/bin/
|
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
|
||||||
.idea
|
|
||||||
*.iws
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
out/
|
|
||||||
!**/src/main/**/out/
|
|
||||||
!**/src/test/**/out/
|
|
||||||
|
|
||||||
### NetBeans ###
|
|
||||||
/nbproject/private/
|
|
||||||
/nbbuild/
|
|
||||||
/dist/
|
|
||||||
/nbdist/
|
|
||||||
/.nb-gradle/
|
|
||||||
|
|
||||||
### VS Code ###
|
|
||||||
.vscode/
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("java-library")
|
|
||||||
id("io.spring.dependency-management")
|
|
||||||
kotlin("jvm")
|
|
||||||
kotlin("plugin.spring")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation("org.springframework.boot:spring-boot-starter")
|
|
||||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
|
||||||
}
|
|
||||||
BIN
lib/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
lib/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
5
lib/gradle/wrapper/gradle-wrapper.properties
vendored
5
lib/gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +0,0 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
|
||||||
distributionPath=wrapper/dists
|
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package com.example.lib;
|
|
||||||
|
|
||||||
public final class MyUtils {
|
|
||||||
public static String helloWorld() {
|
|
||||||
return "Hello World";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
package com.example.lib
|
|
||||||
|
|
||||||
object MyLib {
|
|
||||||
fun doOnMe() = print("hello")
|
|
||||||
}
|
|
||||||
@@ -1,3 +1 @@
|
|||||||
rootProject.name = "sample-modules"
|
rootProject.name = "sample-modules"
|
||||||
|
|
||||||
include("demo", "lib")
|
|
||||||
Reference in New Issue
Block a user