From d93d6eeaec0a0c2361f0d4692bf87d313a636756 Mon Sep 17 00:00:00 2001 From: DoooongDong Date: Fri, 3 Mar 2023 12:59:38 +0900 Subject: [PATCH] =?UTF-8?q?feature:=20[#109]=20querydsl=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/.gitignore | 3 +++ be/build.gradle | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/be/.gitignore b/be/.gitignore index cb3ddb28..3e81b7c9 100644 --- a/be/.gitignore +++ b/be/.gitignore @@ -5,6 +5,9 @@ build/ !**/src/main/**/build/ !**/src/test/**/build/ +### Querydsl +src/main/generated + ### STS ### .apt_generated .classpath diff --git a/be/build.gradle b/be/build.gradle index 2eb09182..839700dd 100644 --- a/be/build.gradle +++ b/be/build.gradle @@ -70,6 +70,14 @@ dependencies { implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.2' implementation 'com.amazonaws:aws-java-sdk-s3' testImplementation 'io.findify:s3mock_2.13:0.2.6' + + // Querydsl + implementation "com.querydsl:querydsl-jpa" + implementation "com.querydsl:querydsl-core" + implementation "com.querydsl:querydsl-collections" + annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa" // querydsl JPAAnnotationProcessor 사용 지정 + annotationProcessor "jakarta.annotation:jakarta.annotation-api" // java.lang.NoClassDefFoundError (javax.annotation.Generated) 대응 코드 + annotationProcessor "jakarta.persistence:jakarta.persistence-api" // java.lang.NoClassDefFoundError (javax.annotation.Entity) 대응 코드 } tasks.named('test') { @@ -85,4 +93,20 @@ task copyGitSubmodule(type: Copy) { include 'db/**' } +// Querydsl 설정부 +def generated = 'src/main/generated' + +// querydsl QClass 파일 생성 위치를 지정 +tasks.withType(JavaCompile) { + options.getGeneratedSourceOutputDirectory().set(file(generated)) +} + +// java source set 에 querydsl QClass 위치 추가 +sourceSets { + main.java.srcDirs += [ generated ] +} +// gradle clean 시에 QClass 디렉토리 삭제 +clean { + delete file(generated) +} \ No newline at end of file