Skip to content

Commit

Permalink
upgrade and standardise requests dependency to 0.8.0 (#3082)
Browse files Browse the repository at this point in the history
* upgrade and standardise requests dependency to 0.8.0

* upgrade other com-haoyili deps

* adapt to latest upickle api
  • Loading branch information
mpollmeier authored Jul 12, 2023
1 parent 18d33be commit 3922ef9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions console/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name := "console"
enablePlugins(JavaAppPackaging)

val ScoptVersion = "4.1.0"
val CaskVersion = "0.8.3"
val CaskVersion = "0.9.1"
val CirceVersion = "0.14.5"
val ZeroturnaroundVersion = "1.15"

Expand All @@ -25,7 +25,7 @@ libraryDependencies ++= Seq(
"io.circe" %% "circe-generic" % CirceVersion,
"io.circe" %% "circe-parser" % CirceVersion,
"org.zeroturnaround" % "zt-zip" % ZeroturnaroundVersion,
"com.lihaoyi" %% "os-lib" % "0.8.1",
"com.lihaoyi" %% "os-lib" % "0.9.1",
"com.lihaoyi" %% "pprint" % "0.7.3",
"com.lihaoyi" %% "cask" % CaskVersion,
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
Expand Down
2 changes: 1 addition & 1 deletion joern-cli/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependsOn(Projects.console, Projects.console % "test->test", Projects.dataflowen

libraryDependencies ++= Seq(
"io.shiftleft" %% "codepropertygraph" % Versions.cpg,
"com.lihaoyi" %% "requests" % "0.7.1",
"com.lihaoyi" %% "requests" % Versions.requests,
"com.github.scopt" %% "scopt" % "4.1.0",
"org.reflections" % "reflections" % "0.10.2",
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
Expand Down
2 changes: 1 addition & 1 deletion joern-cli/frontends/gosrc2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependsOn(Projects.dataflowengineoss, Projects.x2cpg % "compile->compile;test->t
libraryDependencies ++= Seq(
"io.shiftleft" %% "codepropertygraph" % Versions.cpg,
"org.scalatest" %% "scalatest" % Versions.scalatest % Test,
"com.lihaoyi" %% "upickle" % "2.0.0",
"com.lihaoyi" %% "upickle" % Versions.upickle,
"com.fasterxml.jackson.core" % "jackson-databind" % "2.15.2",
"com.typesafe" % "config" % "1.4.2",
"com.michaelpollmeier" % "versionsort" % "1.0.11",
Expand Down
2 changes: 1 addition & 1 deletion joern-cli/frontends/jssrc2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ astGenVersion := appProperties.value.getString("jssrc2cpg.astgen_version")

libraryDependencies ++= Seq(
"io.shiftleft" %% "codepropertygraph" % Versions.cpg,
"com.lihaoyi" %% "upickle" % "2.0.0",
"com.lihaoyi" %% "upickle" % Versions.upickle,
"com.fasterxml.jackson.core" % "jackson-databind" % "2.15.2",
"com.typesafe" % "config" % "1.4.2",
"com.michaelpollmeier" % "versionsort" % "1.0.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ trait AstCreatorHelper { this: AstCreator =>
protected def safeBool(node: Value, key: String): Option[Boolean] =
if (hasKey(node, key)) Try(node(key).bool).toOption else None

protected def safeObj(node: Value, key: String): Option[mutable.LinkedHashMap[String, Value]] = Try(
protected def safeObj(node: Value, key: String): Option[upickle.core.LinkedHashMap[String, Value]] = Try(
node(key).obj
) match {
case Success(value) if value.nonEmpty => Option(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.joern.jssrc2cpg.parser

import ujson.AstTransformer
import ujson.Value
import upickle.core.Util
import upickle.core.ParseUtils
import upickle.core.Visitor
import upickle.core.compat.Factory
import upickle.core.ArrVisitor
Expand Down Expand Up @@ -35,7 +35,7 @@ object JsValueVisitor extends AstTransformer[Value] {
adapted.transform(j, f)

override def visitJsonableObject(length: Int, index: Int): ObjVisitor[Value, Value] =
new JsAstObjVisitor[mutable.LinkedHashMap[String, Value]](xs => ujson.Obj(xs))
new JsAstObjVisitor[upickle.core.LinkedHashMap[String, Value]](xs => ujson.Obj(xs))

override def visitArray(length: Int, index: Int): ArrVisitor[Value, Value] =
new JsAstArrVisitor[ArrayBuffer](xs => ujson.Arr(xs))
Expand All @@ -58,7 +58,7 @@ object JsValueVisitor extends AstTransformer[Value] {
} else {
// We accept the loss of precision here.
// See: https://github.com/joernio/joern/issues/2440
Try(Util.parseIntegralNum(s, decIndex, expIndex, index)) match {
Try(ParseUtils.parseIntegralNum(s, decIndex, expIndex, index)) match {
case Success(num) => num.toDouble
case Failure(_: NumberFormatException) => s.toString.toDouble
case Failure(other: Throwable) => throw other
Expand Down
4 changes: 2 additions & 2 deletions joern-cli/frontends/kotlin2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ dependsOn(
)

libraryDependencies ++= Seq(
"com.lihaoyi" %% "requests" % "0.7.0",
"com.lihaoyi" %% "ujson" % "2.0.0",
"com.lihaoyi" %% "requests" % Versions.requests,
"com.lihaoyi" %% "ujson" % Versions.upickle,
"com.squareup.tools.build" % "maven-archeologist" % "0.0.10",
"io.shiftleft" %% "codepropertygraph" % Versions.cpg,
"org.gradle" % "gradle-tooling-api" % Versions.gradleTooling,
Expand Down
4 changes: 2 additions & 2 deletions joern-cli/frontends/php2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ val phpParserDlUrl = s"https://github.com/joernio/PHP-Parser/releases/download
dependsOn(Projects.dataflowengineoss, Projects.x2cpg % "compile->compile;test->test")

libraryDependencies ++= Seq(
"com.lihaoyi" %% "ujson" % "2.0.0",
"com.lihaoyi" %% "upickle" % "2.0.0",
"com.lihaoyi" %% "upickle" % Versions.upickle,
"com.lihaoyi" %% "ujson" % Versions.upickle,
"io.shiftleft" %% "codepropertygraph" % Versions.cpg,
"org.scalatest" %% "scalatest" % Versions.scalatest % Test,
"io.circe" %% "circe-core" % "0.15.0-M1"
Expand Down
2 changes: 2 additions & 0 deletions project/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ object Versions {
val json4s = "4.0.6"
val gradleTooling = "8.2"
val circe = "0.14.5"
val requests = "0.8.0"
val upickle = "3.1.2"

private def parseVersion(key: String): String = {
val versionRegexp = s""".*val $key[ ]+=[ ]?"(.*?)"""".r
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.0
sbt.version=1.9.2

0 comments on commit 3922ef9

Please sign in to comment.