plugins {
	id 'java'
	id 'org.springframework.boot' version '3.4.3'
	id 'io.spring.dependency-management' version '1.1.7'
}

group = 'com.bsmlab.dfx'
version = '1.0.9'

tasks.processResources {
    filteringCharset = 'UTF-8'
    filesMatching('**/application.yml') {
        def commitId = providers.exec {
            commandLine 'git', 'rev-parse', '--short', 'HEAD'
        }.standardOutput.asText.get()
        expand([
                commitId: commitId,
                version : project.version,
                user    : [home: System.getProperty('user.home')]
        ])
    }
}

java {
	toolchain {
		languageVersion = JavaLanguageVersion.of(17)
	}
}

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

bootRun {
    // 실행시 jvm에 -D 옵션을 적용하기 위하여 설정
    systemProperties System.properties
}

repositories {
	mavenCentral()
	maven {
		url = 'https://maven.cubrid.org'
	}
}
dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-jdbc'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	implementation 'org.springframework.boot:spring-boot-starter-actuator'
	implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.4'
	compileOnly 'org.projectlombok:lombok'
	implementation 'com.h2database:h2'
	runtimeOnly 'com.h2database:h2'
	implementation 'com.microsoft.sqlserver:mssql-jdbc'
	implementation 'com.mysql:mysql-connector-j'
	implementation 'com.oracle.database.jdbc:ojdbc11'
	implementation 'com.oracle.ojdbc:orai18n:19.3.0.0'
	implementation 'org.mariadb.jdbc:mariadb-java-client'
	implementation 'cubrid:cubrid-jdbc:11.2.1.0040'
	implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16'
	annotationProcessor 'org.projectlombok:lombok'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
	testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:3.0.4'
	testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
	implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0'
	implementation group: 'org.apache.commons', name: 'commons-dbcp2', version: '2.12.0'
	implementation group: 'org.postgresql', name: 'postgresql', version: '42.7.4'
	implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '3.5.2'
	implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '12.8.1.jre8'
	implementation group: 'com.ibm.db2', name: 'jcc', version: '12.1.0.0'
	developmentOnly 'org.springframework.boot:spring-boot-devtools'

}

tasks.named('test') {
	useJUnitPlatform()
}
