-
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.
Modelled after [toml-scala](https://github.com/sparsetech/toml-scala). Closes #20.
- Loading branch information
Showing
7 changed files
with
105 additions
and
21 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 |
---|---|---|
@@ -1,8 +1,29 @@ | ||
language: scala | ||
scala: | ||
- 2.11.12 | ||
- 2.12.8 | ||
language: java | ||
env: | ||
- TRAVIS_SCALA_VERSION=2.11.11 | ||
- TRAVIS_SCALA_VERSION=2.12.8 | ||
jdk: | ||
- oraclejdk8 | ||
|
||
dist: trusty | ||
sudo: required | ||
|
||
addons: | ||
apt: | ||
update: true | ||
|
||
# Cache directory to S3 at the end of the build | ||
cache: | ||
directories: | ||
- $HOME/.cache/coursier | ||
|
||
# From https://raw.githubusercontent.com/scalalandio/chimney/master/.travis.yml | ||
before_script: | ||
- if [[ "$TRAVIS_SCALA_VERSION" == 2.11.* ]]; then curl https://raw.githubusercontent.com/scala-native/scala-native/master/scripts/travis_setup.sh | bash -x; fi | ||
|
||
script: | ||
sbt ++$TRAVIS_SCALA_VERSION trailJS/test trailJVM/test | ||
- set -x && | ||
if [[ "$TRAVIS_SCALA_VERSION" == 2.11.* ]]; then testNative=trailNative/test; else testNative=""; fi && | ||
curl -o csbt https://raw.githubusercontent.com/coursier/sbt-launcher/master/csbt && | ||
chmod +x csbt && | ||
./csbt --add-coursier=true ++$TRAVIS_SCALA_VERSION trailJVM/test trailJS/test $testNative |
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,48 @@ | ||
package trail | ||
|
||
import java.net.URLEncoder | ||
import java.io.ByteArrayOutputStream | ||
|
||
object URI { | ||
/** @see http://stackoverflow.com/questions/607176/ */ | ||
def encode(s: String): String = | ||
URLEncoder.encode(s, "UTF-8") | ||
.replaceAll("\\+", "%20") | ||
.replaceAll("\\%21", "!") | ||
.replaceAll("\\%27", "'") | ||
.replaceAll("\\%28", "(") | ||
.replaceAll("\\%29", ")") | ||
.replaceAll("\\%7E", "~") | ||
|
||
/** Taken from https://android.googlesource.com/platform/libcore/+/adc854b798c1cfe3bfd4c27d68d5cee38ca617da/luni/src/main/java/java/net/URLDecoder.java */ | ||
def decode(s: String): String = { | ||
val result = new StringBuffer(s.length) | ||
val out = new ByteArrayOutputStream | ||
var i = 0 | ||
|
||
while (i < s.length) { | ||
val c = s.charAt(i) | ||
if (c == '+') result.append(' ') | ||
else if (c == '%') { | ||
out.reset() | ||
do { | ||
if (i + 2 >= s.length) | ||
throw new IllegalArgumentException("Incomplete % sequence at: " + i) | ||
val d1 = Character.digit(s.charAt(i + 1), 16) | ||
val d2 = Character.digit(s.charAt(i + 2), 16) | ||
if (d1 == -1 || d2 == -1) | ||
throw new IllegalArgumentException( | ||
s"Invalid % sequence (${s.substring(i, i + 3)}) at: ${String.valueOf(i)}.") | ||
out.write(((d1 << 4) + d2).toByte) | ||
i += 3 | ||
} while (i < s.length && s.charAt(i) == '%') | ||
result.append(out.toString("UTF-8")) | ||
} else { | ||
result.append(c) | ||
i += 1 | ||
} | ||
} | ||
|
||
result.toString | ||
} | ||
} |
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.6 | ||
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,4 +1,6 @@ | ||
logLevel := Level.Warn | ||
|
||
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.26") | ||
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0") | ||
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0") | ||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.26") | ||
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.8") |