From c7f5bac0f8557622a245958d705c4616d6f80fa4 Mon Sep 17 00:00:00 2001 From: OziinG Date: Fri, 1 Nov 2024 10:32:20 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20gradle=20QueryDSL=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20(#59)=20(KAN-110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++++- build.gradle | 28 +++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a523439d..ff78faa4 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,7 @@ Temporary Items ### macOS Patch ### # iCloud generated files -*.icloud \ No newline at end of file +*.icloud + +### QueryDSL ### +/src/*/generated/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index d383bf27..fab79702 100644 --- a/build.gradle +++ b/build.gradle @@ -51,12 +51,19 @@ dependencies { implementation 'com.google.oauth-client:google-oauth-client-jetty:1.34.1' implementation 'com.google.apis:google-api-services-gmail:v1-rev20220404-2.0.0' implementation 'javax.mail:mail:1.4.7' + + // QueryDSL + def querydslVersion = "5.0.0" + implementation "com.querydsl:querydsl-jpa:${querydslVersion}:jakarta" + annotationProcessor "com.querydsl:querydsl-apt:${querydslVersion}:jakarta" + annotationProcessor "jakarta.annotation:jakarta.annotation-api" + annotationProcessor "jakarta.persistence:jakarta.persistence-api" } spotless { java { target('**/*.java') - targetExclude('modules/*/generated/**/*.*') + targetExclude('src/*/generated/**/*.*') importOrder() removeUnusedImports() googleJavaFormat().aosp().formatJavadoc(false) @@ -65,6 +72,25 @@ spotless { } } +def generated = file("src/main/generated") + +clean { + delete generated +} + +tasks.withType(JavaCompile) { + options.generatedSourceOutputDirectory = file(generated) +} + +// Add generated sources to the main source set +sourceSets { + main { + java { + srcDir generated + } + } +} + tasks.named('test') { useJUnitPlatform() }