From 9845a4c90e9e3c3f4a771a104a7507b6fca23e9d Mon Sep 17 00:00:00 2001 From: Jeremy Fee Date: Fri, 16 Sep 2022 20:31:11 -0600 Subject: [PATCH] Fix gitlab pipeline, gradle build for java 8, and remove travis. --- .gitlab-ci.yml | 4 +- .travis.yml | 42 ------------------- build.gradle | 24 +---------- .../geoserve/GeoservePlacesService.java | 1 - 4 files changed, 5 insertions(+), 66 deletions(-) delete mode 100644 .travis.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3795fcb..33ba8186 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,9 @@ stages: - ProductClient.jar - ProductClient.zip reports: - cobertura: build/reports/cobertura/cobertura.xml + coverage_report: + coverage_format: cobertura + path: build/reports/cobertura/cobertura.xml junit: build/test-results/test/TEST-*.xml cache: paths: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e95c59c0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: java -# local ssh seems to require sudo -sudo: required - -jdk: - - openjdk8 - - openjdk11 - # - oraclejdk8 - not available in travis anymore - - oraclejdk11 - -# gradle caching -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - "$HOME/.gradle/caches/" - - "$HOME/.gradle/wrapper/" - -# tests depend on local ssh -install: - - ssh-keygen -f ~/.ssh/id_rsa -t rsa -N '' -b 4096 - - cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys - - chmod 700 ~/.ssh/authorized_keys -addons: - ssh_known_hosts: - - 127.0.0.1 - - localhost - -script: - - ./gradlew --info build - # use --scan to post output online - # - ./gradlew build --scan - -# upload coverage -after_success: - - bash <(curl -s https://codecov.io/bash) - - "./gradlew sendCoverageToCodacy" - -env: - # CODACY_PROJECT_TOKEN - secure: PO6Zdc7e/x021brgk55kG1zTUPSNnvQ8BKNDJJK8cZJ4dgLgzbvxW5eoNPSn2CW5/C5YqkLgUVPkVy15zUVNpdM/RXYgzPiFTyg2GFXLQL9DbfQOz2zD8/iSySxTjUGfd7VNJZPG8XlFmzUIvY+4Eykj4UBsTFknZmro1kC/PS5E/bTtOrYGUKg9mfQz3t4/Tx7n8mw5CO5IVaHvklpbUTgaW0d8Et0qxQZ/Ks2xnlEP/4OcmSLMDeeyeYKVJc9KajgU27r1qtSoWtqL5InyW+L/8MU0soFDPO71KCphB0dbLJ6sdkzCWPIWfA/zeVlf+54K9zveXdbtdJs1Btzw73sTruoq2z/YTUZVIUdLG5yenMLPX0ayWpWc7AT4dDkSNXrwy+wWvjcF7mMddffvvGH//38FtkQ8fvm2o2tq/PIua2mQb8otsS7IKhOgmDFV+C2ygsMtTq/Wn7ny/0Yb+vUswNZUEZiK5IMEGF73OMIriDFKIvc4tJnJ2xKw2SY5cnratxeWzpsPH3IRIIG+bIfAGvN+g6/f97+xemR5YVO9FuZKR8IEBPl0jM+s8G2T1PpSG9LsfDPYSLIYC95GUEi9dFcFX7FP5y3a0rxyCyCcu+YoSBQXTsb/mCcb+IKoMugSh88hdUhqbDWbHA252ryBCmW7lTQI8C4S3B0NKBA= diff --git a/build.gradle b/build.gradle index 1f1feaab..8ce487a1 100644 --- a/build.gradle +++ b/build.gradle @@ -8,8 +8,8 @@ plugins { id "java" id "jacoco" // code coverage id "pmd" // static code analysis - id "org.ajoberstar.grgit" version "4.1.0" // git repo information - id "org.ajoberstar.git-publish" version "3.0.0" // publish gh-pages branch + id "org.ajoberstar.grgit" version "4.1.1" // git repo information + id "org.ajoberstar.git-publish" version "3.0.1" // publish gh-pages branch id "com.kageiit.jacobo" version "2.1.0" } @@ -25,8 +25,6 @@ configurations { } dependencies { - codacy "com.codacy:codacy-coverage-reporter:4.0+" - // for explanation of dependency types, see // https://docs.gradle.org/current/userguide/building_java_projects.html @@ -189,9 +187,6 @@ gitPublish { } } - -// Tasks for TravisCI - // convert jacoco to cobertura import com.kageiit.jacobo.JacoboTask tasks.create("jacobo", JacoboTask, { @@ -200,18 +195,3 @@ tasks.create("jacobo", JacoboTask, { it.srcDirs = sourceSets.main.java.srcDirs }).dependsOn(jacocoTestReport) check.dependsOn jacobo - - -// .travis.yml uses this to upload coverage -task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) { - description = "Upload coverage to codacy (used by TravisCI)" - main = "com.codacy.CodacyCoverageReporter" - classpath = configurations.codacy - args = [ - "report", - "-l", - "Java", - "-r", - "${buildDir}/reports/jacoco/test/jacocoTestReport.xml" - ] -} diff --git a/src/main/java/gov/usgs/earthquake/geoserve/GeoservePlacesService.java b/src/main/java/gov/usgs/earthquake/geoserve/GeoservePlacesService.java index 572789ee..814a374e 100644 --- a/src/main/java/gov/usgs/earthquake/geoserve/GeoservePlacesService.java +++ b/src/main/java/gov/usgs/earthquake/geoserve/GeoservePlacesService.java @@ -3,7 +3,6 @@ import java.io.IOException; import java.io.InputStream; import java.math.BigDecimal; -import java.math.BigInteger; import java.net.MalformedURLException; import java.net.URL; import java.net.URLEncoder;