Git Product home page Git Product logo

sconfig's Introduction

sconfig

CI Scala.js

Configuration library written in Scala which is a direct translation of the original widely used Java library.

Scala JVM, Scala Native, and Scala.js are supported. Scala JVM is fully supported whereas the other platforms support a subset of the full API.

For motivation and background about this project see the PR to the original project. The TLDR is the library was ported to Scala to support Scala Native so scalafmt which uses HOCON configuration could be compiled into a native application.

Care has been taken to keep the API the same but changes were needed when moving from the Java API. Using Java is also possible as demonstrated by including the working Java examples.

If you are looking for the original Java API, see https://github.com/lightbend/config.

Getting Started

Maven Central

libraryDependencies += "org.ekrich" %% "sconfig" % "x.y.z"

To use in sbt, replace x.y.z with the version from Maven Central badge above.

For non-JVM projects use %%% but please refer to the guide below for critical Scala Native and Scala.js usage information. The TLDR is that you must add a java.time library dependency to your project. Refer to the sjavatime home page for the current version or alternative java.time libraries.

Scala Native and Scala.js - A guide to using Scala Native and Scala.js.

All available versions can be seen at the Maven Repository.

Cross Build Versions

Scala.js

Scala Version JVM Scala.js (1.x) Native (0.5.x)
2.12.x
2.13.x
3.x.x
  • Scala Native 0.5.x support from 0.7.0.
  • Scala 3 support on Scala Native 0.4.3-RC2 or greater.
  • Scala 2.11 support through version 1.4.9.

Usage and Help

scaladoc Discord

Please refer to the original library documentation here. This is to reduce the maintenance burden of this library.

The intent is to keep the library in sync with the original but each PR needs to be be ported to maintain feature parity. The documentation could contain features that are not yet implemented in this library.

For specific changes, refer to the releases below.

Migrating an existing lightbend/config project to sconfig

sconfig Scala version support Latest scalafix version

This project publishes a scalafix rule to migrate existing Scala 2 source code that uses com.typesafe.config.Config to this implementation. Scalafix rules modify in place existing valid Scala code. Think of it as a fancy find-and-replace tool that is aware of the Scala type system and can therefore narrowly tailor the changes being made. (Since scalafix changes the source code on your file system, it's best to commit any changes prior to running the rule, in case something weird happens.)

The rule will replace com.typesafe.config package references with org.ekrich.config, and remove trailing parens on some methods (where the API changed from the Java implementation).

Complete setup documentation and the current scalafix version can be found in the scalafix user guide. At a high level, the process is as follows:

  1. Add scalafix to the project's project/plugins.sbt file using the version found above:

    addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "a.b.c")
  2. Add this project to the project's libraryDependencies, but don't remove the old one yet!

    (The old dependency needs to stay on the classpath until after the rule runs, because the code must compile before it will run.)

  3. Run the scalafix sbt command shown below to apply the rule using the version of sconfig selected. Replace the x.y.z below with the version (must be greater than version 1.4.5 when scalafix was added):

    scalafixEnable; scalafixAll dependency:[email protected]:sconfig-scalafix:x.y.x
    
  4. Remove the old config dependency from the project's libraryDependencies

  5. Commit the changes

Versions

Release 1.7.0 - (2023-04-16)
Release 1.6.0 - (2023-12-28)
Release 1.5.1 - (2023-09-15)
Release 1.5.0 - (2022-09-19)
Release 1.4.9 - (2022-01-25)
Release 1.4.8 - (2022-01-12)
Release 1.4.7 - (2022-01-03)
Release 1.4.6 - (2021-12-06)
Release 1.4.5 - (2021-10-08)
Release 1.4.4 - (2021-05-13)
Release 1.4.3 - (2021-05-12)
Release 1.4.2 - (2021-04-01)
Release 1.4.1 - (2021-02-24)
Release 1.4.0 - (2021-01-26)
Release 1.3.6 - (2020-12-21)
Release 1.3.5 - (2020-11-24)
Release 1.3.4 - (2020-11-03)
Release 1.3.3 - (2020-09-14)
Release 1.3.2 - (2020-09-01)
Release 1.3.1 - (2020-07-24)
Release 1.3.0 - (2020-05-01)
Release 1.2.2 - (2020-04-28)
Release 1.2.1 - (2020-02-18)
Release 1.1.3 - (2019-12-27)
Release 1.0.0 - (2019-08-05)
Release 0.9.2 - (2019-06-10)
Release 0.9.1 - (2019-05-22)
Release 0.9.0 - (2019-05-21)
Release 0.8.0 - (2019-04-23)
Release 0.7.6 - (2019-04-10)
Release 0.7.5 - (2019-04-05)
Release 0.7.0 - (2018-12-14)

