plugins { id 'org.springframework.boot' version '2.7.3' id 'io.spring.dependency-management' version '1.0.13.RELEASE' id 'java' id 'jacoco' id 'com.github.node-gradle.node' version '3.5.0' } println "### project.projectDir: ${project.projectDir}" // https://herojoon-dev.tistory.com/25 node { /** * 특정 Node.js 버전을 다운로드 및 설치 할 지 여부 * true: 다운로드 및 설치 * false: 전역으로 설치된 Node.js 사용함. */ //download = true /** * download가 true일 경우에만 사용 * version에 명시한 버전으로 Node.js 다운로드 및 설치 * workDir에 설치됨 */ //version = "14.17.6" /** * 사용할 npm 버전을 지정하면 npmWorkDir에 설치됨 * npm 버전을 지정하지 않으면 Node.js에 번들로 제공되는 npm 버전으로 사용됨 */ //npmVersion = "6.14.15" /** * download가 true일 경우에만 사용 * Node.js 배포를 가져오기 위한 기본 URL */ //distBaseUrl = "https://nodejs.org/dist" npmInstallCommand = "install" workDir = file("${project.projectDir}/.gradle/nodejs") npmWorkDir = file("${project.projectDir}/.gradle/npm") nodeModulesDir = file("${project.projectDir}/src/vite-frontend") nodeProxySettings = ProxySettings.SMART } group = 'com.io' version = '0.0.1-SNAPSHOT' sourceCompatibility = '18' repositories { mavenCentral() //node gradle gradlePluginPortal() } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-test' implementation 'org.projectlombok:lombok:1.18.24' implementation 'io.jsonwebtoken:jjwt-api:0.11.5' implementation 'io.jsonwebtoken:jjwt-impl:0.11.5' implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5' annotationProcessor 'org.projectlombok:lombok' // https://mvnrepository.com/artifact/org.postgresql/postgresql //implementation group: 'org.postgresql', name: 'postgresql', version: '42.5.0' // https://mvnrepository.com/artifact/org.bgee.log4jdbc-log4j2/log4jdbc-log4j2-jdbc4 implementation group: 'org.bgee.log4jdbc-log4j2', name: 'log4jdbc-log4j2-jdbc4', version: '1.16' // inmemory runtimeOnly 'com.h2database:h2' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.boot:spring-boot-starter-jdbc:2.7.3' testImplementation 'org.springframework.security:spring-security-test' } jacoco { toolVersion = "0.8.8" reportsDir = file("$buildDir/customJacocoReportDir") } jacocoTestReport { reports { xml.enabled false csv.enabled false html.destination file("${buildDir}/jacocoHtml") } } test { finalizedBy jacocoTestReport // report is always generated after tests run } jacocoTestReport { dependsOn test // tests are required to run before generating the report } tasks.named('test') { useJUnitPlatform() } apply plugin: 'com.github.node-gradle.node' task deleteVueBuildFiles(type: Delete) { delete "src/main/resources/static/static", "src/main/resources/static/index.html" } task npmBuild(type: NpmTask, dependsOn: ['deleteVueBuildFiles', 'npmInstall']) { args = ["run", "build"] } processResources.dependsOn 'npmBuild'