Skip to content

Commit

Permalink
Upgrade to Gradle 7 and bump dependencies. (#173)
Browse files Browse the repository at this point in the history
* Upgrade to Gradle 7 and bump dependencies.

* update cloudbuild.yaml

* integration test gradle

* Get deid-redactor package working and remove some unnecessary deps/tags
  • Loading branch information
craigatron authored Aug 5, 2024
1 parent 9cbc434 commit 32a9640
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 98 deletions.
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ steps:
- build

substitutions:
_GRADLE_IMAGE: 'gradle:5.6-jdk11'
_GRADLE_IMAGE: 'gradle:7-jdk11'
35 changes: 17 additions & 18 deletions dicom_util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,37 @@ compileJava {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'http://www.dcm4che.org/maven2/' }
maven { url 'https://www.dcm4che.org/maven2/' }
}

dependencies {
compile platform('com.google.cloud:libraries-bom:5.1.0')
compile platform('com.google.cloud:google-cloud-shared-dependencies:0.1.0')
compile "com.google.api-client:google-api-client"
compile "com.google.inject:guice:4.1.0"
implementation platform('com.google.cloud:libraries-bom:26.43.0')
implementation "com.google.api-client:google-api-client"
implementation "com.google.inject:guice:4.1.0"

compile "org.json:json:20170516"
compile "junit:junit:4.12"
compile "org.junit.jupiter:junit-jupiter-engine:5.0.0"
compile "org.dcm4che:dcm4che-core:5.31.2"
compile "org.dcm4che:dcm4che-net:5.31.2"
implementation "org.json:json:20240303"
testImplementation "junit:junit:4.12"
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.0.0"
implementation "org.dcm4che:dcm4che-core:5.31.2"
implementation "org.dcm4che:dcm4che-net:5.31.2"

compile 'com.google.auth:google-auth-library-oauth2-http:0.17.2'
compile group: 'org.eclipse.jetty.http2', name: 'http2-client', version: '9.4.20.v20190813'
compile group: 'org.eclipse.jetty', name: 'jetty-alpn-java-client', version: '9.4.20.v20190813'
implementation 'com.google.auth:google-auth-library-oauth2-http'
implementation 'org.eclipse.jetty.http2:http2-client:9.4.55.v20240627'
implementation 'org.eclipse.jetty:jetty-alpn-java-client:9.4.55.v20240627'

compile group: 'org.slf4j', name: 'slf4j-reload4j', version: '2.0.12'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.23.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.23.0'
implementation group: 'org.slf4j', name: 'slf4j-reload4j', version: '2.0.12'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.23.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.23.0'

testCompile "com.google.truth:truth:1.0"
testImplementation "com.google.truth:truth:1.0"
}

configurations {
testArtifacts
}

task testJar (type: Jar) {
baseName = "${project.name}-test"
archiveBaseName = "${project.name}-test"
from sourceSets.test.output
}

Expand Down
42 changes: 21 additions & 21 deletions export/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ buildscript {
plugins {
id 'java'
id 'application'
id 'com.github.hierynomus.license' version '0.14.0'
id 'com.github.hierynomus.license' version '0.16.1'
}

mainClassName = "com.google.cloud.healthcare.imaging.dicomadapter.ExportAdapter"
Expand All @@ -48,27 +48,27 @@ compileJava {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'http://www.dcm4che.org/maven2/' }
maven { url 'https://www.dcm4che.org/maven2/' }
}

dependencies {
compile platform('com.google.cloud:libraries-bom:5.1.0')
compile platform('com.google.cloud:google-cloud-shared-dependencies:0.1.0')
compile 'com.google.cloud:google-cloud-pubsub'
compile 'com.google.guava:guava:28.1-jre'
compile 'com.google.auth:google-auth-library-oauth2-http'
compile "com.google.api-client:google-api-client"

compile "com.beust:jcommander:1.72"
compile "org.dcm4che:dcm4che-core:5.31.2"
compile "org.dcm4che:dcm4che-net:5.31.2"
compile project(":dicom_util")
compile project(":util")

testCompile "com.google.truth:truth:1.0"
testCompile "junit:junit:4.2"
testCompile project(path: ":util", configuration: 'testArtifacts')
testCompile project(path: ":dicom_util", configuration: 'testArtifacts')
implementation platform('com.google.cloud:libraries-bom:26.43.0')
implementation 'com.google.cloud:google-cloud-pubsub'
implementation 'com.google.guava:guava:33.1.0-jre'
implementation 'com.google.auth:google-auth-library-oauth2-http'
implementation "com.google.api-client:google-api-client"
implementation "org.json:json:20240303"

implementation "com.beust:jcommander:1.72"
implementation "org.dcm4che:dcm4che-core:5.31.2"
implementation "org.dcm4che:dcm4che-net:5.31.2"
implementation project(":dicom_util")
implementation project(":util")

testImplementation "com.google.truth:truth:1.0"
testImplementation "junit:junit:4.2"
testImplementation project(path: ":util", configuration: 'testArtifacts')
testImplementation project(path: ":dicom_util", configuration: 'testArtifacts')
}

