-
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 #4 from bee-produced/3-automatic-creation-of-neste…
…d-data-fetchers Automatic creation of nested data fetchers
- Loading branch information
Showing
61 changed files
with
4,057 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
import com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask | ||
|
||
/* | ||
The Library Loader plugin currently has an IDEA bug that causes it to not recognize the "libs" variable. | ||
Until https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed the suppress annotation is required. | ||
*/ | ||
@Suppress("DSL_SCOPE_VIOLATION") | ||
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) | ||
alias(libs.plugins.kotlin.kapt) | ||
alias(libs.plugins.dgs.codegen) | ||
alias(libs.plugins.kotlin.allopen) | ||
alias(libs.plugins.kotlin.noarg) | ||
java | ||
alias(libs.plugins.ksp) | ||
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:events") | ||
implementation("com.beeproduced:events") { | ||
capabilities { requireCapability("com.beeproduced:events-simple") } | ||
} | ||
implementation("com.beeproduced:result") { | ||
capabilities { requireCapability("com.beeproduced:result-dgs") } | ||
} | ||
implementation("com.beeproduced:data") | ||
implementation("com.beeproduced:data") { | ||
capabilities { requireCapability("com.beeproduced:data-dgs") } | ||
} | ||
beeGenerative("com.beeproduced:bee.fetched") | ||
// 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.fetched.graphql" | ||
subPackageNameTypes = "dto" | ||
generateCustomAnnotations = true | ||
generateClient = true | ||
typeMapping = mutableMapOf( | ||
"DateTime" to "java.time.Instant", | ||
"Upload" to "org.springframework.web.multipart.MultipartFile" | ||
) | ||
} | ||
|
||
beeGenerative { | ||
arg("fetchedScanPackage", "com.beeproduced.bee.fetched.graphql.dto") | ||
arg("fetchedPackageName", "com.beeproduced.bee.fetched.graphql.fetcher") | ||
} | ||
|
||
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,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.