Skip to content

Commit 6eb6f8b

Browse files
CWMSVue-745: New Location Level View Support (#1686)
Adds support for new location level views added in HydrologicEngineeringCenter/cwms-database#104 Updated JOOQ Codegen to include new views. Updated naming from `Shadow` to `Legacy` and added `Latest` --------- Co-authored-by: Adam Korynta <adam@rmanet.com>
1 parent da610d6 commit 6eb6f8b

5 files changed

Lines changed: 563 additions & 161 deletions

File tree

cwms-data-api/build.gradle

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ configurations {
1717
baseLibs
1818
tomcatLibs
1919
testImplementation.extendsFrom(tomcatLibs)
20-
jooqCodegenShadow
20+
jooqCodegenLatest
21+
jooqCodegenLegacy
2122
}
2223

2324
configurations.implementation {
@@ -52,7 +53,7 @@ dependencies {
5253
//means it is not backwards compatible (the bind indexes get messed up)
5354
//We could also use this mechanism to shade a 'latest' version of the schema codegen
5455
//to allow for work not yet merged into a schema release/rc
55-
jooqCodegenShadow(libs.cwms.db.jooq.codegen.shadow) {
56+
jooqCodegenLatest(libs.cwms.db.jooq.codegen.latest) {
5657
exclude group: "com.oracle", module: "*"
5758
exclude group: "com.oracle.database.jdbc", module: "*"
5859
exclude group: "org.jooq.pro", module: "*"
@@ -62,7 +63,18 @@ dependencies {
6263
exclude group: "org.jooq.pro-java-8", module: "jooq"
6364
exclude group: "org.jooq.pro-java-11", module: "jooq"
6465
}
65-
implementation(files("$buildDir/libs/${project.name}-${project.version}-codegen-shadow.jar"))
66+
jooqCodegenLegacy(libs.cwms.db.jooq.codegen.legacy) {
67+
exclude group: "com.oracle", module: "*"
68+
exclude group: "com.oracle.database.jdbc", module: "*"
69+
exclude group: "org.jooq.pro", module: "*"
70+
exclude group: "org.jooq", module: "jooq"
71+
exclude group: "log4j", module: "log4j"
72+
exclude group: "org.slf4j", module: "slf4j-log4j12"
73+
exclude group: "org.jooq.pro-java-8", module: "jooq"
74+
exclude group: "org.jooq.pro-java-11", module: "jooq"
75+
}
76+
implementation(files("$buildDir/libs/${project.name}-${project.version}-codegen-legacy.jar"))
77+
implementation(files("$buildDir/libs/${project.name}-${project.version}-codegen-latest.jar"))
6678

6779
implementation(libs.slf4j)
6880

@@ -403,12 +415,23 @@ if (JavaVersion.current() >= JavaVersion.VERSION_11) {
403415
}
404416
}
405417

406-
tasks.register('shadeCodegen', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
407-
archiveClassifier.set('codegen-shadow')
408-
configurations = [project.configurations.jooqCodegenShadow]
418+
tasks.register('shadeCodegenLegacy', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
419+
archiveClassifier.set('codegen-legacy')
420+
configurations = [project.configurations.jooqCodegenLegacy]
421+
//See comment above on why shading is needed. Using 'codegen_shadow' as a
422+
//suitably obnoxious package name so that imports don't get confused.
423+
//We can also shade a 'codegen_latest' in the future if needed.
424+
relocate 'usace.cwms.db.jooq.codegen', 'usace.cwms.db.jooq.codegen_legacy'
425+
}
426+
tasks.compileJava.dependsOn(tasks.shadeCodegenLegacy)
427+
428+
tasks.register('shadeCodegenLatest', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
429+
archiveClassifier.set('codegen-latest')
430+
configurations = [project.configurations.jooqCodegenLatest]
409431
//See comment above on why shading is needed. Using 'codegen_shadow' as a
410432
//suitably obnoxious package name so that imports don't get confused.
411433
//We can also shade a 'codegen_latest' in the future if needed.
412-
relocate 'usace.cwms.db.jooq.codegen', 'usace.cwms.db.jooq.codegen_shadow'
434+
relocate 'usace.cwms.db.jooq.codegen', 'usace.cwms.db.jooq.codegen_latest'
413435
}
414-
tasks.compileJava.dependsOn(tasks.shadeCodegen)
436+
tasks.compileJava.dependsOn(tasks.shadeCodegenLegacy)
437+
tasks.compileJava.dependsOn(tasks.shadeCodegenLatest)

0 commit comments

Comments
 (0)