diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1126c58..bf15386 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -5,8 +5,8 @@ on: branches: [main] pull_request: branches: [main] - schedule: - - cron: '0 7 * * 6' +# schedule: +# - cron: '0 7 * * 6' jobs: analyze: @@ -28,9 +28,9 @@ jobs: with: distribution: 'adopt' java-version: 11 - cache: 'gradle' - - uses: gradle/wrapper-validation-action@v2 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml new file mode 100644 index 0000000..a25f0f3 --- /dev/null +++ b/.github/workflows/dependency-submission.yml @@ -0,0 +1,23 @@ +name: Dependency Submission + +on: + # Only runs on main branch + push: + branches: [ main ] + +permissions: + contents: write # Required for dependency submission + +jobs: + dependency-submission: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@v4 diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..548c2a4 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,53 @@ +name: Deploy GitHub Pages + +on: + push: + branches: ["main"] + workflow_dispatch: + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Build Javadoc + run: ./gradlew javadoc --info + - name: Build Reports + run: ./gradlew check jacocoTestReport --info + - name: Collect artifacts + run: cp -r build/reports/ build/docs/ + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./build/docs/ + + deploy: + if: ${{ github.ref == 'refs/heads/main' }} + permissions: + id-token: write + pages: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0bee7b5..887685e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -12,9 +12,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [11, 17] + java: [11, 17, 21, 23] env: - DEFAULT_JAVA: 17 + DEFAULT_JAVA: 11 steps: - uses: actions/checkout@v4 @@ -24,8 +24,9 @@ jobs: with: distribution: 'temurin' java-version: ${{ matrix.java }} - cache: 'gradle' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Cache SonarQube packages uses: actions/cache@v4 @@ -34,10 +35,8 @@ jobs: key: ${{ runner.os }}-java-${{ matrix.java }}-sonar restore-keys: ${{ runner.os }}-java-${{ matrix.java }}-sonar - - uses: gradle/wrapper-validation-action@v2 - - name: Build with Gradle - run: ./gradlew clean build --info --warning-mode all + run: ./gradlew clean build --info --warning-mode all -PjavaVersion=${{ matrix.java }} - name: Sonar analysis if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }} diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 5ca423f..e399cb1 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,5 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=ignore org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull diff --git a/.vscode/settings.json b/.vscode/settings.json index fa57eee..d0119f7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,13 +1,17 @@ { - "java.configuration.updateBuildConfiguration": "automatic", - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.organizeImports": true, - "source.generate.finalModifiers": true, - "source.fixAll": true - }, - "java.codeGeneration.useBlocks": true, - "java.saveActions.organizeImports": true, - "java.sources.organizeImports.starThreshold": 3, - "java.sources.organizeImports.staticStarThreshold": 3 -} \ No newline at end of file + "java.configuration.updateBuildConfiguration": "automatic", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit", + "source.generate.finalModifiers": "explicit", + "source.fixAll": "explicit" + }, + "java.codeGeneration.useBlocks": true, + "java.saveActions.organizeImports": true, + "java.sources.organizeImports.starThreshold": 3, + "java.sources.organizeImports.staticStarThreshold": 3, + "sonarlint.connectedMode.project": { + "connectionId": "kaklakariada-github", + "projectKey": "com.github.kaklakariada:fritzbox-java-api" + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index ba226cc..8fb9e45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.8.0] - unreleased +- [#65](https://github.com/kaklakariada/fritzbox-java-api/pull/65) Upgrade dependencies + ## [1.7.0] - 2023-10-07 ### Added diff --git a/build.gradle b/build.gradle index 7225e61..6394b3f 100644 --- a/build.gradle +++ b/build.gradle @@ -4,18 +4,19 @@ plugins { id "maven-publish" id "jacoco" id "com.github.hierynomus.license" version "0.16.1" - id "org.sonarqube" version "4.4.1.3373" - id "io.github.gradle-nexus.publish-plugin" version "1.3.0" - id "com.github.ben-manes.versions" version "0.48.0" - id "org.sonatype.gradle.plugins.scan" version "2.6.1" + id "org.sonarqube" version "6.0.1.5171" + id "io.github.gradle-nexus.publish-plugin" version "2.0.0" + id "com.github.ben-manes.versions" version "0.51.0" + id "org.sonatype.gradle.plugins.scan" version "2.8.3" } -group 'com.github.kaklakariada' +group = 'com.github.kaklakariada' version = '1.7.0' java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + def javaVersion = project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : 11 + languageVersion = JavaLanguageVersion.of(javaVersion) } withJavadocJar() withSourcesJar() @@ -40,15 +41,14 @@ testing { } dependencies { - implementation 'com.squareup.okhttp3:okhttp:4.11.0' - implementation 'com.squareup.okio:okio:3.6.0' // Fix CVE-2023-3635 + implementation 'com.squareup.okhttp3:okhttp:4.12.0' implementation 'com.subshell.simpleframework:simple-xml:2.9.0' - implementation 'org.slf4j:slf4j-api:2.0.9' + implementation 'org.slf4j:slf4j-api:2.0.16' - testRuntimeOnly 'ch.qos.logback:logback-classic:1.4.11' + testRuntimeOnly 'ch.qos.logback:logback-classic:1.5.15' - testImplementation 'org.mockito:mockito-core:5.6.0' - testImplementation 'org.assertj:assertj-core:3.24.2' + testImplementation 'org.mockito:mockito-core:5.14.2' + testImplementation 'org.assertj:assertj-core:3.27.0' } license { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..a4b76b9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3fa8f86..cea7a79 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..f3b75f3 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 6689b85..9b42019 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail