Skip to content

Commit adbbf0c

Browse files
Prefer jna-wrapper where possible (#13021)
1 parent 525a878 commit adbbf0c

File tree

21 files changed

+2537
-284
lines changed

21 files changed

+2537
-284
lines changed

build.sbt

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ GatherLicenses.distributions := Seq(
184184
"Microsoft",
185185
Distribution.sbtProjects(`std-microsoft`)
186186
),
187-
makeStdLibDistribution("Tableau", Distribution.sbtProjects(`std-tableau`))
187+
makeStdLibDistribution(
188+
"Tableau",
189+
Distribution.sbtProjects(`std-tableau`, `jna-wrapper`)
190+
)
188191
)
189192

190193
GatherLicenses.licenseConfigurations := Set("compile")
@@ -1203,9 +1206,8 @@ lazy val filewatcher = project
12031206
compileOrder := CompileOrder.ScalaThenJava,
12041207
version := "0.1",
12051208
libraryDependencies ++= slf4jApi ++ Seq(
1206-
"io.methvin" % "directory-watcher" % directoryWatcherVersion,
1207-
"commons-io" % "commons-io" % commonsIoVersion,
1208-
"org.scalatest" %% "scalatest" % scalatestVersion % Test
1209+
"commons-io" % "commons-io" % commonsIoVersion,
1210+
"org.scalatest" %% "scalatest" % scalatestVersion % Test
12091211
),
12101212
Compile / moduleDependencies ++= slf4jApi,
12111213
Compile / internalModuleDependencies := Seq(
@@ -1217,6 +1219,7 @@ lazy val filewatcher = project
12171219
.dependsOn(testkit % Test)
12181220
.dependsOn(`logging-service-logback` % "test->test")
12191221
.dependsOn(`directory-watcher-wrapper`)
1222+
.dependsOn(`jna-wrapper` % Test)
12201223

12211224
lazy val `logging-truffle-connector` = project
12221225
.in(file("lib/scala/logging-truffle-connector"))
@@ -1251,8 +1254,7 @@ lazy val `scala-libs-wrapper` = project
12511254
libraryDependencies ++= circe ++ scalaReflect ++ slf4jApi ++ Seq(
12521255
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
12531256
"org.typelevel" %% "cats-core" % catsVersion,
1254-
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion,
1255-
"net.java.dev.jna" % "jna" % jnaVersion
1257+
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion
12561258
),
12571259
Compile / moduleDependencies ++= scalaLibrary ++ scalaReflect ++ Seq(
12581260
"org.slf4j" % "slf4j-api" % slf4jVersion
@@ -1262,10 +1264,7 @@ lazy val `scala-libs-wrapper` = project
12621264
(Compile / fullClasspath).value,
12631265
scalaLibrary ++
12641266
scalaReflect ++
1265-
slf4jApi ++
1266-
Seq(
1267-
"net.java.dev.jna" % "jna" % jnaVersion
1268-
),
1267+
slf4jApi,
12691268
streams.value.log,
12701269
moduleName.value,
12711270
scalaBinaryVersion.value,
@@ -1377,6 +1376,9 @@ lazy val `jna-wrapper` = project
13771376
Map(
13781377
javaModuleName.value -> jna
13791378
)
1379+
},
1380+
assemblyMergeStrategy := { case _ =>
1381+
MergeStrategy.preferProject
13801382
}
13811383
)
13821384

