| import java.nio.file.Paths |
| |
| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| |
| plugins { |
| id('java-library') |
| id('maven-publish') |
| } |
| |
| if (propertyWithDefault("artifactType", null) == "spark") |
| { |
| apply from: "$rootDir/gradle/common/publishing.gradle" |
| } |
| |
| configurations { |
| all*.exclude(group: 'org.slf4j', module: 'slf4j-log4j12') |
| all*.exclude(group: 'log4j', module: 'log4j') |
| } |
| |
| configurations { |
| fourzero { |
| description = 'Cassandra 4.0 dependency' |
| } |
| fourzeroBridge { |
| description = 'Bridge to Cassandra 4.0' |
| } |
| fourzeroTypes { |
| description = 'Cassandra 4.0 Data Types' |
| } |
| fourzeroAvroConverter { |
| description = 'Avro converter for Cassandra 4.0 Data Types' |
| } |
| |
| fivezero { |
| description = 'Cassandra 5.0 dependency' |
| } |
| fivezeroBridge { |
| description = 'Bridge to Cassandra 5.0' |
| } |
| fivezeroTypes { |
| description = 'Cassandra 5.0 Data Types' |
| } |
| fivezeroAvroConverter { |
| description = 'Avro converter for Cassandra 5.0 Data Types' |
| } |
| } |
| |
| dependencies { |
| api(project(':cassandra-bridge')) |
| |
| implementation project(":cassandra-analytics-common") |
| implementation project(":cassandra-avro-converter") |
| |
| fourzero(project(path: ':cassandra-four-zero', configuration: 'shadow')) |
| fourzeroBridge(project(":cassandra-four-zero-bridge")) |
| fourzeroTypes(project(":cassandra-four-zero-types")) |
| fourzeroAvroConverter(project(":cassandra-four-zero-avro-converter")) |
| |
| fivezero(project(path: ':cassandra-five-zero', configuration: 'shadow')) |
| fivezeroBridge(project(path: ':cassandra-five-zero-bridge')) |
| fivezeroTypes(project(path: ':cassandra-five-zero-types')) |
| fivezeroAvroConverter(project(":cassandra-five-zero-avro-converter")) |
| |
| implementation "com.google.guava:guava:${guavaVersion}" |
| |
| implementation "org.apache.commons:commons-lang3:${project.commonsLang3Version}" |
| implementation "org.slf4j:slf4j-api:${slf4jApiVersion}" |
| implementation "com.esotericsoftware:kryo-shaded:${kryoVersion}" |
| implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}" |
| implementation "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}" |
| implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}" |
| implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}" |
| |
| testImplementation project(":cassandra-analytics-common") |
| |
| // pull in cassandra-bridge so we can re-use TestSchema to generate arbitrary schemas for the cdc tests |
| testImplementation project(":cassandra-bridge") |
| testImplementation(testFixtures(project(':cassandra-bridge'))) |
| |
| testImplementation project(":cassandra-four-zero-types") |
| testImplementation project(":cassandra-four-zero-bridge") |
| testImplementation project(path: ':cassandra-four-zero', configuration: 'shadow') |
| // unit tests are performed only with Cassandra 4 |
| // testImplementation project(":cassandra-five-zero-bridge") |
| // testImplementation project(":cassandra-five-zero-types") |
| // testImplementation project(path: ':cassandra-five-zero', configuration: 'shadow') |
| |
| testImplementation(group: 'org.quicktheories', name: 'quicktheories', version: "${project.rootProject.quickTheoriesVersion}") |
| testImplementation(group: 'com.google.guava', name: 'guava', version: '31.1-jre') |
| testImplementation(group: 'com.github.luben', name: 'zstd-jni', version: '1.5.0-4') |
| testImplementation(group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26') |
| testImplementation "org.quicktheories:quicktheories:${project.rootProject.quickTheoriesVersion}" |
| testImplementation("org.assertj:assertj-core:${assertjCoreVersion}") |
| testImplementation "org.junit.jupiter:junit-jupiter-api:${project.junitVersion}" |
| testImplementation "org.junit.jupiter:junit-jupiter-params:${project.junitVersion}" |
| testImplementation "org.junit.jupiter:junit-jupiter-engine:${project.junitVersion}" |
| } |
| |
| jar { |
| dependsOn(configurations.fourzero) |
| dependsOn(configurations.fourzeroBridge) |
| dependsOn(configurations.fourzeroTypes) |
| dependsOn(configurations.fourzeroAvroConverter) |
| |
| dependsOn(configurations.fivezero) |
| dependsOn(configurations.fivezeroBridge) |
| dependsOn(configurations.fivezeroTypes) |
| dependsOn(configurations.fivezeroAvroConverter) |
| |
| exclude('META-INF/*') |
| into('bridges') { |
| from(configurations.fourzero.singleFile) |
| from(configurations.fourzeroBridge.singleFile) |
| from(configurations.fourzeroTypes.singleFile) |
| from(configurations.fourzeroAvroConverter.singleFile) |
| |
| from(configurations.fivezero.singleFile) |
| from(configurations.fivezeroBridge.singleFile) |
| from(configurations.fivezeroTypes.singleFile) |
| from(configurations.fivezeroAvroConverter.singleFile) |
| } |
| } |
| |
| test { |
| minHeapSize = '1024m' |
| maxHeapSize = '3072m' |
| maxParallelForks = Math.max(Runtime.runtime.availableProcessors() * 2, 8) |
| forkEvery = 1 // Enables different end-to-end test classes use Spark contexts with different configurations |
| |
| // Make it so unit tests run on a Jar with Cassandra bridge implementations built in |
| dependsOn(tasks.jar) |
| classpath += files(jar.archiveFile) |
| useJUnitPlatform() |
| reports { |
| def destDir = Paths.get(rootProject.rootDir.absolutePath, "build", "test-reports", "cdc").toFile() |
| junitXml { |
| enabled true |
| destination = destDir |
| } |
| html { |
| enabled true |
| destination = destDir |
| } |
| } |
| } |