Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions cwms-data-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ configurations {
baseLibs
tomcatLibs
testImplementation.extendsFrom(tomcatLibs)
jooqCodegenShadow
jooqCodegenLatest
jooqCodegenLegacy
}

configurations.implementation {
Expand Down Expand Up @@ -52,7 +53,7 @@ dependencies {
//means it is not backwards compatible (the bind indexes get messed up)
//We could also use this mechanism to shade a 'latest' version of the schema codegen
//to allow for work not yet merged into a schema release/rc
jooqCodegenShadow(libs.cwms.db.jooq.codegen.shadow) {
jooqCodegenLatest(libs.cwms.db.jooq.codegen.latest) {
exclude group: "com.oracle", module: "*"
exclude group: "com.oracle.database.jdbc", module: "*"
exclude group: "org.jooq.pro", module: "*"
Expand All @@ -62,7 +63,18 @@ dependencies {
exclude group: "org.jooq.pro-java-8", module: "jooq"
exclude group: "org.jooq.pro-java-11", module: "jooq"
}
implementation(files("$buildDir/libs/${project.name}-${project.version}-codegen-shadow.jar"))
jooqCodegenLegacy(libs.cwms.db.jooq.codegen.legacy) {
exclude group: "com.oracle", module: "*"
exclude group: "com.oracle.database.jdbc", module: "*"
exclude group: "org.jooq.pro", module: "*"
exclude group: "org.jooq", module: "jooq"
exclude group: "log4j", module: "log4j"
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "org.jooq.pro-java-8", module: "jooq"
exclude group: "org.jooq.pro-java-11", module: "jooq"
}
implementation(files("$buildDir/libs/${project.name}-${project.version}-codegen-legacy.jar"))
implementation(files("$buildDir/libs/${project.name}-${project.version}-codegen-latest.jar"))

implementation(libs.slf4j)

Expand Down Expand Up @@ -403,12 +415,23 @@ if (JavaVersion.current() >= JavaVersion.VERSION_11) {
}
}

tasks.register('shadeCodegen', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveClassifier.set('codegen-shadow')
configurations = [project.configurations.jooqCodegenShadow]
tasks.register('shadeCodegenLegacy', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveClassifier.set('codegen-legacy')
configurations = [project.configurations.jooqCodegenLegacy]
//See comment above on why shading is needed. Using 'codegen_shadow' as a
//suitably obnoxious package name so that imports don't get confused.
//We can also shade a 'codegen_latest' in the future if needed.
relocate 'usace.cwms.db.jooq.codegen', 'usace.cwms.db.jooq.codegen_legacy'
}
tasks.compileJava.dependsOn(tasks.shadeCodegenLegacy)

tasks.register('shadeCodegenLatest', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveClassifier.set('codegen-latest')
configurations = [project.configurations.jooqCodegenLatest]
//See comment above on why shading is needed. Using 'codegen_shadow' as a
//suitably obnoxious package name so that imports don't get confused.
//We can also shade a 'codegen_latest' in the future if needed.
relocate 'usace.cwms.db.jooq.codegen', 'usace.cwms.db.jooq.codegen_shadow'
relocate 'usace.cwms.db.jooq.codegen', 'usace.cwms.db.jooq.codegen_latest'
}
tasks.compileJava.dependsOn(tasks.shadeCodegen)
tasks.compileJava.dependsOn(tasks.shadeCodegenLegacy)
tasks.compileJava.dependsOn(tasks.shadeCodegenLatest)
Loading
Loading