diff --git a/cloudbuild.yaml b/cloudbuild.yaml index c6f40b11..50b1ae71 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -7,4 +7,4 @@ steps: - build substitutions: - _GRADLE_IMAGE: 'gradle:5.6-jdk11' + _GRADLE_IMAGE: 'gradle:7-jdk11' diff --git a/dicom_util/build.gradle b/dicom_util/build.gradle index 1bbcaf7f..d24362d6 100644 --- a/dicom_util/build.gradle +++ b/dicom_util/build.gradle @@ -29,30 +29,29 @@ 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 { @@ -60,7 +59,7 @@ configurations { } task testJar (type: Jar) { - baseName = "${project.name}-test" + archiveBaseName = "${project.name}-test" from sourceSets.test.output } diff --git a/export/build.gradle b/export/build.gradle index ca37078c..55d86cf1 100644 --- a/export/build.gradle +++ b/export/build.gradle @@ -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" @@ -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' @@ -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) } @@ -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, diff --git a/import/build.gradle b/import/build.gradle index e8dbad86..ec0146f4 100644 --- a/import/build.gradle +++ b/import/build.gradle @@ -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", @@ -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' @@ -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) } @@ -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, diff --git a/integration_test/cloudbuild-integration-test.yaml b/integration_test/cloudbuild-integration-test.yaml index d9599783..8531c4fd 100644 --- a/integration_test/cloudbuild-integration-test.yaml +++ b/integration_test/cloudbuild-integration-test.yaml @@ -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 @@ -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 @@ -51,4 +51,4 @@ substitutions: availableSecrets: secretManager: - versionName: projects/$PROJECT_ID/secrets/GH_TOKEN/versions/latest - env: GH_TOKEN \ No newline at end of file + env: GH_TOKEN diff --git a/third_party/deid-redactor/examples/tag_remover/build.gradle b/third_party/deid-redactor/examples/tag_remover/build.gradle index 86c58627..3a5314b8 100644 --- a/third_party/deid-redactor/examples/tag_remover/build.gradle +++ b/third_party/deid-redactor/examples/tag_remover/build.gradle @@ -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" @@ -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' } diff --git a/third_party/deid-redactor/lib/build.gradle b/third_party/deid-redactor/lib/build.gradle index fb84ef9e..52272cc7 100644 --- a/third_party/deid-redactor/lib/build.gradle +++ b/third_party/deid-redactor/lib/build.gradle @@ -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" @@ -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"; } } diff --git a/third_party/jai-imageio-jpeg2000/build.gradle b/third_party/jai-imageio-jpeg2000/build.gradle index cca5cd9c..497d73e0 100644 --- a/third_party/jai-imageio-jpeg2000/build.gradle +++ b/third_party/jai-imageio-jpeg2000/build.gradle @@ -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' diff --git a/util/build.gradle b/util/build.gradle index 66301e47..49d90163 100644 --- a/util/build.gradle +++ b/util/build.gradle @@ -30,20 +30,21 @@ compileJava { repositories { mavenCentral() - maven { url 'http://www.dcm4che.org/maven2/' } + maven { url 'https://www.dcm4che.org/maven2/' } } dependencies { - compile "org.dcm4che:dcm4che-core:5.31.2" - compile "org.dcm4che:dcm4che-net:5.31.2" - compile "org.json:json:20180813" - 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-monitoring" - - testCompile "com.google.truth:truth:1.0" - testCompile "junit:junit:4.2" - testCompile project(path: ":dicom_util", configuration: 'testArtifacts') + implementation "org.dcm4che:dcm4che-core:5.31.2" + implementation "org.dcm4che:dcm4che-net:5.31.2" + implementation "org.json:json:20240303" + implementation platform('com.google.cloud:libraries-bom:26.43.0') + implementation "com.google.cloud:google-cloud-monitoring" + implementation "com.google.protobuf:protobuf-java-util" + implementation "com.google.api-client:google-api-client" + + testImplementation "com.google.truth:truth:1.0" + testImplementation "junit:junit:4.2" + testImplementation project(path: ":dicom_util", configuration: 'testArtifacts') } configurations { @@ -51,10 +52,10 @@ configurations { } task testJar (type: Jar) { - baseName = "${project.name}-test" + archiveBaseName = "${project.name}-test" from sourceSets.test.output } artifacts { testArtifacts testJar -} \ No newline at end of file +} diff --git a/util/src/main/java/com/google/cloud/healthcare/imaging/dicomadapter/AttributesUtil.java b/util/src/main/java/com/google/cloud/healthcare/imaging/dicomadapter/AttributesUtil.java index 91928961..aed25791 100644 --- a/util/src/main/java/com/google/cloud/healthcare/imaging/dicomadapter/AttributesUtil.java +++ b/util/src/main/java/com/google/cloud/healthcare/imaging/dicomadapter/AttributesUtil.java @@ -15,6 +15,7 @@ package com.google.cloud.healthcare.imaging.dicomadapter; import java.io.IOException; +import java.math.BigDecimal; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -217,7 +218,7 @@ private static void setAttributeValue(Attributes attrs, int tag, VR vr, JSONArra break; case FL: case FD: - double[] dValues = jsonValues.toList().stream().mapToDouble(i -> (Double) i).toArray(); + double[] dValues = jsonValues.toList().stream().mapToDouble(i -> ((BigDecimal) i).doubleValue()).toArray(); attrs.setDouble(tag, vr, dValues); break; default: