Skip to content

Commit ada047f

Browse files
ERSUCCTheBizzle
authored andcommitted
Initial conversion to Scala 3.7.0
1 parent 1b5fc96 commit ada047f

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ organization := "org.nlogo.languagelibrary"
33
version := "3.0.2"
44
isSnapshot := true
55

6-
scalaVersion := "2.13.16"
7-
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature", "-Xfatal-warnings", "-Xlint", "-release", "11")
6+
scalaVersion := "3.7.0"
7+
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature", "-Xfatal-warnings", "-release", "11")
88
Compile / scalaSource := baseDirectory.value / "src"
99

1010
resolvers += "netlogo" at "https://dl.cloudsmith.io/public/netlogo/netlogo/maven/"
1111

1212
libraryDependencies ++= Seq(
13-
"org.nlogo" % "netlogo" % "7.0.0-internal1-df97144"
13+
"org.nlogo" % "netlogo" % "7.0.0-beta1"
1414
, "org.json4s" %% "json4s-jackson" % "4.0.7"
1515
// not used by this library, but needed for NetLogo
1616
, "org.jogamp.jogl" % "jogl-all" % "2.4.0" from "https://jogamp.org/deployment/archive/rc/v2.4.0/jar/jogl-all.jar"

src/org/nlogo/langextension/Convert.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Convert(val extensionLongName: String) {
2323
case set: AgentSet => set.toLogoList.map(agent => agentToJson(agent.asInstanceOf[Agent], Set()))
2424
// I danced and romped but couldn't find a way to get Scala to accept a match like `iter: Iterable[_ <: AnyRef]`
2525
// without some cryptic error. -Jeremy B Octover 2022
26-
case iter if iter.isInstanceOf[Iterable[_]] => iter.asInstanceOf[Iterable[AnyRef]].map(toJson)
26+
case iter if iter.isInstanceOf[Iterable[?]] => iter.asInstanceOf[Iterable[AnyRef]].map(toJson)
2727
case o => parse(Dump.logoObject(o, readable = true, exporting = false))
2828
}
2929

src/org/nlogo/langextension/Subprocess.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.json4s.JsonAST._
55
import org.json4s.JsonDSL._
66
import org.json4s.jackson.JsonMethods
77
import org.json4s.jackson.JsonMethods.{ compact, parse, render }
8+
import org.json4s.jvalue2monadic
89

910
import org.nlogo.api.Exceptions.ignoring
1011
import org.nlogo.api.{ ExtensionException, Workspace }
@@ -189,7 +190,7 @@ object Subprocess {
189190
}
190191

191192
private def getSysCmdOutput(cmd: String*): List[String] = {
192-
val proc = new ProcessBuilder(cmd: _*).redirectError(Redirect.PIPE).redirectInput(Redirect.PIPE).start()
193+
val proc = new ProcessBuilder(cmd*).redirectError(Redirect.PIPE).redirectInput(Redirect.PIPE).start()
193194
val in = new BufferedReader(new InputStreamReader(proc.getInputStream))
194195
Iterator.continually(in.readLine()).takeWhile(_ != null).toList
195196
}

src/org/nlogo/langextension/config/Config.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.nlogo.api.{ FileIO, ExtensionException }
99

1010
object Config {
1111

12-
def getExtensionRuntimeDirectory(extensionClass: Class[_], codeName: String) = {
12+
def getExtensionRuntimeDirectory(extensionClass: Class[?], codeName: String) = {
1313
val configLoader = extensionClass.getClassLoader.asInstanceOf[java.net.URLClassLoader]
1414
val loaderUrls = configLoader.getURLs()
1515
val loaderFiles = loaderUrls.map( (url) => new File(url.toURI.getPath) )
@@ -21,7 +21,7 @@ object Config {
2121
extensionFile.getParentFile
2222
}
2323

24-
def createForPropertyFile(extensionClass: Class[_], codeName: String): Config = {
24+
def createForPropertyFile(extensionClass: Class[?], codeName: String): Config = {
2525
val propertyFileName = s"$codeName.properties"
2626
val extensionRuntimeDirectory = getExtensionRuntimeDirectory(extensionClass, codeName)
2727
val maybePropertyFile = new File(extensionRuntimeDirectory, propertyFileName)

0 commit comments

Comments
 (0)