sconfig's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sconfig's Issues

Recent scalafmt split javadoc style @link across lines

See: scalameta/scalafmt#3070
Sites:

[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigIncluder.scala:6:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigOrigin.scala:9:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigParseable.scala:6:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigResolver.scala:3:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigIncluder.scala:6:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigIncluder.scala:6:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigOrigin.scala:9:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigOrigin.scala:9:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigParseable.scala:6:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigParseable.scala:6:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigResolver.scala:3:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigResolver.scala:3:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:15:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:15:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:15:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigList.scala:8:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigObject.scala:8:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigList.scala:8:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigList.scala:8:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigObject.scala:8:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigObject.scala:8:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigResolveOptions.scala:6:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigResolveOptions.scala:6:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigResolveOptions.scala:6:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/parser/ConfigDocument.scala:45:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/parser/ConfigDocument.scala:45:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/parser/ConfigDocument.scala:45:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigOrigin.scala:104:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigOrigin.scala:104:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigOrigin.scala:104:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValue.scala:102:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValue.scala:91:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValue.scala:102:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValue.scala:91:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValue.scala:102:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValue.scala:91:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigUtil.scala:24:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigUtil.scala:58:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigUtil.scala:24:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigUtil.scala:24:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigUtil.scala:58:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigUtil.scala:58:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigObject.scala:78:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigObject.scala:78:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigObject.scala:78:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValueFactory.scala:98:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValueFactory.scala:66:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigParseOptions.scala:174:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValueFactory.scala:98:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValueFactory.scala:98:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValueFactory.scala:66:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValueFactory.scala:66:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigParseOptions.scala:174:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigParseOptions.scala:174:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1031:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1018:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:605:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:917:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:458:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:364:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:389:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1044:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1005:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1031:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1018:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1031:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1018:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:605:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:917:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:605:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:917:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigIncludeContext.scala:37:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:458:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:458:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:364:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:389:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:364:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:389:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1044:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1005:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1044:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/Config.scala:1005:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigIncludeContext.scala:37:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigIncludeContext.scala:37:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValue.scala:38:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigParseable.scala:18:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValue.scala:38:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigValue.scala:38:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigRenderOptions.scala:117:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigRenderOptions.scala:67:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigParseable.scala:18:3: Could not find any member to link for "".
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigParseable.scala:18:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigRenderOptions.scala:117:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigRenderOptions.scala:117:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigRenderOptions.scala:67:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/ConfigRenderOptions.scala:67:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/impl/Unmergeable.scala:8:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/impl/Unmergeable.scala:8:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] /Users/eric/workspace/sconfig/sconfig/shared/src/main/scala/org/ekrich/config/impl/Unmergeable.scala:8:1: Could not find any member to link for "".
[warn] /**
[warn] ^
[warn] 33 warnings found
[info] Main Scala API documentation successful.
[warn] /Users/eric/workspace/sconfig/sconfig/jvm/src/main/scala/org/ekrich/config/ConfigBeanFactory.scala:13:3: Could not find any member to link for "".
[warn]   /**
[warn]   ^
[warn] 34 warnings found
[info] Main Scala API documentation successful.
[warn] 33 warnings found

Java Object interopt changed in Scala 2.13.0

This is more just an advisory issue that could be updated and released if older versions like Scala 2.11 and 2.12 get dropped.

Change in Scala 2.13: scala/scala#7966

Code affected: https://github.com/ekrich/sconfig/blob/master/sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfigList.scala#L270

Potential change:

From: override def toArray[T](a: Array[T with Object]): Array[T with Object] =???
To: override def toArray[T <: Object](a: Array[T]): Array[T] = ???

Replace spray-json fork with something for longer term

sconfig uses a JSON library to compare the JSON parsing to the internal parser as a sanity check - this could be replaced potentially with a good JSON test lib.

The original lightbend/config uses "net.liftweb" %% "lift-json" % "3.3.0" % Test https://www.liftweb.net/ but this was not cross platform.

This was replaced by https://github.com/jodersky/spray-json to get a cross platform version of
https://github.com/spray/spray-json The code has been merged upstream but it doesn't seem to have a cross version as the master branch is behind and not using current Scala Native versions for example.

It is unclear the path forward but it seems only JVM is involved using TestUtils and JsonTest so right now now cross platform tests are involved.

Add support for 2.13.0-M5

This change probably requires moving from lift-json to maybe argonaut for the JSON tests. The latter also supports Scala Native which means that if the tests are moved from Junit to perhaps Scala Check then maybe all the tests can be cross platform.

Currently, libraryDependencies += "io.argonaut" %% "argonaut" % "6.2.3" support 2.13.0-M5 and Scala Native.

Scala 3 / Dotty Support

Blockers

This issue is a overall issue to keep track of Dotty support. Different PRs are being worked on and merged to master as long as the changes are backward compatible.

Fix was merged in 0.20.0-RC1 so we have serialization but the output is not the same.

  • Investigate serialization difference. These seem to be caused by the inability to assign an Enum to a value running into the following Bad type operand on stack errors or the like.

Blocked on the following issues.

Update: 9-2-2020 - Dotty 0.27.0-RC1 - One test fails - org.ekrich.config.impl.ValidationTest.validationFailedSerializable
Error: java.io.NotSerializableException: org.ekrich.config.impl.SimpleConfigOrigin
Ignored for now - needs investigating.

This is currently not passing the tests due to a Callable[Config] that produces a value correctly but does not get assigned correctly. This call returns a config - https://github.com/ekrich/sconfig/blob/topic/dotty2/sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigImpl.scala#L54 when debugged from here - https://github.com/ekrich/sconfig/blob/topic/dotty2/sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigImpl.scala#L353-L365 - but then always falls through to this code - https://github.com/ekrich/sconfig/blob/topic/dotty2/sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigImpl.scala#L65-L66

The above has been reported and considered.

  • Miscompilation: When a try expression mutating a var is lifted, incorrect code is generated scala/scala3#7356

This code now has been modified to avoid this problem so the code will work and test. See 2ae7d88

Java Blockers

These are lower priority as Java can use the Java API but these keep all the functionality from working.

  • Do not autoimport scala.* when parsing .java files scala/scala3#7312 Fixed as of 0.27.0-bin-20200810-74ba21c-NIGHTLY
  • @vararg annotation when called from Java does not compile scala/scala3#7212

Port all non documentation commits from typesafe/config

This issue should remain open as a reminder to periodically review commits and port the issue across. If you find a new PR/commit, please open a new issue to handle that commit. Last lightbend/config commit is 1fc2aff, lightbend/config#597 (Nov 4, 2018)

  1. Skip PR number if a doc or version update that is not needed.
  2. Github uses sequential numbers for both Issues and PRs.
  3. Some older sequenced PRs may have been merged after that date.

First PR is

Remove return use in code

return is an artifact form the Scala to Java port and should be removed. During the Dotty port, non-local returns or returns used in closures have been removed.

Fix scaladoc

Generating docs creates many warnings.

  • Fix scaladoc so that it links with other scaladoc
  • Remove warnings and errors

Update Dotty support for Scala.js

Currently this PR branch is in progress. https://github.com/ekrich/sconfig/tree/topic/dotty-js

[X] Better enum support needed - scala/scala3#9809
PR - scala/scala3#9955
[X] Need to add the JUnit compiler plugin for Scala 2 in build.sbt

Sebastien

In dotty I forcefully put the compiler plugin for JUnit inside the main compiler, because it was easier. But I'd like to pull it out when I get the chance.
With some build tweaking it works with 0.28.0-bin-20201013-68a7c03-NIGHTLY

Can't link on scala-native 0.4.0

The trace:

[error] missing symbols:
[error] * T18java.time.Duration
[error]   - from M34org.ekrich.config.impl.ConfigImpl$D10fromAnyRefL16java.lang.ObjectL30org.ekrich.config.ConfigOriginL34org.ekrich.config.impl.FromMapModeL42org.ekrich.config.impl.AbstractConfigValueEO
[error]   - from M62org.ekrich.config.impl.PropertiesParser$$anonfun$fromPathMap$5D5applyL27org.ekrich.config.impl.PathL16java.lang.ObjectEO
[error]   - from M62org.ekrich.config.impl.PropertiesParser$$anonfun$fromPathMap$5D5applyL16java.lang.ObjectL16java.lang.ObjectEO
[error]   - from M40org.ekrich.config.impl.PropertiesParser$D11fromPathMapL30org.ekrich.config.ConfigOriginL13java.util.MapzL43org.ekrich.config.impl.AbstractConfigObjectEO
[error]   - from M40org.ekrich.config.impl.PropertiesParser$D12fromEntrySetL30org.ekrich.config.ConfigOriginL13java.util.MapL43org.ekrich.config.impl.AbstractConfigObjectEPT40org.ekrich.config.impl.PropertiesParser$
[error]   - from M40org.ekrich.config.impl.PropertiesParser$D14fromPropertiesL30org.ekrich.config.ConfigOriginL20java.util.PropertiesL43org.ekrich.config.impl.AbstractConfigObjectEO
[error]   - from M40org.ekrich.config.impl.PropertiesParser$D5parseL14java.io.ReaderL30org.ekrich.config.ConfigOriginL43org.ekrich.config.impl.AbstractConfigObjectEO
[error]   - from M32org.ekrich.config.impl.ParseableD13rawParseValueL14java.io.ReaderL30org.ekrich.config.ConfigOriginL36org.ekrich.config.ConfigParseOptionsL42org.ekrich.config.impl.AbstractConfigValueEPT32org.ekrich.config.impl.Parseable
[error]   - from M32org.ekrich.config.impl.ParseableD13rawParseValueL30org.ekrich.config.ConfigOriginL36org.ekrich.config.ConfigParseOptionsL42org.ekrich.config.impl.AbstractConfigValueEO
[error]   - from M32org.ekrich.config.impl.ParseableD10parseValueL30org.ekrich.config.ConfigOriginL36org.ekrich.config.ConfigParseOptionsL42org.ekrich.config.impl.AbstractConfigValueEPT32org.ekrich.config.impl.Parseable

Looks like an regression on Scala-Native 0.4.0: scala-native/scala-native#2173

The good news it can be easy overstep (at least by my use case) with stub like:

package java.time

trait Duration {

}

Resolving doesn't work

I have a config like so:

env_name=local
installation_directory_path=${exePath}/tmp/test_local_docker
#me_user=${whoami}

docker {
    network=test_env
    internal_storage=1
    default_mount=false
    persistent_data=false
}

windows_env=false

clickhouse {
    global {
        replication_factor=1
        image_file=clickhouse-server
        image_name=yandex/clickhouse-server
        container_name=local_clickhouse_server
    }

    mapping {
        http_port=8223
        tcp_port=9101
        interserver_http_port=9101
        docker {
            data_path=/clickhouse/clickhouse-data
            logs_path=/clickhouse/clickhouse-logs
            file_path=/clickhouse/clickhouse-files
        }
        host {
            data_path=${installation_directory_path}/clickhouse-data
            logs_path=${installation_directory_path}/clickhouse-logs
            file_path=${installation_directory_path}/clickhouse-files
        }
        max_server_memory_usage_to_ram_ratio=0.2
    }
}

I merge it with a programmatically generated config

exePath=/home/mhammons/Documents/Projects/opsScala/core/target/scala-2.13

and call resolve, but no matter what I do I get the following error:

org.ekrich.config.ConfigException$UnresolvedSubstitution: String: 102: Could not resolve substitution to a value: ${installation_directory_path}
        at java.lang.Throwable.fillInStackTrace(Unknown Source)
        at org.ekrich.config.ConfigException$UnresolvedSubstitution.<init>(Unknown Source)
        at org.ekrich.config.impl.ConfigReference.resolveSubstitutions(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.realResolve(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.resolve(Unknown Source)
        at org.ekrich.config.impl.ConfigConcatenation.$anonfun$resolveSubstitutions$2(Unknown Source)
        at org.ekrich.config.impl.ConfigConcatenation$$Lambda$2.apply(Unknown Source)
        at scala.collection.IterableOnceOps.foreach(Unknown Source)
        at scala.collection.AbstractIterable.foreach(Unknown Source)
        at org.ekrich.config.impl.ConfigConcatenation.resolveSubstitutions(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.realResolve(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.resolve(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.$anonfun$modifyMayThrow$1(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject$$Lambda$7.apply(Unknown Source)
        at scala.collection.IterableOnceOps.foreach(Unknown Source)
        at scala.collection.AbstractIterable.foreach(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.modifyMayThrow(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.resolveSubstitutions(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.realResolve(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.resolve(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.$anonfun$modifyMayThrow$1(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject$$Lambda$7.apply(Unknown Source)
        at scala.collection.IterableOnceOps.foreach(Unknown Source)
        at scala.collection.AbstractIterable.foreach(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.modifyMayThrow(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.resolveSubstitutions(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.realResolve(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.resolve(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.$anonfun$modifyMayThrow$1(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject$$Lambda$7.apply(Unknown Source)
        at scala.collection.IterableOnceOps.foreach(Unknown Source)
        at scala.collection.AbstractIterable.foreach(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.modifyMayThrow(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.resolveSubstitutions(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.realResolve(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.resolve(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.$anonfun$modifyMayThrow$1(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject$$Lambda$7.apply(Unknown Source)
        at scala.collection.IterableOnceOps.foreach(Unknown Source)
        at scala.collection.AbstractIterable.foreach(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.modifyMayThrow(Unknown Source)
        at org.ekrich.config.impl.SimpleConfigObject.resolveSubstitutions(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.realResolve(Unknown Source)
        at org.ekrich.config.impl.ResolveContext.resolve(Unknown Source)
        at org.ekrich.config.impl.ResolveContext$.resolve(Unknown Source)
        at org.ekrich.config.impl.SimpleConfig.resolveWith(Unknown Source)
        at org.ekrich.config.impl.SimpleConfig.resolveWith(Unknown Source)
        at ops.environments.Local$.<init>(Unknown Source)
        at <none>._SM23ops.environments.Local$G4load(Unknown Source)
        at ops.environments.package$.<init>(Unknown Source)
        at <none>._SM25ops.environments.package$G4load(Unknown Source)
        at ops.Ops$.<init>(Unknown Source)
        at <none>._SM8ops.Ops$G4load(Unknown Source)
        at <none>.main(Unknown Source)
        at <none>.__libc_start_main(Unknown Source)
        at <none>._start(Unknown Source)
        ```

Add support for Scala Native

The first target to support is scalafmt so we can have a native binary.

This feature requires the following:

  1. Create a cross project for Scala JVM and Scala Native.
  2. Create minimal tests for Scala Native to make sure at least the features required by scalafmt above will work.
  3. Make sure Scala Native will support the sconfig code base so the application will link.

Release for Scala Native 0.4.0

I could do a publishLocal with 0.4M2, just had to comment out utest as that doesn't have 0.4M2 either. sconfig seems to work fine on M2 this way, but would be great to have official build.

Provide better integration with Scala

This is just a suggestion for possible improvement that would encourage more developers to use this library.
I am using Hocon with Scala for a few years, and one annoying aspect is that I have to convert Java objects (especially lists and maps) to Scala explicitly. Also checking whether the element exists before retrieving it - could enjoy using scala Option, or method with default.
I found this Sconfig project while looking for Scala Hocon support. Unfortunately, it looks like it does not give me any advantage compare to the original Lightbend Java library.
I also saw some other projects providing Scala wrappers, but their problem was, they are not actively maintained.
So maybe I will just write my own small wrapper, this should not be hard.
Unless you can create one.

sbt-ci-release does not publish correctly

When setting export CI_RELEASE=";+sconfigNative/publishSigned;+sconfigJS/publishSigned" to run additional Native and JS configurations, all the sconfigJVM versions are published again.

Running the following locally publishes only the artifacts requested.

sbt:sconfig-root> ;+sconfigNative/publishLocal;+sconfigJS/publishLocal

or

sbt ";+sconfigNative/publishLocal;+sconfigJS/publishLocal"

Downgrading from sbt 1.3.5 to sbt 1.2.8 does not solve the issue so as stated in the following issue, upgrading from sbt-ci-release 1.2.6 to 1.4.31 contributes to the extra artifacts being published.

sbt/sbt-ci-release#87

Mima setup needs fixing with new version of the plugin

It now checks all the projects. To work around for JVM check only run the following:

sbt:sconfig-root> sconfigJVM/mimaReportBinaryIssues

Also for example:

sbt:sconfig-root> last sconfigJS/mimaReportBinaryIssues
[error] java.lang.RuntimeException: sconfig: mimaPreviousArtifacts not set, not analyzing binary compatibility.

missing config in native results in out of heap

When I retrieve a non existing path I get an out of heap crash on native 0.4M2 (program stops for quite a while before that, maybe it gets into some endless failback search for the value?). I have to run the same on jvm scala to get a proper error message warning about what value is missing.

Remove breakable used in code

breakable is an artifact needed during the initial port but should be removed long term to make the code more performant and easier to maintain.

Could not call Config.resolve in Scalajs

[info] Done compiling.
[info] Fast optimizing /bhc/target/scala-2.12/bhc-fastopt.js
[error] Referring to non-existent class java.util.IdentityHashMap

It looks use typeconfig lib to resolve hocon config. There is not IdentityHashMap exists in scala lib, can I find other way to resolve it?

Enhance Scala Native docs

Can this be used or other APIs?

val conf = ConfigFactory.parseFile(new File("./center/app.conf"))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.