Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ekrich/sconfig
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5.1
Choose a base ref
...
head repository: ekrich/sconfig
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Sep 18, 2023

  1. Copy the full SHA
    821420e View commit details

Commits on Sep 26, 2023

  1. Copy the full SHA
    a8d6495 View commit details

Commits on Sep 27, 2023

  1. Towards support File access on Scala Native (#349)

    * Move PlatfromThread to JVM and update comments
    
    * Add an impl object
    
    * Remove impl and celanup docs
    ekrich authored Sep 27, 2023
    Copy the full SHA
    87a88da View commit details

Commits on Oct 18, 2023

  1. Copy the full SHA
    8535731 View commit details

Commits on Oct 26, 2023

  1. Copy the full SHA
    2dd0feb View commit details
  2. Copy the full SHA
    1267a69 View commit details

Commits on Nov 16, 2023

  1. Copy the full SHA
    da295a8 View commit details

Commits on Nov 17, 2023

  1. Copy the full SHA
    9fc7fb0 View commit details

Commits on Dec 4, 2023

  1. Copy the full SHA
    43444bc View commit details

Commits on Dec 28, 2023

  1. Provide for better Platform support and testing (#350)

    * Add classes to allow migrations of methods to specific platforms
    
    * Move some common methods
    
    * Move platform to config package
    
    * Shared JVM Native tests work
    
    * Move parseString to common
    
    * Works good for all platforms, stub for JvmNative
    
    * Add two Reader tests to Native
    
    * Make default build 2.13 and rename ConfigDocumentTest to ConfigDocumentFactoryTest
    
    * Move ConfigFactoryTests to impl like other tests
    
    * Move tests from ConfigTest to ConfigFactoryJvmTest and then ConfigTest to shared
    
    * Make test class names singular
    
    * Checkpoint commit for ConfigOrigin setup
    
    * Update to more shared tests, add URL for Native, from 189 to 228 tests for Native
    
    * Add env vars to shared in anticipation of using them in Native or JS
    
    * Move ConfigSubstitutionTests to shared
    
    * Json4s almost works
    
    * Json4s cleanup
    
    * Got json4s test to work
    
    * Make comments generic
    
    * Json4sTest is now cross platform
    
    * Small updates, JS setting commented out
    
    * Upgrade to new version of json4s to fix JS ClassCastException problem
    
    * Upgrade Scala.js to 1.15.0, allow Reader tests now
    
    * Update docs and readme for release
    ekrich authored Dec 28, 2023
    Copy the full SHA
    7b7bddb View commit details

Commits on Jan 15, 2024

  1. Drop Java 8 in CI (#358)

    ekrich authored Jan 15, 2024
    Copy the full SHA
    a86cf98 View commit details
  2. Move dependabot file (#359)

    ekrich authored Jan 15, 2024
    Copy the full SHA
    3806398 View commit details
  3. Bump actions/setup-java from 3 to 4 (#360)

    Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
    - [Release notes](https://github.com/actions/setup-java/releases)
    - [Commits](actions/setup-java@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-java
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 15, 2024
    Copy the full SHA
    21a2610 View commit details
  4. Bump actions/checkout from 3 to 4 (#361)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 15, 2024
    Copy the full SHA
    f51dc04 View commit details

Commits on Jan 22, 2024

  1. Copy the full SHA
    c2a2ac8 View commit details

Commits on Feb 21, 2024

  1. Copy the full SHA
    39a6f66 View commit details

Commits on Feb 27, 2024

  1. Copy the full SHA
    d702b3d View commit details

Commits on Mar 21, 2024

  1. Copy the full SHA
    e8ecf8f View commit details

Commits on Apr 3, 2024

  1. Copy the full SHA
    86407d9 View commit details

Commits on Apr 16, 2024

  1. Scala Native 0.5.0 release (#369)

    * Update Scala versions
    
    * Update to RC1, javatime, and scalafix
    
    * Save snapshot and RC setting versions
    
    * Add SN 0.5.0 and SJS 1.6.0
    
    * Update scala-collection compat to 2.12, drop link stubs, and add URLConnection for stubs
    
    * Update to Scala Native 0.5.1
    
    * Update README for 1.7.0 release
    ekrich authored Apr 16, 2024
    Copy the full SHA
    b2acfc7 View commit details

Commits on May 31, 2024

  1. Copy the full SHA
    cc9eef0 View commit details

Commits on Jun 6, 2024

  1. Copy the full SHA
    cfbaff8 View commit details

Commits on Jun 18, 2024

  1. Update scalafmt-core to 3.8.2 (#379)

    * Update scalafmt-core to 3.8.2
    
    * Reformat with scalafmt 3.8.2
    
    Executed command: scalafmt --non-interactive
    
    * Add 'Reformat with scalafmt 3.8.2' to .git-blame-ignore-revs
    scala-steward authored Jun 18, 2024
    Copy the full SHA
    590cce6 View commit details

Commits on Jun 26, 2024

  1. Copy the full SHA
    32ad632 View commit details

Commits on Jun 27, 2024

  1. Copy the full SHA
    091424b View commit details
  2. Copy the full SHA
    e2bb8e6 View commit details

Commits on Jul 13, 2024

  1. Copy the full SHA
    21fef48 View commit details

Commits on Aug 2, 2024

  1. Copy the full SHA
    f3aab9b View commit details

Commits on Aug 12, 2024

  1. Copy the full SHA
    45e8f97 View commit details
  2. Copy the full SHA
    a97c56f View commit details

Commits on Aug 22, 2024

  1. Copy the full SHA
    7c23b20 View commit details
  2. Copy the full SHA
    72d732c View commit details

Commits on Sep 16, 2024

  1. Copy the full SHA
    7eb2778 View commit details

Commits on Sep 26, 2024

  1. Copy the full SHA
    790789a View commit details

Commits on Sep 27, 2024

  1. Update README.md

    Add Scala Steward Badge
    ekrich authored Sep 27, 2024
    Copy the full SHA
    ec90548 View commit details

Commits on Sep 30, 2024

  1. Copy the full SHA
    7fdb3c0 View commit details
  2. Copy the full SHA
    35c2312 View commit details
  3. Copy the full SHA
    af29659 View commit details
  4. Copy the full SHA
    b43db82 View commit details

Commits on Oct 4, 2024

  1. Copy the full SHA
    360c8d4 View commit details
  2. Add Scala Steward Conf file for PR updates (#399)

    * Add Scala Steward conf so PRs are updated
    
    * Add new line
    ekrich authored Oct 4, 2024
    Copy the full SHA
    ddc343a View commit details
  3. Copy the full SHA
    ee20423 View commit details
  4. Refactor ConfigFactoryDocumentTest to Shared and JVM - JS and Native …

    …tests from 318 to 346
    ekrich committed Oct 4, 2024
    Copy the full SHA
    f56d425 View commit details
  5. Copy the full SHA
    27ee375 View commit details
  6. Copy the full SHA
    cebc4a3 View commit details
  7. Format to pass CI

    ekrich committed Oct 4, 2024
    Copy the full SHA
    d91399b View commit details
  8. Copy the full SHA
    0b7d37f View commit details
  9. Copy the full SHA
    1afb5a8 View commit details

Commits on Nov 2, 2024

  1. Copy the full SHA
    8db7989 View commit details

Commits on Nov 4, 2024

  1. Share validation tests

    ekrich committed Nov 4, 2024
    Copy the full SHA
    5046b2c View commit details
Showing with 6,335 additions and 3,503 deletions.
  1. +3 −0 .git-blame-ignore-revs
  2. +10 −0 .github/dependabot.yml
  3. +1 −1 .github/workflows/check-lint.yml
  4. +5 −4 .github/workflows/ci.yml
  5. +2 −2 .github/workflows/release.yml
  6. +3 −0 .gitignore
  7. +1 −0 .scala-steward.conf
  8. +1 −1 .scalafmt.conf
  9. +23 −35 README.md
  10. +36 −23 build.sbt
  11. +43 −7 docs/SCALA-NATIVE.md
  12. +1 −1 project/build.properties
  13. +5 −5 project/plugins.sbt
  14. +0 −8 sconfig/js/src/main/scala/PlatformThread.scala
  15. +0 −10 sconfig/js/src/main/scala/PlatformUri.scala
  16. +6 −0 sconfig/js/src/main/scala/org/ekrich/config/PlatformConfigFactory.scala
  17. +2 −2 sconfig/js/src/main/scala/{ → org/ekrich/config/impl}/PlatformClassLoader.scala
  18. +8 −0 sconfig/js/src/main/scala/org/ekrich/config/impl/PlatformThread.scala
  19. +10 −0 sconfig/js/src/main/scala/org/ekrich/config/impl/PlatformUri.scala
  20. +7 −0 sconfig/js/src/main/scala/org/ekrich/config/parser/PlatformConfigDocumentFactory.scala
  21. +0 −8 sconfig/jvm-native/src/main/scala/PlatformThread.scala
  22. +12 −0 sconfig/jvm-native/src/main/scala/org/ekrich/config/ConfigFactoryJvmNative.scala
  23. +2 −2 sconfig/jvm-native/src/main/scala/{ → org/ekrich/config/impl}/PlatformClassLoader.scala
  24. +2 −2 sconfig/jvm-native/src/main/scala/{ → org/ekrich/config/impl}/PlatformUri.scala
  25. +44 −0 sconfig/jvm-native/src/main/scala/org/ekrich/config/parser/ConfigDocumentFactoryJvmNative.scala
  26. +44 −0 sconfig/jvm-native/src/test/scala/org/ekrich/config/impl/ConfigDocumentFactoryTest.scala
  27. +4 −1 sconfig/{jvm → jvm-native}/src/test/scala/org/ekrich/config/impl/FileUtils.scala
  28. +108 −0 sconfig/jvm-native/src/test/scala/org/ekrich/config/impl/PublicApiFileTest.scala
  29. +78 −0 sconfig/jvm-native/src/test/scala/org/ekrich/config/impl/ValidationFileTest.scala
  30. +6 −0 sconfig/jvm/src/main/scala/org/ekrich/config/PlatformConfigFactory.scala
  31. +7 −2 sconfig/jvm/src/main/scala/org/ekrich/config/impl/ConfigBeanImpl.scala
  32. +8 −0 sconfig/jvm/src/main/scala/org/ekrich/config/impl/PlatformThread.scala
  33. +7 −0 sconfig/jvm/src/main/scala/org/ekrich/config/parser/PlatformConfigDocumentFactory.scala
  34. +6 −775 sconfig/jvm/src/test/scala/org/ekrich/config/impl/{ConfigTest.scala → ConfigFactoryJvmTest.scala}
  35. +0 −1,207 sconfig/jvm/src/test/scala/org/ekrich/config/impl/ConfigSubstitutionTest.scala
  36. +17 −810 sconfig/jvm/src/test/scala/org/ekrich/config/impl/ConfigValueTest.scala
  37. +0 −40 sconfig/jvm/src/test/scala/org/ekrich/config/impl/ParseableReaderTest.scala
  38. +0 −34 sconfig/jvm/src/test/scala/org/ekrich/config/impl/PublicApiTest.scala
  39. +8 −0 sconfig/jvm/src/test/scala/org/ekrich/config/impl/TestPath.scala
  40. 0 sconfig/{shared → jvm}/src/test/scala/org/ekrich/config/impl/TestUtils.scala
  41. +24 −0 sconfig/jvm/src/test/scala/org/ekrich/config/impl/ValidationSerializableTest.scala
  42. +0 −162 sconfig/jvm/src/test/scala/org/ekrich/config/impl/ValidationTest.scala
  43. +23 −0 sconfig/native/src/main/scala/java/net/URL.scala
  44. +14 −0 sconfig/native/src/main/scala/java/net/URLConnection.scala
  45. +6 −0 sconfig/native/src/main/scala/org/ekrich/config/PlatformConfigFactory.scala
  46. +8 −0 sconfig/native/src/main/scala/org/ekrich/config/impl/PlatformThread.scala
  47. +7 −0 sconfig/native/src/main/scala/org/ekrich/config/parser/PlatformConfigDocumentFactory.scala
  48. +94 −0 sconfig/native/src/test/resources/test01.conf
  49. +4 −0 sconfig/native/src/test/resources/test01.json
  50. +5 −0 sconfig/native/src/test/resources/test01.properties
  51. +9 −0 sconfig/native/src/test/resources/test03-included.conf
  52. +36 −0 sconfig/native/src/test/resources/test03.conf
  53. +30 −0 sconfig/native/src/test/resources/validate-invalid.conf
  54. +32 −0 sconfig/native/src/test/resources/validate-reference.conf
  55. +8 −0 sconfig/native/src/test/scala/org/ekrich/config/impl/TestPath.scala
  56. +833 −0 sconfig/native/src/test/scala/org/ekrich/config/impl/TestUtils.scala
  57. +0 −8 sconfig/shared/src/main/scala/ThreadLike.scala
  58. +0 −10 sconfig/shared/src/main/scala/UriLike.scala
  59. +7 −8 sconfig/shared/src/main/scala/org/ekrich/config/Config.scala
  60. +23 −68 sconfig/shared/src/main/scala/org/ekrich/config/ConfigFactory.scala
  61. +71 −0 sconfig/shared/src/main/scala/org/ekrich/config/ConfigFactoryShared.scala
  62. +1 −1 sconfig/shared/src/main/scala/org/ekrich/config/ConfigMergeable.scala
  63. +1 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/AbstractConfigObject.scala
  64. +2 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/BadMap.scala
  65. +2 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigBoolean.scala
  66. +3 −3 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigConcatenation.scala
  67. +4 −3 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigDelayedMerge.scala
  68. +26 −17 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigDelayedMergeObject.scala
  69. +1 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigDouble.scala
  70. +1 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigInt.scala
  71. +1 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigLong.scala
  72. +3 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigNodeArray.scala
  73. +3 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigNodeConcatenation.scala
  74. +3 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigNodeObject.scala
  75. +3 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigNodeRoot.scala
  76. +2 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigNull.scala
  77. +4 −3 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigReference.scala
  78. +2 −2 sconfig/shared/src/main/scala/org/ekrich/config/impl/ConfigString.scala
  79. +6 −4 sconfig/shared/src/main/scala/org/ekrich/config/impl/Parseable.scala
  80. +5 −3 sconfig/shared/src/main/scala/org/ekrich/config/impl/SerializedConfigValue.scala
  81. +1 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfigDocument.scala
  82. +10 −9 sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfigList.scala
  83. +2 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfigObject.scala
  84. +3 −0 sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleConfigOrigin.scala
  85. +3 −1 sconfig/shared/src/main/scala/org/ekrich/config/impl/SimpleIncludeContext.scala
  86. +2 −2 ...fig/shared/src/main/scala/{ClassLoaderLike.scala → org/ekrich/config/impl/TraitClassLoader.scala}
  87. +8 −0 sconfig/shared/src/main/scala/org/ekrich/config/impl/TraitThread.scala
  88. +10 −0 sconfig/shared/src/main/scala/org/ekrich/config/impl/TraitUri.scala
  89. +1 −92 sconfig/shared/src/main/scala/org/ekrich/config/parser/ConfigDocumentFactory.scala
  90. +68 −0 sconfig/shared/src/main/scala/org/ekrich/config/parser/ConfigDocumentFactoryShared.scala
  91. +0 −30 sconfig/shared/src/test/scala/junit/AssertThrows.scala
  92. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/BadMapTest.scala
  93. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/ConcatenationTest.scala
  94. +1 −36 ...tTest.scala → shared/src/test/scala/org/ekrich/config/impl/ConfigDocumentFactorySharedTest.scala}
  95. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/ConfigDocumentParserTest.scala
  96. +41 −2 ...shared/src/test/scala/{ConfigFactoryTests.scala → org/ekrich/config/impl/ConfigFactoryTest.scala}
  97. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/ConfigMemorySizeTest.scala
  98. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/ConfigNodeTest.scala
  99. +1,416 −0 sconfig/shared/src/test/scala/org/ekrich/config/impl/ConfigSubstitutionSharedTest.scala
  100. +779 −0 sconfig/shared/src/test/scala/org/ekrich/config/impl/ConfigTest.scala
  101. +832 −0 sconfig/shared/src/test/scala/org/ekrich/config/impl/ConfigValueSharedTest.scala
  102. +40 −35 ...krich/config/impl/JsonTest.scala → shared/src/test/scala/org/ekrich/config/impl/Json4sTest.scala}
  103. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/PathTest.scala
  104. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/PropertiesTest.scala
  105. +366 −0 sconfig/shared/src/test/scala/org/ekrich/config/impl/TestUtilsJson4s.scala
  106. +830 −0 sconfig/shared/src/test/scala/org/ekrich/config/impl/TestUtilsShared.scala
  107. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/TokenTest.scala
  108. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/TokenizerTest.scala
  109. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/UnitParserTest.scala
  110. +1 −1 sconfig/shared/src/test/scala/org/ekrich/config/impl/UtilTest.scala
  111. +84 −0 sconfig/shared/src/test/scala/org/ekrich/config/impl/ValidationTest.scala
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.7.0
7939505c0eb8b06e25c372c5bbe0da3272c65b81

# Scala Steward: Reformat with scalafmt 3.8.2
f5a756f05939939b4a30a4109f1a3b2cf472d85a
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/check-lint.yml
Original file line number Diff line number Diff line change
@@ -7,5 +7,5 @@ jobs:
check-lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: ./scripts/check-lint.sh
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -5,19 +5,20 @@ on:
pull_request:
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ '8', '11', '17' ]
java: [ '17', '21' ]
env:
JAVA_OPTS: -Xms2G -Xmx4G -Xss6M -XX:+UseG1GC -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
name: Test using Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- run: sbt +test
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -13,6 +13,9 @@ target/
# vscode
/.vscode/

# scala-cli
/.scala-build/

# scripts generated
/scripts/.coursier
/scripts/.scalafmt*
1 change: 1 addition & 0 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
updatePullRequests = "always"
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Test upgrades: $ scripts/scalafmt --test 2> diff.txt
version = 3.7.14
version = 3.9.4
runner.dialect = scala213source3
preset = default

58 changes: 23 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# sconfig
![CI](https://github.com/ekrich/sconfig/workflows/CI/badge.svg)
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-1.0.0.svg)](https://www.scala-js.org)
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)

Configuration library written in [Scala](https://www.scala-lang.org/) which is a direct translation
of the original widely used Java library.
Configuration library written in [Scala](https://www.scala-lang.org/) which is a direct translation of the original widely used Java library.

[Scala JVM](https://www.scala-lang.org/), [Scala Native](https://scala-native.readthedocs.io/), and [Scala.js](https://www.scala-js.org/)
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](https://github.com/lightbend/config/pull/600)
to the original project. The TLDR is the library was ported to Scala to support Scala Native so
[scalafmt](https://scalameta.org/scalafmt/) which uses HOCON configuration could be compiled into
a native application.
For motivation and background about this project see the [PR](https://github.com/lightbend/config/pull/600) to the original project. The TLDR is the library was ported to Scala to support Scala Native so [scalafmt](https://scalameta.org/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.
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](https://github.com/lightbend/config).
@@ -38,26 +34,24 @@ All available versions can be seen at the [Maven Repository](https://mvnreposito
## Cross Build Versions
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-1.0.0.svg)](https://www.scala-js.org)

| Scala Version | JVM | Scala.js (1.x) | Native (0.4.x) |
| Scala Version | JVM | Scala.js (1.x) | Native (0.5.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.
* 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](https://www.javadoc.io/badge/org.ekrich/sconfig_2.13.svg?label=scaladoc)](https://www.javadoc.io/doc/org.ekrich/sconfig_2.13)
[![scaladoc](https://javadoc.io/badge/org.ekrich/sconfig_3.svg?label=scaladoc3)](https://javadoc.io/doc/org.ekrich/sconfig_3)
[![Discord](https://img.shields.io/discord/633356833498595365.svg?label=&logo=discord&logoColor=ffffff&color=404244&labelColor=6A7EC2)](https://discord.gg/XSj6hQs)


Please refer to the original library documentation [here](https://github.com/lightbend/config).
This is to reduce the maintenance burden of this library.
Please refer to the original library documentation [here](https://github.com/lightbend/config). 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.
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.

@@ -66,45 +60,39 @@ For specific changes, refer to the releases below.
[![sconfig Scala version support](https://index.scala-lang.org/ekrich/sconfig/sconfig/latest.svg)](https://index.scala-lang.org/ekrich/sconfig/sconfig)
[![Latest scalafix version](https://index.scala-lang.org/scalacenter/scalafix/scalafix-core/latest.svg)](https://index.scala-lang.org/scalacenter/scalafix/scalafix-core)

This project publishes a [scalafix](https://scalacenter.github.io/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.)
This project publishes a [scalafix](https://scalacenter.github.io/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).
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](https://scalacenter.github.io/scalafix/docs/users/installation.html).
At a high level, the process is as follows:
Complete setup documentation and the current `scalafix` version can be found in the [scalafix user guide](https://scalacenter.github.io/scalafix/docs/users/installation.html). 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:

```scala
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.)
(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):
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:ReplaceTypesafeConfig@org.ekrich:sconfig-scalafix:x.y.x
```
4. Remove the old config dependency from the project's `libraryDependencies`
5. Commit the changes
## Versions
Release [1.5.1](https://github.com/ekrich/sconfig/releases/tag/v1.5.1) - (2023-09-14)<br/>
Release [1.9.0](https://github.com/ekrich/sconfig/releases/tag/v1.9.0) - (2025-03-17)<br/>
Release [1.8.1](https://github.com/ekrich/sconfig/releases/tag/v1.8.1) - (2024-11-05)<br/>
Release [1.8.0](https://github.com/ekrich/sconfig/releases/tag/v1.8.0) - (2024-11-05)<br/>
Release [1.7.0](https://github.com/ekrich/sconfig/releases/tag/v1.7.0) - (2023-04-16)<br/>
Release [1.6.0](https://github.com/ekrich/sconfig/releases/tag/v1.6.0) - (2023-12-28)<br/>
Release [1.5.1](https://github.com/ekrich/sconfig/releases/tag/v1.5.1) - (2023-09-15)<br/>
Release [1.5.0](https://github.com/ekrich/sconfig/releases/tag/v1.5.0) - (2022-09-19)<br/>
Release [1.4.9](https://github.com/ekrich/sconfig/releases/tag/v1.4.9) - (2022-01-25)<br/>
Release [1.4.8](https://github.com/ekrich/sconfig/releases/tag/v1.4.8) - (2022-01-12)<br/>
59 changes: 36 additions & 23 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@ addCommandAlias(
).mkString(";", ";", "")
)

val prevVersion = "1.5.1"
val nextVersion = "1.5.2"
val prevVersion = "1.8.0"
val nextVersion = "1.9.0"

// stable snapshot is not great for publish local
def versionFmt(out: sbtdynver.GitDescribeOutput): String = {
@@ -25,9 +25,9 @@ val scalacOpts = dotcOpts ++ List(
// 57 inferred return type Scala 2.13 cat=scala3-migration
"-Wconf:msg=inferred:ws",
// 2 deprecations Scala 2.12 Stack - fixed for 2.13
"-Wconf:msg=poorly-performing:ws"
"-Wconf:msg=poorly-performing:ws",
// uncomment to see messages
// "-Wconf:any:warning-verbose"
"-Wconf:any:warning-verbose"
)

Compile / console / scalacOptions --= Seq(
@@ -43,17 +43,23 @@ val isScala3 = Def.setting {
}
}

val scala212 = "2.12.18"
val scala213 = "2.13.12"
val scala3 = "3.3.1"
val scala212 = "2.12.20"
val scala213 = "2.13.16"
val scala3 = "3.3.5"

val javaTime = "1.1.9"
val scCompat = "2.11.0"
val javaTime = "1.3.0"
val scCompat = "2.13.0"

val versionsBase = Seq(scala212, scala213)
// We use the 2.12 and 2.13 version that the scalafix library uses
// and when the scalafix version gets updated the system will build
// using those Scala version. The Scala versions above are versions
// that get updated via Scala Steward and will match the scalafix
// versions when scalafix version is updated and in sync with the
// latest Scala versions.
val versionsBase = _root_.scalafix.sbt.BuildInfo.supportedScalaVersions
val versions = versionsBase :+ scala3

ThisBuild / scalaVersion := scala3
ThisBuild / scalaVersion := scala213
ThisBuild / crossScalaVersions := versions
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / mimaFailOnNoPrevious := false
@@ -116,14 +122,21 @@ lazy val sconfig = crossProject(JVMPlatform, NativePlatform, JSPlatform)
scalacOptions ++= {
if (isScala3.value) dotcOpts else scalacOpts
},
libraryDependencies += "org.scala-lang.modules" %%% "scala-collection-compat" % scCompat,
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-s", "-v")
libraryDependencies ++= Seq(
"org.scala-lang.modules" %%% "scala-collection-compat" % scCompat,
"org.json4s" %%% "json4s-native-core" % "4.0.7" % Test
),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-s", "-v"),
// env vars for tests
Test / envVars ++= Map(
"testList.0" -> "0",
"testList.1" -> "1",
"testClassesPath" -> (Test / classDirectory).value.getPath
)
)
.jvmSettings(
crossScalaVersions := versions,
libraryDependencies ++= Seq(
("io.crashbox" %% "spray-json" % "1.3.5-7" % Test)
.cross(CrossVersion.for3Use2_13),
"com.github.sbt" % "junit-interface" % "0.13.3" % Test
// includes junit 4.13.2
),
@@ -141,12 +154,6 @@ lazy val sconfig = crossProject(JVMPlatform, NativePlatform, JSPlatform)
Test / fork := true,
run / fork := true,
Test / run / fork := true,
// env vars for tests
Test / envVars ++= Map(
"testList.0" -> "0",
"testList.1" -> "1",
"testClassesPath" -> (Test / classDirectory).value.getPath
),
// uncomment for debugging
// Test / javaOptions += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005",
// mima settings
@@ -156,14 +163,20 @@ lazy val sconfig = crossProject(JVMPlatform, NativePlatform, JSPlatform)
.nativeConfigure(_.enablePlugins(ScalaNativeJUnitPlugin))
.nativeSettings(
crossScalaVersions := versions,
nativeConfig ~= (_.withLinkStubs(true)),
Test / nativeConfig ~= (
_.withEmbedResources(true)
),
logLevel := Level.Info, // Info or Debug
libraryDependencies += "org.ekrich" %%% "sjavatime" % javaTime % "provided"
)
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))
.jsSettings(
crossScalaVersions := versions,
libraryDependencies += "org.ekrich" %%% "sjavatime" % javaTime % "provided"
libraryDependencies ++= Seq(
"org.ekrich" %%% "sjavatime" % javaTime % "provided",
("org.scala-js" %%% "scalajs-weakreferences" % "1.0.0")
.cross(CrossVersion.for3Use2_13)
)
)

lazy val `scalafix-rules` = (project in file("scalafix/rules"))
50 changes: 43 additions & 7 deletions docs/SCALA-NATIVE.md
Original file line number Diff line number Diff line change
@@ -45,9 +45,40 @@ val maxCol = conf.getInt("maxColumn")
val isGit = conf.getBoolean("project.git")
```

### How to read a HOCON configuation file into a String for Scala Native
## Using Reader - StringReader example

In order to read the configuration file into a `String` you need to know the relative
Both JS and Native now support `java.io.Reader` which allows using `sconfig`
to parse all supported formats by passing a filename with extension. See the
following examples from the shared `ConfigFactoryTest` file.

```scala
val filename = "/test01.properties"
val fileStr =
"""
|# test01.properties file
|fromProps.abc=abc
|fromProps.one=1
|fromProps.bool=true
|fromProps.specialChars=hello^^
""".stripMargin

// create Reader
var test01Reader = new StringReader(fileStr)

val config = ConfigFactory.parseReader(
test01Reader,
ConfigParseOptions.defaults
.setSyntaxFromFilename(filename)
)
val specialChars = config.getString("fromProps.specialChars")
```

In Scala Native `java.io.FileReader` is available so you can create a
`FileReader` from a `File`.

### How to read a HOCON configuation file using Scala Native

In order to read a configuration file you need to know the relative
path from where the executable was started or use an absolute path. If the
Scala Native executable is `run` from `sbt` it will have the current working directory
equal to the directory at the base of your project where `sbt` was started. If curious
@@ -60,16 +91,21 @@ println(s"Working Dir: $dir")
```

Continuing the same thought process you can use the following code to read the file
into a `String` from a simple `sbt` project where the `src` directory is at the top
from a simple `sbt` project where the `src` directory is at the top
level of your project and you are using the `run` command. If you package your
application or run the application executable directly, then making the path relative
to the binary with the code above could be your best option. Another option is to use
the `"user.home"` or the `"user.dir"` property to configure the file path.
the `"user.home"` or the `"user.dir"` property to configure the file path. Note: When the
executable is added to the path, the current working directory is where you start the
executable from so keep that in mind

```scala
import java.nio.file.{Files, Paths}
val bytes = Files.readAllBytes(Paths.get("src/main/resources/myapp.conf"))
val configStr = new String(bytes)
import java.io.File
val file = new File("src/main/resources/myapp.conf")
// ConfigDocument
val configDocument = ConfigDocumentFactory.parseFile(file)
// or Config
val config = ConfigFactory.parseFile(file)
```

Using this code with the code above gives you a working solution to use `sconfig`
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.4
sbt.version=1.10.11
Loading