Skip to content

Commit b2acfc7

Browse files
authored
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
1 parent 86407d9 commit b2acfc7

File tree

4 files changed

+41
-43
lines changed

4 files changed

+41
-43
lines changed

README.md

+17-34
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22
![CI](https://github.com/ekrich/sconfig/workflows/CI/badge.svg)
33
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-1.0.0.svg)](https://www.scala-js.org)
44

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

87
[Scala JVM](https://www.scala-lang.org/), [Scala Native](https://scala-native.readthedocs.io/), and [Scala.js](https://www.scala-js.org/)
98
are supported. Scala JVM is fully supported whereas the other platforms support a subset of the full API.
109

11-
For motivation and background about this project see the [PR](https://github.com/lightbend/config/pull/600)
12-
to the original project. The TLDR is the library was ported to Scala to support Scala Native so
13-
[scalafmt](https://scalameta.org/scalafmt/) which uses HOCON configuration could be compiled into
14-
a native application.
10+
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.
1511

16-
Care has been taken to keep the API the same but changes were needed when moving from the Java API.
17-
Using Java is also possible as demonstrated by including the working Java examples.
12+
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.
1813

1914
If you are looking for the original Java API, see
2015
[https://github.com/lightbend/config](https://github.com/lightbend/config).
@@ -38,26 +33,24 @@ All available versions can be seen at the [Maven Repository](https://mvnreposito
3833
## Cross Build Versions
3934
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-1.0.0.svg)](https://www.scala-js.org)
4035

41-
| Scala Version | JVM | Scala.js (1.x) | Native (0.4.x) |
36+
| Scala Version | JVM | Scala.js (1.x) | Native (0.5.x) |
4237
| ---------------------- | :-: | :-------------------: | :------------: |
4338
| 2.12.x ||||
4439
| 2.13.x ||||
4540
| 3.x.x ||||
4641

47-
Note: Scala 3 support on Scala Native 0.4.3-RC2 or greater. Scala 2.11 support through version 1.4.9.
42+
* Scala Native 0.5.x support from 0.7.0.
43+
* Scala 3 support on Scala Native 0.4.3-RC2 or greater.
44+
* Scala 2.11 support through version 1.4.9.
4845

4946
## Usage and Help
50-
[![Scaladoc](https://www.javadoc.io/badge/org.ekrich/sconfig_2.13.svg?label=scaladoc)](https://www.javadoc.io/doc/org.ekrich/sconfig_2.13)
5147
[![scaladoc](https://javadoc.io/badge/org.ekrich/sconfig_3.svg?label=scaladoc3)](https://javadoc.io/doc/org.ekrich/sconfig_3)
5248
[![Discord](https://img.shields.io/discord/633356833498595365.svg?label=&logo=discord&logoColor=ffffff&color=404244&labelColor=6A7EC2)](https://discord.gg/XSj6hQs)
5349

5450

55-
Please refer to the original library documentation [here](https://github.com/lightbend/config).
56-
This is to reduce the maintenance burden of this library.
51+
Please refer to the original library documentation [here](https://github.com/lightbend/config). This is to reduce the maintenance burden of this library.
5752

58-
The intent is to keep the library in sync with the original but each PR needs to be be ported
59-
to maintain feature parity. The documentation could contain features that are not yet implemented
60-
in this library.
53+
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.
6154

6255
For specific changes, refer to the releases below.
6356

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

69-
This project publishes a [scalafix](https://scalacenter.github.io/scalafix/) rule to migrate
70-
existing Scala 2 source code that uses `com.typesafe.config.Config` to this implementation.
71-
Scalafix rules modify in place existing valid Scala code. Think of it as a fancy find-and-replace
72-
tool that is aware of the Scala type system and can therefore narrowly tailor the changes
73-
being made. (Since scalafix changes the source code on your file system, it's best to commit
74-
any changes prior to running the rule, in case something weird happens.)
62+
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.)
7563

76-
The rule will replace `com.typesafe.config` package references with `org.ekrich.config`,
77-
and remove trailing parens on some methods (where the API changed from the Java implementation).
64+
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).
7865

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

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

8570
```scala
8671
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "a.b.c")
8772
```
88-
73+
8974
2. Add this project to the project's `libraryDependencies`, but don't remove the old one yet!
9075

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

94-
3. Run the scalafix sbt command shown below to apply the rule using the version of `sconfig`
95-
selected. Replace the `x.y.z` below with the version (must be greater than version `1.4.5`
96-
when scalafix was added):
78+
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):
9779

9880
```
9981
scalafixEnable; scalafixAll dependency:ReplaceTypesafeConfig@org.ekrich:sconfig-scalafix:x.y.x
10082
```
101-
83+
10284
4. Remove the old config dependency from the project's `libraryDependencies`
10385
5. Commit the changes
10486
10587
## Versions
10688
89+
Release [1.7.0](https://github.com/ekrich/sconfig/releases/tag/v1.7.0) - (2023-04-16)<br/>
10790
Release [1.6.0](https://github.com/ekrich/sconfig/releases/tag/v1.6.0) - (2023-12-28)<br/>
10891
Release [1.5.1](https://github.com/ekrich/sconfig/releases/tag/v1.5.1) - (2023-09-15)<br/>
10992
Release [1.5.0](https://github.com/ekrich/sconfig/releases/tag/v1.5.0) - (2022-09-19)<br/>

build.sbt

+6-7
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ val isScala3 = Def.setting {
4343
}
4444
}
4545

46-
val scala212 = "2.12.18"
47-
val scala213 = "2.13.12"
48-
val scala3 = "3.3.1"
46+
val scala212 = "2.12.19"
47+
val scala213 = "2.13.13"
48+
val scala3 = "3.3.3"
4949

50-
val javaTime = "1.1.9"
51-
val scCompat = "2.11.0"
50+
val javaTime = "1.3.0"
51+
val scCompat = "2.12.0"
5252

5353
val versionsBase = Seq(scala212, scala213)
5454
val versions = versionsBase :+ scala3
@@ -158,8 +158,7 @@ lazy val sconfig = crossProject(JVMPlatform, NativePlatform, JSPlatform)
158158
.nativeSettings(
159159
crossScalaVersions := versions,
160160
nativeConfig ~= (
161-
_.withLinkStubs(true)
162-
.withEmbedResources(true)
161+
_.withEmbedResources(true)
163162
),
164163
logLevel := Level.Info, // Info or Debug
165164
libraryDependencies += "org.ekrich" %%% "sjavatime" % javaTime % "provided"

project/plugins.sbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ resolvers ++= Resolver.sonatypeOssRepos("snapshots")
44
// versions
55
val crossVer = "1.3.2"
66
val scalaJSVersion = "1.16.0"
7-
val scalaNativeVersion = "0.4.17"
8-
val scalafix = "0.11.1"
7+
val scalaNativeVersion = "0.5.1"
8+
val scalafix = "0.12.0"
99

1010
// includes sbt-dynver sbt-pgp sbt-sonatype sbt-git
1111
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package java.net
2+
3+
import scalanative.annotation.stub
4+
5+
class URLConnection {
6+
@stub
7+
def getLastModified(): scala.Long = ???
8+
@stub
9+
def connect(): Unit = ???
10+
@stub
11+
def getContentType(): String = ???
12+
@stub
13+
def getInputStream(): java.io.InputStream = ???
14+
@stub
15+
def setRequestProperty(key: String, value: String): Unit = ???
16+
}

0 commit comments

Comments
 (0)