-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from bee-produced/9-result-type-data-fetchers
Result Data Fetchers
- Loading branch information
Showing
42 changed files
with
1,317 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
import com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask | ||
|
||
plugins { | ||
alias(libs.plugins.kotlin.jvm) | ||
alias(libs.plugins.kotlin.spring) | ||
alias(libs.plugins.kotlin.serialization) | ||
alias(libs.plugins.spring.boot) | ||
alias(libs.plugins.spring.dependencymanagement) | ||
alias(libs.plugins.kotlin.jpa) | ||
// ksp plugin must be placed before kapt | ||
// https://github.com/google/ksp/issues/1445#issuecomment-1763422067 | ||
alias(libs.plugins.ksp) | ||
alias(libs.plugins.kotlin.kapt) | ||
alias(libs.plugins.dgs.codegen) | ||
alias(libs.plugins.kotlin.allopen) | ||
alias(libs.plugins.kotlin.noarg) | ||
java | ||
id("bee.generative") | ||
} | ||
|
||
allprojects { | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
kotlinOptions { | ||
freeCompilerArgs = listOf("-Xjsr305=strict") | ||
jvmTarget = "17" | ||
} | ||
} | ||
|
||
tasks.register<Task>(name = "resolveDependencies") { | ||
group = "Build Setup" | ||
description = "Resolve and prefetch dependencies" | ||
doLast { | ||
rootProject.allprojects.forEach { | ||
it.buildscript.configurations.filter(Configuration::isCanBeResolved).forEach { it.resolve() } | ||
it.configurations.filter(Configuration::isCanBeResolved).forEach { it.resolve() } | ||
} | ||
} | ||
} | ||
} | ||
|
||
group = "com.beeproduced" | ||
version = libs.versions.bee.built.get() | ||
java.sourceCompatibility = JavaVersion.VERSION_17 | ||
java.targetCompatibility = JavaVersion.VERSION_17 | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom(configurations.annotationProcessor.get()) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
// in-house libraries | ||
implementation("com.beeproduced:bee.functional") | ||
implementation("com.beeproduced:bee.functional") { | ||
capabilities { requireCapability("com.beeproduced:bee.functional-dgs") } | ||
} | ||
|
||
// external dependencies | ||
implementation(libs.kotlin.stdlib) | ||
implementation(libs.spring.boot.starter.web) | ||
implementation(libs.spring.boot.starter.data.jpa) | ||
implementation(libs.spring.boot.starter.websocket) | ||
implementation(libs.spring.boot.starter.validation) | ||
implementation(libs.spring.boot.starter.cache) | ||
implementation(libs.spring.boot.starter.actuator) | ||
implementation(libs.spring.boot.starter.aop) | ||
implementation(libs.spring.boot.starter.security) | ||
implementation(libs.spring.boot.starter.oauth2.resource.server) | ||
implementation(libs.spring.boot.starter.oauth2.client) | ||
implementation(libs.spring.security.config) | ||
implementation(libs.spring.security.messaging) | ||
implementation(libs.spring.security.web) | ||
implementation(libs.jackson.module.kotlin) | ||
implementation(platform(libs.dgs.platform)) | ||
implementation(libs.dgs.spring.starter) | ||
implementation(libs.dgs.pagination) | ||
implementation(libs.dgs.subscription.websockets) | ||
implementation(libs.dgs.extended.scalars) | ||
implementation(libs.konform) | ||
implementation(libs.mapstruct) | ||
implementation(libs.datafaker) | ||
implementation("org.apache.tika:tika-core:2.4.1") | ||
kapt(libs.mapstruct.processor) | ||
testImplementation(libs.spring.boot.starter.test) | ||
testImplementation(libs.spring.boot.starter.data.jpa) | ||
testImplementation(libs.spring.security.test) | ||
testImplementation(libs.junit.api) | ||
testImplementation(libs.kotlin.test) | ||
testRuntimeOnly(libs.junit.engine) | ||
implementation(libs.h2) | ||
testImplementation(libs.springmockk) | ||
|
||
if (System.getProperty("os.arch") == "aarch64" && System.getProperty("os.name") == "Mac OS X") { | ||
runtimeOnly("io.netty:netty-resolver-dns-native-macos:4.1.76.Final:osx-aarch_64") | ||
} | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} | ||
|
||
|
||
// DGS Codegen | ||
// See: https://stackoverflow.com/a/70954759/12347616 | ||
tasks.withType<GenerateJavaTask> { | ||
notCompatibleWithConfigurationCache("Remove later") | ||
packageName = "com.beeproduced.bee.functional.graphql" | ||
subPackageNameTypes = "dto" | ||
generateCustomAnnotations = true | ||
generateClient = true | ||
typeMapping = mutableMapOf( | ||
"DateTime" to "java.time.Instant", | ||
"Upload" to "org.springframework.web.multipart.MultipartFile" | ||
) | ||
} | ||
|
||
kapt { | ||
// Fix error: incompatible types: NonExistentClass cannot be converted to Annotation | ||
// @error.NonExistentClass | ||
// https://stackoverflow.com/a/55646891/12347616 | ||
correctErrorTypes = true | ||
arguments { | ||
// Set Mapstruct Configuration options here | ||
// https://kotlinlang.org/docs/reference/kapt.html#annotation-processor-arguments | ||
// https://mapstruct.org/documentation/stable/reference/html/#configuration-options | ||
arg("mapstruct.defaultComponentModel", "spring") | ||
} | ||
} | ||
|
||
tasks.getByName<Jar>("jar") { | ||
enabled = false | ||
} | ||
|
||
|
||
tasks.bootRun { | ||
jvmArgs = listOf("-Dspring.output.ansi.enabled=ALWAYS") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
kotlin.code.style=official | ||
org.gradle.console=rich | ||
# See: https://docs.gradle.org/current/userguide/performance.html | ||
org.gradle.parallel=true | ||
# https://proandroiddev.com/how-we-reduced-our-gradle-build-times-by-over-80-51f2b6d6b05b | ||
org.gradle.vfs.watch=true | ||
org.gradle.caching=true | ||
# org.gradle.unsafe.configuration-cache=true | ||
org.gradle.jvmargs=-Xmx3g |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.