Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Jun 27, 2024
0 parents commit 07eb0d7
Show file tree
Hide file tree
Showing 44 changed files with 1,638 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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/

### Kotlin ###
.kotlin
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# hero-alignlab-api

> 자세공작소
129 changes: 129 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
extra.apply {
}
}

plugins {
val kotlinVersion = "1.9.24"

id("org.springframework.boot") version "3.3.1"
id("io.spring.dependency-management") version "1.1.5"
kotlin("jvm") version kotlinVersion
kotlin("plugin.spring") version kotlinVersion
kotlin("plugin.jpa") version kotlinVersion
kotlin("plugin.allopen") version kotlinVersion
kotlin("kapt") version kotlinVersion

idea
}

group = "com.hero"

java {
sourceCompatibility = JavaVersion.VERSION_17
}

repositories {
mavenCentral()
}

idea {
module {
val kaptMain = file("build/generated/source/kapt/main")
sourceDirs.add(kaptMain)
generatedSourceDirs.add(kaptMain)
}
}

/**
* https://kotlinlang.org/docs/reference/compiler-plugins.html#spring-support
* automatically supported annotation
* @Component, @Async, @Transactional, @Cacheable, @SpringBootTest,
* @Configuration, @Controller, @RestController, @Service, @Repository.
* jpa meta-annotations not automatically opened through the default settings of the plugin.spring
*/
allOpen {
annotation("jakarta.persistence.Entity")
annotation("jakarta.persistence.MappedSuperclass")
annotation("jakarta.persistence.Embeddable")
}

dependencies {
/** spring starter */
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-data-redis-reactive")
kapt("org.springframework.boot:spring-boot-configuration-processor")

/** kotlin */
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")

/** arrow-kt */
implementation("io.arrow-kt:arrow-core:${DependencyVersion.ARROW_FX}")
implementation("io.arrow-kt:arrow-fx-coroutines:${DependencyVersion.ARROW_FX}")
implementation("io.arrow-kt:arrow-fx-stm:${DependencyVersion.ARROW_FX}")

/** swagger */
implementation("org.springdoc:springdoc-openapi-starter-webflux-ui:${DependencyVersion.SPRINGDOC}")
runtimeOnly("com.github.therapi:therapi-runtime-javadoc-scribe:${DependencyVersion.JAVADOC_SCRIBE}")
kapt("com.github.therapi:therapi-runtime-javadoc-scribe:${DependencyVersion.JAVADOC_SCRIBE}")

/** logger */
implementation("io.github.oshai:kotlin-logging-jvm:${DependencyVersion.KOTLIN_LOGGING}")
implementation("net.logstash.logback:logstash-logback-encoder:${DependencyVersion.LOGBACK_ENCODER}")

/** database */
runtimeOnly("com.mysql:mysql-connector-j")

/** test */
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.testcontainers:mysql:${DependencyVersion.TEST_CONTAINER_MYSQL}")
testImplementation("com.github.gavlyukovskiy:p6spy-spring-boot-starter:${DependencyVersion.P6SPY_LOG}")
testImplementation("ch.qos.logback:logback-classic:${DependencyVersion.LOGBACK_CLASSIC}")
testImplementation("io.mockk:mockk:${DependencyVersion.MOCKK}")

/** kotest */
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test")
testImplementation("io.kotest:kotest-runner-junit5:${DependencyVersion.KOTEST}")
testImplementation("io.kotest:kotest-assertions-core:${DependencyVersion.KOTEST}")
testImplementation("io.kotest:kotest-property:${DependencyVersion.KOTEST}")
testImplementation("io.kotest:kotest-framework-datatest-jvm:${DependencyVersion.KOTEST}")
testImplementation("io.kotest.extensions:kotest-extensions-spring:${DependencyVersion.KOTEST_EXTENSION}")
}

defaultTasks("bootRun")

springBoot.buildInfo { properties { } }

configurations.all {
resolutionStrategy.cacheChangingModulesFor(0, "seconds")
}

tasks.getByName<Jar>("jar") {
enabled = false
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}

tasks.withType<Wrapper> {
gradleVersion = "8.7"
}

tasks.withType<Test> {
useJUnitPlatform()
}
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}
20 changes: 20 additions & 0 deletions buildSrc/src/main/kotlin/DependencyVersion.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
object DependencyVersion {
/** external */
const val ARROW_FX = "1.2.4"
const val KOTLIN_LOGGING = "6.0.9"
const val LOGBACK_ENCODER = "7.4"

/** springdoc */
const val SPRINGDOC = "2.3.0"
const val JAVADOC_SCRIBE = "0.15.0"

/** test */
const val TEST_CONTAINER_MYSQL = "1.24.0"
const val P6SPY_LOG = "1.9.1"
const val LOGBACK_CLASSIC = "1.5.6"
const val MOCKK = "1.13.11"

/** kotest */
const val KOTEST = "5.9.0"
const val KOTEST_EXTENSION = "1.1.3"
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version = "0.0.1-SNAPSHOT"
kotlin.code.style=official
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 07eb0d7

Please sign in to comment.