diff options
author | Li Haoyi <haoyi@dropbox.com> | 2015-03-28 22:16:57 +0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2015-03-28 22:16:57 +0800 |
commit | 1ac4a2594bf2ebe1fc80b93f1208343653892517 (patch) | |
tree | 7f07cee1d4e6a608853c6f862550675165b78dfb /book/src/main/scalatex/handson/PublishingModules.scalatex | |
parent | 7006cebd061784900233c405ce03665151b86010 (diff) | |
download | hands-on-scala-js-1ac4a2594bf2ebe1fc80b93f1208343653892517.tar.gz hands-on-scala-js-1ac4a2594bf2ebe1fc80b93f1208343653892517.tar.bz2 hands-on-scala-js-1ac4a2594bf2ebe1fc80b93f1208343653892517.zip |
scalatex 0.2.1
Diffstat (limited to 'book/src/main/scalatex/handson/PublishingModules.scalatex')
-rw-r--r-- | book/src/main/scalatex/handson/PublishingModules.scalatex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/book/src/main/scalatex/handson/PublishingModules.scalatex b/book/src/main/scalatex/handson/PublishingModules.scalatex index 61a21d5..395ead9 100644 --- a/book/src/main/scalatex/handson/PublishingModules.scalatex +++ b/book/src/main/scalatex/handson/PublishingModules.scalatex @@ -11,7 +11,7 @@ @p As always, we will start with an example: in this case a toy library whose sole purpose in life is to take a series of timestamps (milliseconds UTC) and format them into a single, newline-delimited string. This is what the project layout looks like: - @hl.bash + @hl.sh $ tree . ├── build.sbt @@ -59,13 +59,13 @@ @hl.ref(simple/'library/'jvm/'src/'main/'scala/'simple/"Platform.scala") @p - In the @code{js/} version, we are using the Javascript @hl.javascript{Date} object to take the millis and do what we want. In the @code{jvm/} version, we instead use @hl.scala{java.text.SimpleDateFormat} with a custom formatter (The syntax is defined @lnk("here", "http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html")). + In the @code{js/} version, we are using the Javascript @hl.js{Date} object to take the millis and do what we want. In the @code{jvm/} version, we instead use @hl.scala{java.text.SimpleDateFormat} with a custom formatter (The syntax is defined @lnk("here", "http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html")). @p Again, you can put as much platform-specific logic in these files as you want, to account for differences in the available APIs. Maybe you want to use @lnk.dom.JSONparse for parsing JSON blobs in @code{js/}, but @lnk("Jackson", "http://jackson.codehaus.org/") or @lnk("GSON", "https://code.google.com/p/google-gson/") for parsing them in @code{jvm/}. @sect{Running the Module} - @hl.bash + @hl.sh > ;libraryJS/test ;libraryJVM/test [info] Compiling 1 Scala source to library/js/target/scala-2.10/test-classes... [info] ---------------------------Results--------------------------- |