@@ -1396,18 +1398,14 @@ lazy val `directory-watcher-wrapper` = project
13961398
modularFatJarWrapperSettings,
13971399
scalaModuleDependencySetting,
13981400
libraryDependencies ++= slf4jApi ++ Seq(
1399-
"io.methvin" % "directory-watcher" % directoryWatcherVersion,
1400-
"net.java.dev.jna" % "jna" % jnaVersion
1401+
"io.methvin" % "directory-watcher" % directoryWatcherVersion exclude ("net.java.dev.jna", "jna")
14011402
),
14021403
javaModuleName := "org.enso.directory.watcher.wrapper",
14031404
assembly / assemblyExcludedJars := {
14041405
JPMSUtils.filterModulesFromClasspath(
14051406
(Compile / dependencyClasspath).value,
14061407
scalaLibrary ++
1407-
slf4jApi ++
1408-
Seq(
1409-
"net.java.dev.jna" % "jna" % jnaVersion
1410-
),
1408+
slf4jApi,
14111409
streams.value.log,
14121410
moduleName.value,
14131411
scalaBinaryVersion.value,
@@ -5476,8 +5474,7 @@ lazy val `std-tableau` = project
54765474
Compile / packageBin / artifactPath :=
54775475
`std-tableau-polyglot-root` / "std-tableau.jar",
54785476
libraryDependencies ++= Seq(
5479-
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
5480-
"net.java.dev.jna" % "jna-platform" % jnaVersion
5477+
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided"
54815478
),
54825479
// Extract native libraries from tableau's jar, and put them under
54835480
// Standard/Tableau/polyglot/lib directory.
@@ -5513,6 +5510,7 @@ lazy val `std-tableau` = project
55135510
`std-tableau-native-libs`,
55145511
tableauVersion,
55155512
jnaVersion,
5513+
(`jna-wrapper` / Compile / exportedModule).value,
55165514
updateReport = libraryUpdates,
55175515
unmanagedClasspath = unmanagedClasspath,
55185516
logger = logger,

distribution/launcher/THIRD-PARTY/NOTICE

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ The license file can be found at `licenses/APACHE2.0`.
8181
Copyright notices related to this dependency can be found in the directory `io.circe.circe-parser_2.13-0.14.7`.
8282

8383

84-
'jna', licensed under the Apache-2.0, is distributed with the launcher.
85-
The license file can be found at `licenses/APACHE2.0`.
86-
Copyright notices related to this dependency can be found in the directory `net.java.dev.jna.jna-5.14.0`.
87-
88-
8984
'commons-compress', licensed under the Apache-2.0, is distributed with the launcher.
9085
The license file can be found at `licenses/APACHE2.0`.
9186
Copyright notices related to this dependency can be found in the directory `org.apache.commons.commons-compress-1.23.0`.

distribution/launcher/THIRD-PARTY/net.java.dev.jna.jna-5.14.0/NOTICES

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

distribution/lib/Standard/Tableau/0.0.0-dev/THIRD-PARTY/NOTICE

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,3 @@ Copyright 2020 - 2025 New Byte Order sp. z o. o.
55
The license file can be found at `licenses/APACHE2.0`.
66
Copyright notices related to this dependency can be found in the directory `net.java.dev.jna.jna-5.14.0`.
77

8-
9-
'jna-platform', licensed under the Apache-2.0, is distributed with the Tableau.
10-
The license file can be found at `licenses/APACHE2.0`.
11-
Copyright notices related to this dependency can be found in the directory `net.java.dev.jna.jna-platform-5.14.0`.
12-

distribution/lib/Standard/Tableau/0.0.0-dev/THIRD-PARTY/net.java.dev.jna.jna-platform-5.14.0/NOTICES

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

distribution/project-manager/THIRD-PARTY/NOTICE

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,6 @@ The license file can be found at `licenses/APACHE2.0`.
341341
Copyright notices related to this dependency can be found in the directory `jakarta.inject.jakarta.inject-api-2.0.1`.
342342

343343

344-
'jna', licensed under the Apache-2.0, is distributed with the project-manager.
345-
The license file can be found at `licenses/APACHE2.0`.
346-
Copyright notices related to this dependency can be found in the directory `net.java.dev.jna.jna-5.14.0`.
347-
348-
349344
'commons-compress', licensed under the Apache-2.0, is distributed with the project-manager.
350345
The license file can be found at `licenses/APACHE2.0`.
351346
Copyright notices related to this dependency can be found in the directory `org.apache.commons.commons-compress-1.23.0`.

distribution/project-manager/THIRD-PARTY/net.java.dev.jna.jna-5.14.0/NOTICES

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

0 commit comments

Comments
 (0)