diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0808a577..f14d2aeb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -37,3 +37,15 @@ updates: schedule: interval: "weekly" open-pull-requests-limit: 10 + + # Maintain dependencies for Java + - package-ecosystem: "gradle" + directory: "/dependencies/checkstyle" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + - package-ecosystem: "gradle" + directory: "/dependencies/google-java-format" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 diff --git a/Dockerfile b/Dockerfile index 3a1d34c1..050f283f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,12 +34,10 @@ FROM python:3.11.5-alpine3.17 as base_image ################################ # Set ARG values used in Build # ################################ -ARG CHECKSTYLE_VERSION='10.3.4' ARG CLJ_KONDO_VERSION='2023.05.18' # Dart Linter ## stable dart sdk: https://dart.dev/get-dart#release-channels ARG DART_VERSION='2.8.4' -ARG GOOGLE_JAVA_FORMAT_VERSION='1.18.1' ## install alpine-pkg-glibc (glibc compatibility layer package for Alpine Linux) ARG GLIBC_VERSION='2.34-r0' ARG KTLINT_VERSION='0.47.1' @@ -94,7 +92,7 @@ RUN apk add --no-cache \ ######################################## # Copy dependencies files to container # ######################################## -COPY dependencies/* / +COPY dependencies/ / ################################################################### # Install Dependencies # diff --git a/dependencies/checkstyle/build.gradle b/dependencies/checkstyle/build.gradle new file mode 100644 index 00000000..030ea73a --- /dev/null +++ b/dependencies/checkstyle/build.gradle @@ -0,0 +1,12 @@ +repositories { + mavenLocal() + mavenCentral() +} + +// Hold this dependency here so we can get automated updates using DependaBot +dependencies { + implementation 'com.puppycrawl.tools:checkstyle:10.3.4' +} + +group 'com.github.super-linter' +version '1.0.0-SNAPSHOT' diff --git a/dependencies/google-java-format/build.gradle b/dependencies/google-java-format/build.gradle new file mode 100644 index 00000000..c2d49f60 --- /dev/null +++ b/dependencies/google-java-format/build.gradle @@ -0,0 +1,12 @@ +repositories { + mavenLocal() + mavenCentral() +} + +// Hold this dependency here so we can get automated updates using DependaBot +dependencies { + implementation 'com.google.googlejavaformat:google-java-format:1.18.1' +} + +group 'com.github.super-linter' +version '1.0.0-SNAPSHOT' diff --git a/scripts/install-checkstyle.sh b/scripts/install-checkstyle.sh index f924ace1..ebeb272a 100755 --- a/scripts/install-checkstyle.sh +++ b/scripts/install-checkstyle.sh @@ -2,6 +2,9 @@ set -euo pipefail +CHECKSTYLE_VERSION="$(grep <"checkstyle/build.gradle" "checkstyle" | awk -F ':' '{print $3}' | tr -d "'")" +echo "Installing Checkstyle: ${CHECKSTYLE_VERSION}" + url=$(curl -s \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \ diff --git a/scripts/install-google-java-format.sh b/scripts/install-google-java-format.sh index e23f725a..58413698 100755 --- a/scripts/install-google-java-format.sh +++ b/scripts/install-google-java-format.sh @@ -2,6 +2,9 @@ set -euo pipefail +GOOGLE_JAVA_FORMAT_VERSION="$(grep <"google-java-format/build.gradle" "google-java-format" | awk -F ':' '{print $3}' | tr -d "'")" +echo "Installing Google Java Format: ${GOOGLE_JAVA_FORMAT_VERSION}" + url=$(curl -s \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $(cat /run/secrets/GITHUB_TOKEN)" \