plugins {
	id 'org.springframework.boot' version '2.5.6'
	id 'io.spring.dependency-management' version '1.0.11.RELEASE'
//	id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
	id "com.github.node-gradle.node" version "3.1.0"
	id 'java'

}


jar {
	enabled = false
}

group = 'myblog'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
	gradlePluginPortal()
}

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	implementation 'org.springframework.boot:spring-boot-starter-security'
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
	implementation 'org.springframework.boot:spring-boot-starter-validation'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	implementation 'org.springframework.boot:spring-boot-starter-cache'
	implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
	implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
	implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
	implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.7.1'
	implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.0'
//	implementation 'com.querydsl:querydsl-jpa'
	implementation 'com.github.node-gradle:gradle-node-plugin:3.1.0'
	implementation group: 'org.modelmapper', name: 'modelmapper', version: '2.4.4'
	implementation group: 'org.kohsuke', name: 'github-api', version: '1.133'
	implementation group: 'org.apache.commons', name: 'commons-text', version: '1.9'
	implementation group: 'com.atlassian.commonmark', name: 'commonmark', version: '0.17.0'
	implementation group: 'org.jsoup', name: 'jsoup', version: '1.14.3'
	implementation 'org.commonmark:commonmark-ext-gfm-tables:0.18.0'
	implementation group: 'org.jdom', name: 'jdom2', version: '2.0.6'
	implementation group: 'net.sf.ehcache', name: 'ehcache', version: '2.10.9.2'



	compileOnly 'org.projectlombok:lombok'
	developmentOnly 'org.springframework.boot:spring-boot-devtools'
	runtimeOnly 'mysql:mysql-connector-java'
	annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
	annotationProcessor 'org.projectlombok:lombok'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
	testImplementation 'org.springframework.security:spring-security-test'
	testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:2.2.0'
}

test {
	useJUnitPlatform()
}

// 쿼리DSL 설정
//def querydslDir = "$buildDir/generated/querydsl"
//
//querydsl {
//	jpa = true
//	querydslSourcesDir = querydslDir
//}
//sourceSets {
//	main.java.srcDir querydslDir
//}
//configurations {
//	querydsl.extendsFrom compileClasspath
//}
//compileQuerydsl {
//	options.annotationProcessorPath = configurations.querydsl
//}


// NPM 설정

node {
	version = '16.3.0'
	download = true
	nodeModulesDir = file("${projectDir}/src/main/resources/static")

}
task copyFrontLib(type: Copy) {
	from "${projectDir}/src/main/resources/static"
	into "${projectDir}/build/resources/main/static/."
}
copyFrontLib.dependsOn npmInstall
compileJava.dependsOn copyFrontLib

