diff --git a/project/AssembleDatasource.scala b/project/AssembleDatasource.scala index 71749bd6..7638f2f4 100644 --- a/project/AssembleDatasource.scala +++ b/project/AssembleDatasource.scala @@ -10,6 +10,7 @@ import scala.sys.process._ import java.util.stream.Collectors import java.lang.Runtime +import io.circe.Json import sbt.{Cache => _, MavenRepository => _, Tags => _, Task => _, _} import sbt.Keys._ import scalaz._, Scalaz._ @@ -137,13 +138,13 @@ object AssembleDatasource { // the .plugin file requires all dependency jar paths // to be relative to the plugins folder - classPath = fetchedJarFiles.map(p => datasourcePluginsFolder.toPath.relativize(p.toPath)) ++ Seq(relativeDatasourceJarPath) + classPath = fetchedJarFiles.map(p => datasourcePluginsFolder.toPath.relativize(p.toPath)) ++ List(relativeDatasourceJarPath) - // format the classPath as readable json for the .plugin file - cpJson = classPath.map(s => "\"" + s + "\"").mkString("[\n ", ",\n ", "\n ]") + cpJson = Json.arr(classPath.map(_.toString).map(Json.fromString(_)) :_*) + mainJar = Json.fromString(relativeDatasourceJarPath) // include the datasource jar and classpath into the .plugin file - outJson = s"""{\n "mainJar": "$relativeDatasourceJarPath",\n "classPath": $cpJson\n}""" + outJson = Json.obj("mainJar" -> mainJar, "classPath" -> cpJson).spaces2 // delete an old .plugin file, write the new one _ <- Task.delay { diff --git a/project/build.sbt b/project/build.sbt index 2e10c0a5..d257b23f 100644 --- a/project/build.sbt +++ b/project/build.sbt @@ -7,7 +7,8 @@ libraryDependencies += "org.kohsuke" % "github-api" % "1.59" exclude("org.jenkin // should remain the newest coursier version. libraryDependencies ++= Seq( "io.get-coursier" %% "coursier" % "1.0.1", - "io.get-coursier" %% "coursier-cache" % "1.0.1" + "io.get-coursier" %% "coursier-cache" % "1.0.1", + "io.circe" %% "circe-core" % "0.9.3" ) scalacOptions --= Seq( diff --git a/version.sbt b/version.sbt index 867df91f..42cf5c4d 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "3.0.0" \ No newline at end of file +version in ThisBuild := "3.1.0" \ No newline at end of file