Skip to content

Commit

Permalink
prep work for upgrading to gradle 8 (#5298)
Browse files Browse the repository at this point in the history
  • Loading branch information
colesnodgrass committed Mar 20, 2023
1 parent 127f1a0 commit 20f78f7
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 134 deletions.
21 changes: 9 additions & 12 deletions airbyte-bootloader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ plugins {
id 'application'
}

configurations.all {
resolutionStrategy {
force libs.flyway.core, libs.jooq
}
}

dependencies {
annotationProcessor platform(libs.micronaut.bom)
annotationProcessor libs.bundles.micronaut.annotation.processor

implementation platform(libs.micronaut.bom)
implementation libs.bundles.micronaut

// Ensure that the versions defined in deps.toml are used
// instead of versions from transitive dependencies
implementation (libs.flyway.core) {
force = true
}
implementation (libs.jooq) {
force = true
}
implementation libs.flyway.core
implementation libs.jooq

implementation project(':airbyte-commons')
implementation project(':airbyte-config:init')
Expand All @@ -36,11 +35,9 @@ dependencies {
testImplementation libs.platform.testcontainers.postgresql
}

mainClassName = 'io.airbyte.bootloader.Application'

application {
applicationName = project.name
mainClass = mainClassName
mainClass = 'io.airbyte.bootloader.Application'
applicationDefaultJvmArgs = ['-XX:+ExitOnOutOfMemoryError', '-XX:MaxRAMPercentage=75.0']
}

Expand Down
25 changes: 10 additions & 15 deletions airbyte-commons-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ plugins {
id "java-library"
}

configurations.all {
resolutionStrategy {
// Ensure that the versions defined in deps.toml are used
// instead of versions from transitive dependencies
force libs.flyway.core, libs.s3, libs.aws.java.sdk.s3
}
}
dependencies {
annotationProcessor platform(libs.micronaut.bom)
annotationProcessor libs.bundles.micronaut.annotation.processor
Expand All @@ -12,22 +19,10 @@ dependencies {
implementation libs.micronaut.inject
implementation libs.micronaut.jaxrs.server

// Ensure that the versions defined in deps.toml are used
// instead of versions from transitive dependencies
implementation(libs.flyway.core) {
force = true
}
implementation(libs.s3) {
// Force to avoid updated version brought in transitively from Micronaut 3.8+
// that is incompatible with our current Helm setup
force = true
}
implementation(libs.aws.java.sdk.s3) {
// Force to avoid updated version brought in transitively from Micronaut 3.8+
// that is incompatible with our current Helm setup
force = true
}

implementation libs.flyway.core
implementation libs.s3
implementation libs.aws.java.sdk.s3
implementation project(':airbyte-analytics')
implementation project(':airbyte-api')
implementation project(':airbyte-commons')
Expand Down
10 changes: 6 additions & 4 deletions airbyte-commons-worker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ plugins {
id "java-library"
}

configurations.all {
resolutionStrategy {
force libs.platform.testcontainers.postgresql
}
}
dependencies {
annotationProcessor platform(libs.micronaut.bom)
annotationProcessor libs.bundles.micronaut.annotation.processor
Expand Down Expand Up @@ -41,10 +46,7 @@ dependencies {
testImplementation libs.json.path
testImplementation libs.mockito.inline
testImplementation libs.postgresql
testImplementation(libs.platform.testcontainers.postgresql) {
// Force to avoid updated version brought in transitively from Micronaut
force = true
}
testImplementation libs.platform.testcontainers.postgresql
testImplementation libs.jmh.core
testImplementation libs.jmh.annotations
testImplementation libs.docker.java
Expand Down
6 changes: 2 additions & 4 deletions airbyte-connector-atelier-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ dependencies {
implementation group: 'io.swagger', name: 'swagger-annotations', version: '1.6.2'
}

mainClassName = 'io.airbyte.connector_builder.MicronautConnectorBuilderServerRunner'

application {
mainClass = mainClassName
mainClass = 'io.airbyte.connector_builder.MicronautConnectorBuilderServerRunner'
applicationDefaultJvmArgs = ['-XX:+ExitOnOutOfMemoryError', '-XX:MaxRAMPercentage=75.0']
}

Expand Down Expand Up @@ -85,4 +83,4 @@ sourceSets {
tasks.named("buildDockerImage") {
dependsOn generateOpenApiServer
dependsOn copyGeneratedTar
}
}
25 changes: 11 additions & 14 deletions airbyte-container-orchestrator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,23 @@ configurations {
airbyteProtocol
}

configurations.all {
resolutionStrategy {
// Ensure that the versions defined in deps.toml are used
// instead of versions from transitive dependencies
// Force to avoid updated version brought in transitively from Micronaut 3.8+
// that is incompatible with our current Helm setup
force libs.s3, libs.aws.java.sdk.s3
}
}
dependencies {
annotationProcessor platform(libs.micronaut.bom)
annotationProcessor libs.bundles.micronaut.annotation.processor

implementation platform(libs.micronaut.bom)
implementation libs.bundles.micronaut

// Ensure that the versions defined in deps.toml are used
// instead of versions from transitive dependencies
implementation(libs.s3) {
// Force to avoid updated version brought in transitively from Micronaut 3.8+
// that is incompatible with our current Helm setup
force = true
}
implementation(libs.aws.java.sdk.s3) {
// Force to avoid updated version brought in transitively from Micronaut 3.8+
// that is incompatible wit hour current Helm setup
force = true
}

implementation libs.s3
implementation libs.aws.java.sdk.s3
implementation libs.kubernetes.client
implementation libs.bundles.datadog

Expand Down
4 changes: 1 addition & 3 deletions airbyte-cron/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ dependencies {
implementation libs.bundles.micronaut
}

mainClassName = 'io.airbyte.cron.MicronautCronRunner'

application {
mainClass = mainClassName
mainClass = 'io.airbyte.cron.MicronautCronRunner'
applicationDefaultJvmArgs = ['-XX:+ExitOnOutOfMemoryError', '-XX:MaxRAMPercentage=75.0']
}

Expand Down
18 changes: 6 additions & 12 deletions airbyte-db/db-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ configurations {

configurations.all {
exclude group: 'io.micronaut.flyway'
resolutionStrategy {
force libs.platform.testcontainers.postgresql
}
}

dependencies {
Expand All @@ -23,17 +26,11 @@ dependencies {
implementation project(':airbyte-config:config-models')
implementation libs.flyway.core

migrations (libs.platform.testcontainers.postgresql) {
// Force to avoid updated version brought in transitively from Micronaut
force = true
}
migrations libs.platform.testcontainers.postgresql
migrations sourceSets.main.output

// Mark as compile only to avoid leaking transitively to connectors
compileOnly (libs.platform.testcontainers.postgresql) {
// Force to avoid updated version brought in transitively from Micronaut
force = true
}
compileOnly libs.platform.testcontainers.postgresql

// These are required because gradle might be using lower version of Jna from other
// library transitive dependency. Can be removed if we can figure out which library is the cause.
Expand All @@ -43,10 +40,7 @@ dependencies {

testImplementation project(':airbyte-test-utils')
testImplementation libs.apache.commons.lang
testImplementation (libs.platform.testcontainers.postgresql) {
// Force to avoid updated version brought in transitively from Micronaut
force = true
}
testImplementation libs.platform.testcontainers.postgresql
}

task(newConfigsMigration, dependsOn: 'classes', type: JavaExec) {
Expand Down
22 changes: 11 additions & 11 deletions airbyte-db/jooq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ plugins {
alias(libs.plugins.nu.studer.jooq)
}

configurations.all {
resolutionStrategy {
force libs.platform.testcontainers.postgresql
}
}
dependencies {
implementation libs.jooq.meta
implementation libs.jooq
Expand All @@ -12,10 +17,8 @@ dependencies {

// jOOQ code generation
implementation libs.jooq.codegen
implementation (libs.platform.testcontainers.postgresql) {
// Force to avoid updated version brought in transitively from Micronaut
force = true
}
implementation libs.platform.testcontainers.postgresql

// These are required because gradle might be using lower version of Jna from other
// library transitive dependency. Can be removed if we can figure out which library is the cause.
// Refer: https://github.com/testcontainers/testcontainers-java/issues/3834#issuecomment-825409079
Expand All @@ -24,10 +27,7 @@ dependencies {

// The jOOQ code generator only has access to classes added to the jooqGenerator configuration
jooqGenerator project(':airbyte-db:db-lib')
jooqGenerator(libs.platform.testcontainers.postgresql) {
// Force to avoid updated version brought in transitively from Micronaut
force = true
}
jooqGenerator libs.platform.testcontainers.postgresql
}

jooq {
Expand Down Expand Up @@ -73,9 +73,9 @@ jooq {
}
}

sourceSets.main.java.srcDirs (
tasks.named('generateConfigsDatabaseJooq').flatMap { it.outputDir },
tasks.named('generateJobsDatabaseJooq').flatMap { it.outputDir }
sourceSets.main.java.srcDirs(
tasks.named('generateConfigsDatabaseJooq').flatMap { it.outputDir },
tasks.named('generateJobsDatabaseJooq').flatMap { it.outputDir }
)

sourceSets {
Expand Down
11 changes: 7 additions & 4 deletions airbyte-metrics/reporter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ configurations {
jdbc
}

configurations.all {
resolutionStrategy {
force libs.jooq
}
}

dependencies {
annotationProcessor platform(libs.micronaut.bom)
annotationProcessor libs.bundles.micronaut.annotation.processor
Expand All @@ -17,10 +23,7 @@ dependencies {
implementation project(':airbyte-db:jooq')
implementation project(':airbyte-db:db-lib')
implementation project(':airbyte-metrics:metrics-lib')

implementation(libs.jooq) {
force = true
}
implementation libs.jooq

testAnnotationProcessor platform(libs.micronaut.bom)
testAnnotationProcessor libs.bundles.micronaut.test.annotation.processor
Expand Down
11 changes: 7 additions & 4 deletions airbyte-persistence/job-persistence/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ plugins {
id "java-library"
}

configurations.all {
resolutionStrategy {
force libs.platform.testcontainers.postgresql
}
}

dependencies {
implementation project(':airbyte-commons')
implementation project(':airbyte-commons-protocol')
Expand Down Expand Up @@ -29,10 +35,7 @@ dependencies {

testImplementation project(':airbyte-config:config-persistence')
testImplementation project(':airbyte-test-utils')
testImplementation(libs.platform.testcontainers.postgresql) {
// Force to avoid updated version brought in transitively from Micronaut
force = true
}
testImplementation libs.platform.testcontainers.postgresql
}

Task publishArtifactsTask = getPublishArtifactsTask("$rootProject.ext.version", project)
32 changes: 13 additions & 19 deletions airbyte-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ plugins {
id 'application'
}

configurations.all {
resolutionStrategy {
// Ensure that the versions defined in deps.toml are used
// instead of versions from transitive dependencies
// Force to avoid updated version brought in transitively from Micronaut 3.8+
// that is incompatible with our current Helm setup
force libs.flyway.core, libs.s3, libs.aws.java.sdk.s3
}
}
dependencies {
annotationProcessor platform(libs.micronaut.bom)
annotationProcessor libs.bundles.micronaut.annotation.processor
Expand All @@ -10,22 +19,9 @@ dependencies {
implementation platform(libs.micronaut.bom)
implementation libs.bundles.micronaut
implementation libs.micronaut.jaxrs.server

// Ensure that the versions defined in deps.toml are used
// instead of versions from transitive dependencies
implementation(libs.flyway.core) {
force = true
}
implementation(libs.s3) {
// Force to avoid updated version brought in transitively from Micronaut 3.8+
// that is incompatible with our current Helm setup
force = true
}
implementation(libs.aws.java.sdk.s3) {
// Force to avoid updated version brought in transitively from Micronaut 3.8+
// that is incompatible with our current Helm setup
force = true
}
implementation libs.flyway.core
implementation libs.s3
implementation libs.aws.java.sdk.s3

implementation project(':airbyte-analytics')
implementation project(':airbyte-api')
Expand Down Expand Up @@ -77,11 +73,9 @@ task copySeed(type: Copy, dependsOn: [project(':airbyte-config:init').processRes
test.dependsOn(project.tasks.copySeed)
assemble.dependsOn(project.tasks.copySeed)

mainClassName = 'io.airbyte.server.Application'

application {
applicationName = project.name
mainClass = mainClassName
mainClass = 'io.airbyte.server.Application'
applicationDefaultJvmArgs = ['-XX:+ExitOnOutOfMemoryError', '-XX:MaxRAMPercentage=75.0']
}

Expand Down
Loading

0 comments on commit 20f78f7

Please sign in to comment.