Skip to content

Commit

Permalink
Maintenance fixes
Browse files Browse the repository at this point in the history
* Update Gradle to 8.4
* Update dependencies to current
* Remove use of vendored beam deps
  • Loading branch information
anantdamle authored Oct 23, 2023
1 parent f3dc8ed commit 52294c9
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 48 deletions.
84 changes: 39 additions & 45 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
plugins {
id "java"
id "java-library"
id "com.google.protobuf" version "0.8.18"
id "com.diffplug.spotless" version "5.9.0"
id "com.google.protobuf" version "0.9.4"
id "com.diffplug.spotless" version "6.2.2"
id "idea"
id "jacoco"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "maven-publish"
id "com.github.johnrengelman.shadow" version "8.1.1"
}

repositories {
Expand All @@ -33,16 +32,17 @@ repositories {
}
}

def protoVersion = "3.20.1"
def beamVersion = "2.36.0"
def hadoopVersion = "3.3.1"
def autoValueVersion = "1.8.2"
def floggerVersion = "0.7.4"
def protoVersion = "3.24.4"
def beamVersion = "2.51.0"
def hadoopVersion = "3.3.6"
def autoValueVersion = "1.10.4"
def floggerVersion = "0.8"


dependencies {

// Protobuf deps
compileOnly "com.google.api.grpc:proto-google-common-protos:2.7.4"
compileOnly "com.google.api.grpc:proto-google-common-protos:2.26.0"

implementation "com.google.protobuf:protobuf-java:${protoVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protoVersion}"
Expand All @@ -54,32 +54,32 @@ dependencies {
testAnnotationProcessor "com.google.auto.value:auto-value:${autoValueVersion}"

// Commons library deps
implementation 'com.google.guava:guava:31.0.1-jre'
implementation "org.apache.commons:commons-lang3:3.12.0"
implementation "org.apache.httpcomponents:httpclient:4.5.13"
implementation 'com.google.guava:guava:32.1.3-jre'
implementation "org.apache.commons:commons-lang3:3.13.0"
implementation "org.apache.httpcomponents:httpclient:4.5.14"

// CSV Library
implementation "org.apache.commons:commons-csv:1.9.0"
implementation "org.apache.commons:commons-csv:1.10.0"

// Google Services deps
implementation "com.google.cloud:google-cloud-dlp:3.1.0"
implementation "com.google.cloud:google-cloud-datacatalog:1.6.3"
implementation "com.google.cloud:google-cloud-kms:2.4.0"
implementation "com.google.cloud:google-cloud-secretmanager:2.0.7"
implementation "com.google.cloud:google-cloud-dlp:3.32.0"
implementation "com.google.cloud:google-cloud-datacatalog:1.34.0"
implementation "com.google.cloud:google-cloud-kms:2.31.0"
implementation "com.google.cloud:google-cloud-secretmanager:2.28.0"

// Google Tink for encryption
implementation "com.google.crypto.tink:tink:1.6.1"
implementation "com.google.crypto.tink:tink-gcpkms:1.6.1"
implementation "com.google.crypto.tink:tink:1.11.0"
implementation "com.google.crypto.tink:tink-gcpkms:1.9.0"

// JSON related libs
implementation "com.github.wnameless.json:json-flattener:0.11.1"
implementation "com.jayway.jsonpath:json-path:2.7.0"
implementation "com.jayway.jsonpath:json-path:2.8.0"
implementation "com.fasterxml.jackson.core:jackson-core:2.13.1"
implementation "com.fasterxml.jackson.core:jackson-databind:2.13.1"

// Hadoop files (Avro + Parquet)
implementation "org.apache.avro:avro:1.11.0"
implementation "org.apache.parquet:parquet-avro:1.12.1"
implementation "org.apache.avro:avro:1.11.3"
implementation "org.apache.parquet:parquet-avro:1.13.1"
implementation("org.apache.hadoop:hadoop-common:${hadoopVersion}"){
exclude group: "org.slf4j", module: "slf4j-log4j12"
}
Expand All @@ -99,9 +99,9 @@ dependencies {
runtimeOnly "org.apache.beam:beam-runners-google-cloud-dataflow-java:${beamVersion}"

// Runtime only deps
runtimeOnly "org.slf4j:slf4j-api:1.7.36"
runtimeOnly "org.slf4j:slf4j-jdk14:1.7.36"
runtimeOnly "io.grpc:grpc-netty:1.44.0"
runtimeOnly "org.slf4j:slf4j-api:2.0.9"
runtimeOnly "org.slf4j:slf4j-jdk14:2.0.9"
runtimeOnly "io.grpc:grpc-netty:1.58.0"

runtimeOnly ("org.apache.hadoop:hadoop-mapreduce-client-core:${hadoopVersion}") {
exclude group: "org.slf4j", module: "slf4j-log4j12"
Expand All @@ -111,36 +111,36 @@ dependencies {
}

// CloudSQL Connection Factory
runtimeOnly "com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.4.4"
runtimeOnly "com.google.cloud.sql:postgres-socket-factory:1.4.4"
runtimeOnly "com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.14.1"
runtimeOnly "com.google.cloud.sql:postgres-socket-factory:1.14.1"


// MySQL JDBC driver
runtimeOnly('mysql:mysql-connector-java:8.0.25') {
runtimeOnly('mysql:mysql-connector-java:8.0.33') {
exclude group: "com.google.protobuf", module: "protobuf-java"
}
testRuntimeOnly('mysql:mysql-connector-java:8.0.25') {
testRuntimeOnly('mysql:mysql-connector-java:8.0.33') {
exclude group: "com.google.protobuf", module: "protobuf-java"
}

// Postgres SQL JDBC Driver
runtimeOnly "org.postgresql:postgresql:42.3.2"
runtimeOnly "org.postgresql:postgresql:42.6.0"

//checker-framework
compileOnly "org.checkerframework:checker-qual:3.21.2"
compileOnly "org.checkerframework:checker-qual:3.39.0"

// Testing Dependencies
testImplementation "junit:junit:4.13.2"
testImplementation "org.hamcrest:hamcrest-all:1.3"
testImplementation "org.mockito:mockito-all:1.10.19"
testImplementation "com.google.truth:truth:1.1.3"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.1.3"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.1.3"
testImplementation "org.skyscreamer:jsonassert:1.5.0"
testImplementation "org.apache.logging.log4j:log4j-core:2.17.0"
testImplementation "com.google.truth:truth:1.1.5"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.1.5"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.1.5"
testImplementation "org.skyscreamer:jsonassert:1.5.1"
testImplementation "org.apache.logging.log4j:log4j-core:2.17.2"

// Testcontainers used to mock database
testImplementation "org.testcontainers:mysql:1.16.3"
testImplementation "org.testcontainers:mysql:1.19.1"
}

protobuf {
Expand Down Expand Up @@ -174,16 +174,10 @@ test {
}

jacoco {
toolVersion = "0.8.7"
toolVersion = "0.8.9"
}

jacocoTestReport {
reports {
csv.enabled false
xml.enabled true
html.enabled true
}

afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.google.cloud.solutions.autotokenize.AutoTokenizeMessages.JdbcConfiguration.PasswordsCase;
import com.google.cloud.solutions.autotokenize.AutoTokenizeMessages.SourceType;
import com.google.cloud.solutions.autotokenize.common.CsvIO.CsvParse;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import java.util.Arrays;
import java.util.List;
Expand All @@ -52,7 +53,6 @@
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.PCollectionTuple;
import org.apache.beam.sdk.values.TupleTag;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting;
import org.checkerframework.checker.nullness.qual.Nullable;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import static com.google.common.truth.Truth.assertThat;

import com.google.common.collect.Iterables;
import org.apache.beam.sdk.transforms.SerializableFunction;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;

/** Utility Matcher for PAssert to check the number of items in a given PCollection. */
public class RecordsCountMatcher<T> implements SerializableFunction<Iterable<T>, Void> {
Expand Down

0 comments on commit 52294c9

Please sign in to comment.