From 430c49ce251e6c9c057198d64fe1785a362cb8fe Mon Sep 17 00:00:00 2001 From: zinzoddari Date: Sun, 7 Jan 2024 05:50:53 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20QueryDsl=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index a48692c..0b8dcb9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,10 @@ +import com.ewerk.gradle.plugins.tasks.QuerydslCompile + plugins { java id("org.springframework.boot") version "2.7.8" id("io.spring.dependency-management") version "1.1.4" + id("com.ewerk.gradle.plugins.querydsl") version "1.0.10" } group = "com.example" @@ -46,8 +49,39 @@ dependencies { //test testImplementation("org.springframework.boot:spring-boot-starter-test") + + //querydsl + implementation("com.querydsl:querydsl-jpa") + annotationProcessor("com.querydsl:querydsl-apt:5.0.0:jpa") + annotationProcessor("jakarta.annotation:jakarta.annotation-api") + annotationProcessor("jakarta.persistence:jakarta.persistence-api") } tasks.withType { useJUnitPlatform() } + +val querydslDir = layout.buildDirectory.dir("generated/querydsl").get().asFile + +tasks.withType { + options.generatedSourceOutputDirectory.set(file(querydslDir)) +} + +querydsl { + jpa = true + querydslSourcesDir = querydslDir.name +} + +sourceSets.getByName("main") { + java.srcDir(querydslDir) +} + +configurations { + named("querydsl") { + extendsFrom(configurations.compileClasspath.get()) + } +} + +tasks.withType { + options.annotationProcessorPath = configurations.querydsl.get() +} \ No newline at end of file