plugins {
    id 'java'
}

group = 'com.tsi'
version = '0.0.1'

repositories {
    mavenCentral()
}

dependencies {
    // lombok 라이브러리 추가 시작
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
    implementation 'org.springframework.boot:spring-boot-starter-web'

    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testCompileOnly 'org.projectlombok:lombok'
    testAnnotationProcessor 'org.projectlombok:lombok'
    // lombok 라이브러리 추가 끝

    implementation 'org.springframework.boot:spring-boot-starter-aop'

    testImplementation platform('org.junit:junit-bom:5.10.0')
    testImplementation 'org.junit.jupiter:junit-jupiter'
}

processResources {
    enabled = false
}

bootJar {
    enabled = false
}

jar {
    enabled = true
}

test {
    useJUnitPlatform()
}

tasks.register('runInstallJarLibrary', Exec) {
    doFirst {
        println "tsi-common library install mvn repository..."
        def os = org.gradle.internal.os.OperatingSystem.current()
        workingDir = file('.')
        if (os.isWindows()) {
            commandLine 'cmd', '/C', 'start', 'install.bat'
        } else {
            commandLine 'sh', './install.sh'
        }
    }
}
jar.finalizedBy runInstallJarLibrary

compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile).configureEach {
    options.compilerArgs << '-Xlint:unchecked'
    options.deprecation = true
    options.encoding = 'UTF-8'
}
