Skip to content

Commit f9fd433

Browse files
chore: update all dependencies (#12)
* chore: update all dependencies * ci: update workflow actions * cleanup old plugins * tweak javacOptions * run sbt-dependency-submission only on the main branch
1 parent 43025e0 commit f9fd433

File tree

7 files changed

+62
-83
lines changed

7 files changed

+62
-83
lines changed

.github/workflows/scala.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ jobs:
1919
build:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- name: Set up JDK 11
24-
uses: actions/setup-java@v3
24+
uses: actions/setup-java@v4
2525
with:
2626
java-version: '17'
2727
distribution: 'temurin'
2828
cache: 'sbt'
29+
- name: Install sbt
30+
uses: sbt/setup-sbt@v1
2931
- name: Cache Playwright drivers
30-
uses: actions/cache@v3
32+
uses: actions/cache@v4
3133
with:
3234
path: ~/.cache/ms-playwright/
3335
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pom.xml') }}
@@ -36,4 +38,5 @@ jobs:
3638
- name: Run tests
3739
run: sbt test
3840
- name: Update Dependency Graph
39-
uses: scalacenter/sbt-dependency-submission@v2
41+
if: github.ref == 'refs/heads/main'
42+
uses: scalacenter/sbt-dependency-submission@v3

build.sbt

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations.*
22
import xerial.sbt.Sonatype.*
33
organization := "io.github.gmkumar2005"
44
organizationName := "io.github.gmkumar2005"
5-
scalaVersion := "2.12.18"
5+
scalaVersion := "2.12.20"
66
sonatypeProfileName := "io.github.gmkumar2005"
77
versionScheme := Some("early-semver")
88
licenses := Seq(
@@ -32,40 +32,41 @@ developers := List(
3232
//publishTo := Some(Resolver.file("local-ivy-repo", file(Path.userHome.absolutePath + "/.ivy2/local"))(Patterns(true, Resolver.mavenStyleBasePattern)))
3333
//val localIvyRepo = Resolver.file("local-ivy-repo", file(Path.userHome.absolutePath + "/.ivy2/local"))(Patterns(true, Resolver.mavenStyleBasePattern))
3434

35-
lazy val root = (project in file("."))
36-
.settings(
37-
name := "scala-js-env-playwright",
38-
libraryDependencies ++= Seq(
39-
"com.microsoft.playwright" % "playwright" % "1.40.0",
40-
"org.scala-js" %% "scalajs-js-envs" % "1.4.0",
41-
"com.google.jimfs" % "jimfs" % "1.2",
42-
"com.outr" %% "scribe" % "3.13.0",
43-
"org.typelevel" %% "cats-effect" % "3.5.2",
44-
"org.scala-js" %% "scalajs-js-envs-test-kit" % "1.4.0" % Test,
45-
"com.novocode" % "junit-interface" % "0.11" % Test
46-
),
47-
releaseProcess := Seq[ReleaseStep](
48-
checkSnapshotDependencies,
49-
inquireVersions,
50-
runClean,
51-
runTest,
52-
setReleaseVersion,
53-
commitReleaseVersion,
54-
tagRelease,
55-
ReleaseStep(action = Command.process("publishSigned", _)),
56-
setNextVersion,
57-
commitNextVersion
58-
),
59-
publishTo := {
60-
val nexus = "https://s01.oss.sonatype.org/"
61-
if (isSnapshot.value)
62-
Some("snapshots" at nexus + "content/repositories/snapshots")
63-
else
64-
Some("releases" at nexus + "service/local/staging/deploy/maven2")
65-
},
66-
// For all Sonatype accounts created on or after February 2021
67-
sonatypeCredentialHost := "s01.oss.sonatype.org",
68-
Test / parallelExecution := true,
69-
Test / publishArtifact := false,
70-
usePgpKeyHex("F7E440260BAE93EB4AD2723D6613CA76E011F638")
71-
)
35+
lazy val root = (project in file(".")).settings(
36+
name := "scala-js-env-playwright",
37+
libraryDependencies ++= Seq(
38+
"com.microsoft.playwright" % "playwright" % "1.49.0",
39+
"org.scala-js" %% "scalajs-js-envs" % "1.4.0",
40+
"com.google.jimfs" % "jimfs" % "1.3.0",
41+
"com.outr" %% "scribe" % "3.15.2",
42+
"org.typelevel" %% "cats-effect" % "3.5.7",
43+
"org.scala-js" %% "scalajs-js-envs-test-kit" % "1.4.0" % Test,
44+
"com.novocode" % "junit-interface" % "0.11" % Test
45+
),
46+
javacOptions += "-nowarn",
47+
javacOptions -= "-Werror",
48+
releaseProcess := Seq[ReleaseStep](
49+
checkSnapshotDependencies,
50+
inquireVersions,
51+
runClean,
52+
runTest,
53+
setReleaseVersion,
54+
commitReleaseVersion,
55+
tagRelease,
56+
ReleaseStep(action = Command.process("publishSigned", _)),
57+
setNextVersion,
58+
commitNextVersion
59+
),
60+
publishTo := {
61+
val nexus = "https://s01.oss.sonatype.org/"
62+
if (isSnapshot.value)
63+
Some("snapshots" at nexus + "content/repositories/snapshots")
64+
else
65+
Some("releases" at nexus + "service/local/staging/deploy/maven2")
66+
},
67+
// For all Sonatype accounts created on or after February 2021
68+
sonatypeCredentialHost := "s01.oss.sonatype.org",
69+
Test / parallelExecution := true,
70+
Test / publishArtifact := false,
71+
usePgpKeyHex("F7E440260BAE93EB4AD2723D6613CA76E011F638")
72+
)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.9.7
1+
sbt.version=1.10.7

project/metals.sbt

Lines changed: 0 additions & 11 deletions
This file was deleted.

project/plugins.sbt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
val sbtTypelevelVersion = "0.6.4"
2-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1")
3-
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.3.0")
4-
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
5-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")
6-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9")
1+
val sbtTypelevelVersion = "0.7.5"
2+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.0")
3+
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
4+
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
5+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2")
6+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.2")
77
addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTypelevelVersion)
88
addSbtPlugin("org.typelevel" % "sbt-typelevel-scalafix" % sbtTypelevelVersion)
99
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion)
10+
11+
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "2.0.6")

