All Projects → ekrich → sconfig

ekrich / sconfig

Licence: other
Scala configuration library supporting HOCON for Scala, Java, Scala.js, and Scala Native

Programming Languages

scala
5932 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to sconfig

DazzleConf
Incredible configuration library
Stars: ✭ 34 (-65.66%)
Mutual labels:  config, hocon
node-config
nodejs的配置中心
Stars: ✭ 53 (-46.46%)
Mutual labels:  config
dotfiles
/home/yous
Stars: ✭ 43 (-56.57%)
Mutual labels:  config
nim config
Global project-agnostic config.nims
Stars: ✭ 54 (-45.45%)
Mutual labels:  config
juno-agent
juno-agent
Stars: ✭ 46 (-53.54%)
Mutual labels:  config
dotfiles
The config that makes me a productivity whiz 🧙‍♂️
Stars: ✭ 36 (-63.64%)
Mutual labels:  config
mleap
R Interface to MLeap
Stars: ✭ 24 (-75.76%)
Mutual labels:  jvm
dotfiles
My dotfiles based on Makefile
Stars: ✭ 150 (+51.52%)
Mutual labels:  config
gchisto
GC日志分析工具,网上不容易找到源码,这里备份一个。不确定工具是否正确,不确定是否有时间研究。
Stars: ✭ 32 (-67.68%)
Mutual labels:  jvm
dotfiles
My collection of dotfiles
Stars: ✭ 77 (-22.22%)
Mutual labels:  config
Computer-Science-Learn-Notes
CS(Computer Science)生涯:读书笔记,集成Java知识体系!(Java基础、JVM、JUC、Spring系列、面试八股文、力扣刷题笔记,数据结构和算法、SpringBoot整合其他框架等)
Stars: ✭ 141 (+42.42%)
Mutual labels:  jvm
LLVM-JVM
[W.I.P] A Just-In-Time Java Virtual Machine written in Haskell
Stars: ✭ 22 (-77.78%)
Mutual labels:  jvm
profig
A straightforward configuration library for Python.
Stars: ✭ 26 (-73.74%)
Mutual labels:  config
Webpack5-Max
Webpack 5 Boilerplate for JS/React/TS apps.
Stars: ✭ 103 (+4.04%)
Mutual labels:  config
dotfiles
My personal configuration and bootstrap files
Stars: ✭ 14 (-85.86%)
Mutual labels:  config
nvim
No description or website provided.
Stars: ✭ 13 (-86.87%)
Mutual labels:  config
oh-my-jvm
☕️ using golang write jvm
Stars: ✭ 16 (-83.84%)
Mutual labels:  jvm
AutoKonfig
Kotlin configuration library with batteries included
Stars: ✭ 16 (-83.84%)
Mutual labels:  hocon
ConfigAPI
GSON-like ORM for Bukkit YAML API's
Stars: ✭ 23 (-76.77%)
Mutual labels:  config
hb-config
hb-config: easy to configure your python project especially Deep Learning experiments
Stars: ✭ 21 (-78.79%)
Mutual labels:  config

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.4.x)
2.12.x
2.13.x
3.x.x

Note: 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 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. Enable scalafix in the project's build:

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

      addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "a.b.c")
    • Add this to the project's build.sbt:

      ThisBuild / semanticdbEnabled := true
      ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
  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 task 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):

    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.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)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].