Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Sep 16, 2022
1 parent 570d512 commit 7cf5f2d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
12 changes: 5 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ import sbtcrossproject.CrossType

// Scala versions
val scala213 = "2.13.8"
val scala212 = "2.12.16"
val scala3 = List("3.2.0")
val scala2 = List(scala213, scala212)
val scala2 = List(scala213)
val allScalaVersions = scala2 ::: scala3

ThisBuild / organization := "com.outr"
ThisBuild / version := "3.4.1"
ThisBuild / version := "3.4.2-SNAPSHOT"
ThisBuild / scalaVersion := scala213
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
ThisBuild / sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
ThisBuild / publishTo := sonatypePublishTo.value
ThisBuild / publishTo := sonatypePublishToBundle.value
ThisBuild / publishConfiguration := publishConfiguration.value.withOverwrite(true)
ThisBuild / sonatypeProfileName := "com.outr"
ThisBuild / publishMavenStyle := true
ThisBuild / licenses := Seq("MIT" -> url("https://github.com/outr/profig/blob/master/LICENSE"))
ThisBuild / sonatypeProjectHosting := Some(xerial.sbt.Sonatype.GitHubHosting("outr", "profig", "matt@outr.com"))
ThisBuild / homepage := Some(url("https://github.com/outr/profig"))
Expand All @@ -32,7 +30,7 @@ ThisBuild / developers := List(
Developer(id="darkfrog", name="Matt Hicks", email="matt@matthicks.com", url=url("https://matthicks.com"))
)

val fabric: String = "1.3.0"
val fabric: String = "1.5.0"

val collectionCompat: String = "2.8.1"

Expand All @@ -52,7 +50,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
.settings(
name := "profig",
libraryDependencies ++= Seq(
"com.outr" %%% "fabric-parse" % fabric,
"com.outr" %%% "fabric-io" % fabric,
"org.scala-lang.modules" %%% "scala-collection-compat" % collectionCompat,
"org.scalatest" %% "scalatest" % scalaTest % "test"
),
Expand Down
11 changes: 6 additions & 5 deletions core/jvm/src/main/scala/profig/ProfigJson.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package profig

import fabric._
import fabric.io.{Format, JsonParser}

import java.util.Properties

Expand Down Expand Up @@ -34,22 +35,22 @@ object ProfigJson {
}

object Json extends ProfigJson {
override def apply(content: String): Json = fabric.parse.JsonParser.parse(content)
override def apply(content: String): Json = JsonParser(content, Format.Json)
}

object Properties extends ProfigJson {
override def apply(content: String): Json = fabric.parse.Properties.parse(content)
override def apply(content: String): Json = JsonParser(content, Format.Properties)
}

object Hocon extends ProfigJson {
override def apply(content: String): Json = fabric.parse.Hocon.parse(content)
override def apply(content: String): Json = JsonParser(content, Format.Hocon)
}

object XML extends ProfigJson {
override def apply(content: String): Json = fabric.parse.XML.parse(content)
override def apply(content: String): Json = JsonParser(content, Format.XML)
}

object Yaml extends ProfigJson {
override def apply(content: String): Json = fabric.parse.Yaml.parse(content)
override def apply(content: String): Json = JsonParser(content, Format.Yaml)
}
}
11 changes: 5 additions & 6 deletions core/shared/src/test/scala/spec/ProfigSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package spec

import profig._
import fabric._
import fabric.parse.JsonParser
import fabric.io.{Format, JsonParser}
import fabric.rw._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
Expand Down Expand Up @@ -107,19 +107,18 @@ class ProfigSpec extends AnyWordSpec with Matchers {
profig.json should be(obj("test" -> "one"))
}
"merge two Json objects" in {
val json1 = JsonParser.parse(
val json1 = JsonParser(
"""{
| "one": 1,
| "two": 2,
| "three": 3
|}""".stripMargin)
val json2 = JsonParser.parse(
|}""".stripMargin, Format.Json)
val json2 = JsonParser(
"""{
| "three": "tres",
| "four": "quatro",
| "five": "cinco"
|}""".stripMargin
)
|}""".stripMargin, Format.Json)
val merged = Json.merge(json1, json2)
merged should be(obj(
"one" -> 1,
Expand Down
2 changes: 1 addition & 1 deletion publish.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

sbt +clean +test +coreJS/publishSigned +coreJVM/publishSigned sonatypeRelease
sbt +clean +test +publishSigned sonatypeBundleRelease

0 comments on commit 7cf5f2d

Please sign in to comment.