pkuwak / ml-in-scala

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Data/Code repository for ML in Scala book

Download Scala, SBT and Java

For example:

$ wget --no-cookies --no-check-certificate --header 'Cookie: oraclelicense=accept-securebackup-cookie' http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jdk-8u77-linux-x64.rpm

Compiling

To compile all code, do

$ sbt package

Alternatively, you can go to individual directories and type sbt run, which in most cases should run the application (chapter 10 needs to start a jetty service, in which case you need sbt jetty:start).

Interactive mode

SBT has an interactive command line capabilites. For example, to continuously compile code on each source file change, do

$ sbt
...
> ~run
...

Generating docs

SBT will generate Scaladoc with sbt doc command.

Scalastyle

To add SBT Scalastyle plugin create the project/plugins.sbt file:

$ cat <<EOF > project.plugin.sbt 
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")
EOF
$ sbt scalastyleGenerateConfig
$ sbt scalastyle
...

Using with Eclipse

Currently, you need to install the sbteclipse plugin with your SBT environment (add the following line to your build.sbt)

$ echo 'addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")' >> project/plugins.sbt
$ sbt eclipse
...

The eclipse target will be added to create the Eclipse .project and .classpath files. Import the project from Eclipse for Scala.

Cleanup

Sbt does not clean target directories. For complete cleanup, do:

$ sbt clean
$ find . -name target -exec rm -rf {} \;

About

License:The Unlicense


Languages

Language:Scala 61.6%Language:Shell 36.9%Language:Python 1.3%Language:R 0.1%