-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Full cross project with JVM supported * Add support for Scala Native compiling * Provide Scala Native as a cross project * Replace Java Stack with Scala ArrayStack * Remove Stack in PathBuilder * Remove unused URLConnection import * Add uTest and one testcase but don't run automatically * Fix up scalaCrossVersions as recommended * Add Metals and Bloop ignores * Native tests compile, link, and work against modified version of Scala Native * First changes to README to support new release. * Update travis, update build and docs with new package * Fix build.sbt after merge * Aggregate sconfigNative in build * Update scalafmt file with version for use with metals and other settings to match Scala Native * Update copyright date * Modify README and add users guide for Scala Native * Fix README * Changes for release 0.8.0 supporting Scala Native * Fix formatting * Add Linux build for Scala Native on Travis * Bump sbt version
- Loading branch information
Showing
215 changed files
with
241 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
.settings | ||
.idea | ||
.idea_modules | ||
.metals/ | ||
.bloop/ | ||
/bin-test-lib | ||
target/ | ||
/bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
version = 1.5.1 | ||
style = defaultWithAlign | ||
docstrings = JavaDoc | ||
assumeStandardLibraryStripMargin = true | ||
project.git = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Scala Native Help | ||
|
||
Scala Native support has been added so [scalafmt](https://scalameta.org/scalafmt/) can | ||
become a native application. The release has minimal capabilities at this time so | ||
the following is an example of how to use the API. | ||
|
||
## Read from String example | ||
|
||
This assumes that you read a file into a `configStr` first. | ||
|
||
```scala | ||
val configStr = | ||
""" | ||
|maxColumn = 100 | ||
|project.git=true | ||
|align = none | ||
|danglingParentheses = true | ||
|newlines.neverBeforeJsNative = true | ||
|newlines.sometimesBeforeColonInMethodReturnType = false | ||
|assumeStandardLibraryStripMargin = true | ||
""".stripMargin | ||
|
||
val conf = ConfigFactory.parseString(configStr) | ||
|
||
val maxCol = conf.getInt("maxColumn") | ||
val isGit = conf.getBoolean("project.git") | ||
``` | ||
|
||
### How to read a HOCON configuation file into a String | ||
|
||
In order to read the configuration file into a `String` 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 | ||
or the situation is unclear you can run the following code inside your Scala Native | ||
application to find the path. | ||
|
||
```scala | ||
val dir = System.getProperty("user.dir") | ||
println(s"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 | ||
level of your project. | ||
|
||
```scala | ||
import java.nio.file.{Files, Paths} | ||
val bytes = Files.readAllBytes(Paths.get("src/main/resources/myapp.conf")) | ||
val configStr = new String(bytes) | ||
``` | ||
|
||
Using this code with the code above gives you a working solution to use `sconfig` | ||
with Scala Native. | ||
|
||
[Back to README](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.2.7 | ||
sbt.version=1.2.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// includes sbt-dynver sbt-pgp sbt-sonatype sbt-git | ||
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.1") | ||
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.6") | ||
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.3.0") | ||
// for Scala Native support | ||
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0") | ||
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9") |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.