Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #507: Add tests on JDK 8, 11, and 17 to fix missing method (java.nio.file.Path.of) error #508

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,30 @@ jobs:
- uses: actions/checkout@v4
- name: scalafmt
run: ./sbt scalafmtCheckAll
test_jdk11:
name: Test JDK11
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: sbt scripted test
run: ./sbt compile scripted
test_jdk17:
name: Test JDK17
runs-on: ubuntu-latest
test:
name: Test
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
distribution: zulu
java: 8
- os: ubuntu-latest
distribution: temurin
java: 11
- os: ubuntu-latest
distribution: temurin
java: 17
- os: windows-latest
distribution: temurin
java: 17
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
distribution: "${{ matrix.distribution }}"
java-version: "${{ matrix.java }}"
- name: sbt scripted test
run: ./sbt compile scripted
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package xerial.sbt.sonatype

import com.lumidion.sonatype.central.client.core.{DeploymentName, PublishingType}
import java.io.{File, FileInputStream, FileOutputStream}
import java.nio.file.{Files, Path}
import java.nio.file.{Files, Path, Paths}
import java.util.zip.{ZipEntry, ZipOutputStream}
import scala.util.Try
import wvlet.log.LogSupport
Expand All @@ -16,7 +16,7 @@ private[sbt] class SonatypeCentralService(client: SonatypeCentralClient) extends
deploymentName: DeploymentName,
publishingType: PublishingType
): Either[SonatypeException, Unit] = for {
bundleZipDirectory <- Try(Files.createDirectory(Path.of(s"${localBundlePath.getPath}-bundle"))).toEither.leftMap {
bundleZipDirectory <- Try(Files.createDirectory(Paths.get(s"${localBundlePath.getPath}-bundle"))).toEither.leftMap {
err =>
SonatypeException(BUNDLE_ZIP_ERROR, s"Error creating bundle zip directory. ${err.getMessage}")
}
Expand Down
Loading