project/project/metals.sbt

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/main/java/jsenv/DriverJar.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
public class DriverJar extends Driver {
3434
private static final String PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD";
3535
private static final String SELENIUM_REMOTE_URL = "SELENIUM_REMOTE_URL";
36-
static final String PLAYWRIGHT_NODEJS_PATH = "PLAYWRIGHT_NODEJS_PATH";
3736
private final Path driverTempDir;
3837
private Path preinstalledNodePath;
3938

@@ -68,7 +67,7 @@ protected void initialize(Boolean installBrowsers) throws Exception {
6867
env.put(PLAYWRIGHT_NODEJS_PATH, preinstalledNodePath.toString());
6968
}
7069
extractDriverToTempDir();
71-
logMessage("extracted driver from jar to " + driverPath());
70+
logMessage("extracted driver from jar to " + driverDir());
7271
if (installBrowsers)
7372
installBrowsers(env);
7473
}
@@ -79,14 +78,14 @@ private void installBrowsers(Map<String, String> env) throws IOException, Interr
7978
skip = System.getenv(PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD);
8079
}
8180
if (skip != null && !"0".equals(skip) && !"false".equals(skip)) {
82-
System.out.println("Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set");
81+
logMessage("Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set");
8382
return;
8483
}
8584
if (env.get(SELENIUM_REMOTE_URL) != null || System.getenv(SELENIUM_REMOTE_URL) != null) {
8685
logMessage("Skipping browsers download because `SELENIUM_REMOTE_URL` env variable is set");
8786
return;
8887
}
89-
Path driver = driverPath();
88+
Path driver = driverDir();
9089
if (!Files.exists(driver)) {
9190
throw new RuntimeException("Failed to find driver: " + driver);
9291
}
@@ -119,7 +118,7 @@ private FileSystem initFileSystem(URI uri) throws IOException {
119118
}
120119

121120
public static URI getDriverResourceURI() throws URISyntaxException {
122-
// ClassLoader classloader = Thread.currentThread().getContextClassLoader();
121+
// ClassLoader classloader = Thread.currentThread().getContextClassLoader();
123122
ClassLoader classloader = DriverJar.class.getClassLoader();
124123
return classloader.getResource("driver/" + platformDir()).toURI();
125124
}
@@ -129,7 +128,7 @@ void extractDriverToTempDir() throws URISyntaxException, IOException {
129128
URI uri = maybeExtractNestedJar(originalUri);
130129

131130
// Create zip filesystem if loading from jar.
132-
FileSystem fileSystem = "jar".equals(uri.getScheme()) ? initFileSystem(uri) : null;
131+
try (FileSystem fileSystem = "jar".equals(uri.getScheme()) ? initFileSystem(uri) : null) {
133132
Path srcRoot = Paths.get(uri);
134133
// jar file system's .relativize gives wrong results when used with
135134
// spring-boot-maven-plugin, convert to the default filesystem to
@@ -159,8 +158,6 @@ void extractDriverToTempDir() throws URISyntaxException, IOException {
159158
throw new RuntimeException("Failed to extract driver from " + uri + ", full uri: " + originalUri, e);
160159
}
161160
});
162-
if (fileSystem != null) {
163-
fileSystem.close();
164161
}
165162
}
166163

@@ -175,8 +172,7 @@ private URI maybeExtractNestedJar(final URI uri) throws URISyntaxException {
175172
}
176173
String innerJar = String.join(JAR_URL_SEPARATOR, parts[0], parts[1]);
177174
URI jarUri = new URI(innerJar);
178-
try {
179-
FileSystem fs = FileSystems.newFileSystem(jarUri, Collections.emptyMap());
175+
try (FileSystem fs = FileSystems.newFileSystem(jarUri, Collections.emptyMap())) {
180176
Path fromPath = Paths.get(jarUri);
181177
Path toPath = driverTempDir.resolve(fromPath.getFileName().toString());
182178
Files.copy(fromPath, toPath);
@@ -212,7 +208,7 @@ private static String platformDir() {
212208
}
213209

214210
@Override
215-
protected Path driverDir() {
211+
public Path driverDir() {
216212
return driverTempDir;
217213
}
218214
}

0 commit comments

Comments
 (0)