Skip to content

Commit

Permalink
Merge pull request scala#10898 from SethTisue/bye-bye-jna-hello-jni
Browse files Browse the repository at this point in the history
REPL: JLine: stop using deprecated JNA
  • Loading branch information
SethTisue authored Oct 28, 2024
2 parents 12f5987 + 6c3d9bf commit c03e3c0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 254 deletions.
19 changes: 6 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ val scalacheckDep = "org.scalacheck" %% "scalacheck"
val jolDep = "org.openjdk.jol" % "jol-core" % "0.16"
val asmDep = "org.scala-lang.modules" % "scala-asm" % versionProps("scala-asm.version")
val jlineDep = "org.jline" % "jline" % versionProps("jline.version") classifier "jdk8"
val jnaDep = "net.java.dev.jna" % "jna" % versionProps("jna.version")
val jlineDeps = Seq(jlineDep, jnaDep)
val testInterfaceDep = "org.scala-sbt" % "test-interface" % "1.0"
val diffUtilsDep = "io.github.java-diff-utils" % "java-diff-utils" % "4.12"
val compilerInterfaceDep = "org.scala-sbt" % "compiler-interface" % "1.10.3"
Expand Down Expand Up @@ -533,9 +531,9 @@ lazy val compiler = configureAsSubproject(project)
description := "Scala Compiler",
libraryDependencies += asmDep,
libraryDependencies += diffUtilsDep,
// These are only needed for the POM:
// This is only needed for the POM:
// TODO: jline dependency is only needed for the REPL shell, which should move to its own jar
libraryDependencies ++= jlineDeps,
libraryDependencies += jlineDep,
buildCharacterPropertiesFile := (Compile / resourceManaged).value / "scala-buildcharacter.properties",
Compile / resourceGenerators += generateBuildCharacterPropertiesFile.map(file => Seq(file)).taskValue,
// this a way to make sure that classes from interactive and scaladoc projects
Expand Down Expand Up @@ -588,7 +586,6 @@ lazy val compiler = configureAsSubproject(project)
|org.jline.style.*;resolution:=optional
|org.jline.terminal;resolution:=optional
|org.jline.terminal.impl;resolution:=optional
|org.jline.terminal.impl.jna.*;resolution:=optional
|org.jline.terminal.spi;resolution:=optional
|org.jline.utils;resolution:=optional
|org.jline.builtins;resolution:=optional
Expand Down Expand Up @@ -633,7 +630,7 @@ lazy val replFrontend = configureAsSubproject(project, srcdir = Some("repl-front
.settings(fatalWarningsSettings)
.settings(publish / skip := true)
.settings(
libraryDependencies ++= jlineDeps,
libraryDependencies += jlineDep,
name := "scala-repl-frontend",
)
.settings(
Expand Down Expand Up @@ -1170,7 +1167,7 @@ lazy val scalaDist = Project("scalaDist", file(".") / "target" / "scala-dist-dis
(htmlOut ** "*.html").get ++ (fixedManOut ** "*.1").get
}.taskValue,
Compile / managedResourceDirectories := Seq((Compile / resourceManaged).value),
libraryDependencies ++= jlineDeps,
libraryDependencies += jlineDep,
apiURL := None,
fixPom(
"/project/name" -> <name>Scala Distribution Artifacts</name>,
Expand Down Expand Up @@ -1332,7 +1329,7 @@ lazy val dist = (project in file("dist"))
.settings(commonSettings)
.settings(
bspEnabled := false,
libraryDependencies ++= jlineDeps,
libraryDependencies += jlineDep,
mkBin := mkBinImpl.value,
mkQuick := Def.task {
val cp = (testP / IntegrationTest / fullClasspath).value
Expand All @@ -1347,11 +1344,7 @@ lazy val dist = (project in file("dist"))
Compile / packageBin := {
val targetDir = (ThisBuild / buildDirectory).value / "pack" / "lib"
val jlineJAR = findJar((Compile / dependencyClasspath).value, jlineDep).get.data
val jnaJAR = findJar((Compile / dependencyClasspath).value, jnaDep).get.data
val mappings = Seq(
(jlineJAR, targetDir / "jline.jar"),
(jnaJAR, targetDir / "jna.jar"),
)
val mappings = Seq((jlineJAR, targetDir / "jline.jar"))
IO.copy(mappings, CopyOptions() withOverwrite true)
targetDir
},
Expand Down
5 changes: 0 additions & 5 deletions doc/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ limitations under the License.
This software includes projects with the following licenses,
which are also included in the `licenses/` directory:

### [Apache License](http://www.apache.org/licenses/LICENSE-2.0.html)
This license is used by the following third-party libraries:

* JNA

### [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
This license is used by the following third-party libraries:

Expand Down
11 changes: 0 additions & 11 deletions doc/License.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ Unless required by applicable law or agreed to in writing, software distributed
\f0\b0\fs28 \cf2 This software includes projects with the following licenses, which are also included in the\'a0\cb5 licenses/\cb1 \'a0directory:\
\pard\pardeftab720\sl300\partightenfactor0

\f1\b \cf3 \
\pard\pardeftab720\sl360\sa320\partightenfactor0
{\field{\*\fldinst{HYPERLINK "http://www.apache.org/licenses/LICENSE-2.0.html"}}{\fldrslt \cf3 Apache License}}\cf2 \
\pard\pardeftab720\sl360\sa320\partightenfactor0
\f0\b0 \cf2 This license is used by the following third-party libraries:\
\pard\tx220\tx720\pardeftab720\li720\fi-720\sl360\partightenfactor0
\ls1\ilvl0\cf2 \kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
JNA\
\pard\pardeftab720\sl300\partightenfactor0

\f1\b \cf3 \
\pard\pardeftab720\sl360\sa320\partightenfactor0
{\field{\*\fldinst{HYPERLINK "http://www.opensource.org/licenses/bsd-license.php"}}{\fldrslt \cf3 BSD License}}\cf2 \
Expand Down
205 changes: 0 additions & 205 deletions doc/licenses/apache_jna.txt

This file was deleted.

Loading

0 comments on commit c03e3c0

Please sign in to comment.