apply plugin: 'com.bmuschko.docker-java-application'
Expand All @@ -84,7 +84,7 @@ docker {
task downloadOpensSourceLicenses(type: nl.javadude.gradle.plugins.license.DownloadLicenses) {
// These libraries have their license in a non-standard location.
licenses = specialCaseLicenses
dependencyConfiguration = 'compile'
dependencyConfiguration = 'runtimeClasspath'
doLast {
downloadLicensesText(buildDir)
}
Expand All @@ -93,7 +93,7 @@ task downloadOpensSourceLicenses(type: nl.javadude.gradle.plugins.license.Downlo
// Download full source jar for all dependencies.
// https://stackoverflow.com/questions/16154458/how-to-copy-all-source-jars-using-gradle
task downloadSourceJars( type: Copy ) {
def sources = configurations.runtime.resolvedConfiguration.resolvedArtifacts.collect { artifact ->
def sources = configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.collect { artifact ->
project.dependencies.create( [
group: artifact.moduleVersion.id.group,
name: artifact.moduleVersion.id.name,
Expand Down
52 changes: 27 additions & 25 deletions import/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ buildscript {
plugins {
id 'java'
id 'application'
id 'com.github.hierynomus.license' version '0.14.0'
id 'com.github.hierynomus.license' version '0.16.1'
}

def transcoderJvmArgs = ["-Dorg.dcm4che3.imageio.codec.ImageReaderFactory=com/google/cloud/healthcare/imaging/dicomadapter/transcoder/ImageReaderFactory.properties",
Expand Down Expand Up @@ -55,38 +55,40 @@ compileJava {

repositories {
mavenCentral()
maven { url 'http://www.dcm4che.org/maven2/' }
maven { url 'https://www.dcm4che.org/maven2/' }
maven { url 'https://jitpack.io' }
}

dependencies {
compile platform('com.google.cloud:libraries-bom:5.1.0')
compile platform('com.google.cloud:google-cloud-shared-dependencies:0.1.0')
compile 'com.google.guava:guava:28.1-jre'
compile 'com.google.auth:google-auth-library-oauth2-http'
compile "com.google.api-client:google-api-client"
implementation platform('com.google.cloud:libraries-bom:26.43.0')
implementation 'com.google.guava:guava:33.1.0-jre'
implementation 'com.google.auth:google-auth-library-oauth2-http'
implementation "com.google.api-client:google-api-client"
implementation "org.json:json:20240303"

compile "com.beust:jcommander:1.72"
compile "org.dcm4che:dcm4che-core:5.31.2"
compile "org.dcm4che:dcm4che-net:5.31.2"
implementation "com.beust:jcommander:1.72"
implementation "org.dcm4che:dcm4che-core:5.31.2"
implementation "org.dcm4che:dcm4che-net:5.31.2"

compile "org.dcm4che:dcm4che-imageio:5.31.2"
runtime "org.dcm4che:dcm4che-imageio-rle:5.31.2"
compile project(":jai-imageio-jpeg2000")
implementation "org.dcm4che:dcm4che-imageio:5.31.2"
runtimeOnly "org.dcm4che:dcm4che-imageio-rle:5.31.2"
implementation project(":jai-imageio-jpeg2000")

compile project(":dicom_util")
compile project(":util")
implementation project(":dicom_util")
implementation project(":util")

compile project(":deid-redactor")
implementation project(":deid-redactor")

compile "com.google.cloud:google-cloud-storage:1.98.0"
compile 'com.google.cloud:google-cloud-nio:0.116.0-alpha'
implementation "com.google.cloud:google-cloud-storage"
implementation 'com.google.cloud:google-cloud-nio'

testCompile "com.google.truth:truth:1.0"
testCompile "org.mockito:mockito-core:3.+"
testCompile "junit:junit:4.2"
testCompile project(path: ":dicom_util", configuration: 'testArtifacts')
testCompile project(path: ":util", configuration: 'testArtifacts')
testImplementation "com.google.truth:truth:1.0"
testImplementation "org.mockito:mockito-core:3.+"
testImplementation "junit:junit:4.2"
testImplementation project(path: ":dicom_util", configuration: 'testArtifacts')
testImplementation project(path: ":util", configuration: 'testArtifacts')

testImplementation 'org.eclipse.jetty:jetty-http:9.4.55.v20240627'
}

apply plugin: 'com.bmuschko.docker-java-application'
Expand All @@ -103,7 +105,7 @@ docker {
task downloadOpensSourceLicenses(type: nl.javadude.gradle.plugins.license.DownloadLicenses) {
// These libraries have their license in a non-standard location.
licenses = specialCaseLicenses
dependencyConfiguration = 'compile'
dependencyConfiguration = 'runtimeClasspath'
doLast {
downloadLicensesText(buildDir)
}
Expand All @@ -112,7 +114,7 @@ task downloadOpensSourceLicenses(type: nl.javadude.gradle.plugins.license.Downlo
// Download full source jar for all dependencies.
// https://stackoverflow.com/questions/16154458/how-to-copy-all-source-jars-using-gradle
task downloadSourceJars( type: Copy ) {
def sources = configurations.runtime.resolvedConfiguration.resolvedArtifacts.collect { artifact ->
def sources = configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.collect { artifact ->
project.dependencies.create( [
group: artifact.moduleVersion.id.group,
name: artifact.moduleVersion.id.name,
Expand Down
10 changes: 5 additions & 5 deletions integration_test/cloudbuild-integration-test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
steps:
# basic funtionality test
- name: 'gradle:6.9.4-jdk11-focal'
- name: 'gradle:7-jdk11-focal'
id: basic-test
args:
- python3
Expand All @@ -10,21 +10,21 @@ steps:
- 'IMAGEPROJECT=${_IMAGEPROJECT}'

# http2 test
- name: 'gradle:6.9.4-jdk11-focal'
- name: 'gradle:7-jdk11-focal'
id: http2-test
args:
- python3
- ./integration_test/step_2.py

# local backup test
- name: 'gradle:6.9.4-jdk11-focal'
- name: 'gradle:7-jdk11-focal'
id: local-backup-test
args:
- python3
- ./integration_test/step_3.py

# gcs backup test
- name: 'gradle:6.9.4-jdk11-focal'
- name: 'gradle:7-jdk11-focal'
id: gcs-backup-test
args:
- python3
Expand All @@ -51,4 +51,4 @@ substitutions:
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/GH_TOKEN/versions/latest
env: GH_TOKEN
env: GH_TOKEN
4 changes: 2 additions & 2 deletions third_party/deid-redactor/examples/tag_remover/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repositories {
google()
jcenter()
mavenCentral()
maven { url 'http://www.dcm4che.org/maven2/' }
maven { url 'https://www.dcm4che.org/maven2/' }
}

buildDir = "/tmp/gradle_build/redactor/examples"
Expand All @@ -33,7 +33,7 @@ dependencies {
implementation 'commons-cli:commons-cli:1.4'

testImplementation 'junit:junit:4.12'
testImplementation 'com.google.truth:truth:0.39'
testImplementation 'com.google.truth:truth:1.4.4'
testImplementation 'commons-io:commons-io:2.6'
}

Expand Down
14 changes: 7 additions & 7 deletions third_party/deid-redactor/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

plugins {
id 'java-library'
id 'com.google.protobuf' version "0.8.13"
id 'maven'
id 'com.google.protobuf' version "0.9.4"
}

repositories {
google()
jcenter()
mavenCentral()
maven { url 'http://www.dcm4che.org/maven2/' }
maven { url 'https://www.dcm4che.org/maven2/' }
}


group = "com.google.cloud.healthcare.deid"
archivesBaseName = "redactor"
version = "0.1.0"
Expand All @@ -37,18 +37,18 @@ dependencies {
implementation "org.dcm4che:dcm4che-core:3.3.8"
implementation "org.dcm4che:dcm4che-imageio:3.3.8"

protobuf 'com.google.protobuf:protobuf-java:3.7.1'
implementation 'com.google.protobuf:protobuf-java:3.25.4'

api "com.google.api.grpc:proto-google-common-protos:1.16.0"
api "com.google.api.grpc:proto-google-common-protos:2.42.0"

testImplementation 'junit:junit:4.12'
testImplementation 'com.google.truth:truth:0.39'
testImplementation 'com.google.truth:truth:1.4.4'
testImplementation 'commons-io:commons-io:2.6'
}

protobuf {
generatedFilesBaseDir = "/tmp/gradle_build/redactor/gen"
protoc {
artifact = "com.google.protobuf:protoc:3.7.1";
artifact = "com.google.protobuf:protoc:3.25.4";
}
}
10 changes: 5 additions & 5 deletions third_party/jai-imageio-jpeg2000/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
plugins {
id 'java'
id 'maven-publish'
id 'com.github.hierynomus.license' version '0.14.0'
id 'com.github.hierynomus.license' version '0.16.1'
}

repositories {
mavenCentral()
mavenLocal()
maven {
url = 'http://dl.bintray.com/jai-imageio/maven/'
url = 'https://dl.bintray.com/jai-imageio/maven/'
}

maven {
url = 'http://repo.maven.apache.org/maven2'
url = 'https://repo.maven.apache.org/maven2'
}
}

dependencies {
compile 'com.github.jai-imageio:jai-imageio-core:1.4.0'
testCompile 'junit:junit:4.12'
implementation 'com.github.jai-imageio:jai-imageio-core:1.4.0'
testImplementation 'junit:junit:4.12'
}

group = 'com.github.jai-imageio'
Expand Down
Loading

0 comments on commit 32a9640

Please sign in to comment.