Skeleton for creating your new Scala project based on Sinetja.
See also:
- Sinetja-Skeleton8: If you want to use Java 8 with its lambda syntax.
- Sinetja-Skeleton: If you use older Java.
sbt/sbt run
To create Eclipse project:
sbt/sbt eclipse
To create IntelliJ project:
sbt/sbt gen-idea
You then can run the project inside Eclipse or IntelliJ.
For your convenience, this skeleton includes (see build.sbt) the superfast Scalatags template engine. You can use others if you want.
If you want to use Scala XML syntax, add to build.sbt:
libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.0.2"
Because XML is a little different than XHTML (e.g. closing tag), if you want to render HTML, you need to do like this:
import scala.xml.Xhtml res.respondHtml(Xhtml.toXhtml( <body> <p>Hi World</p> </body> ))
If you just return the XML as is, without the Xhtml.toXhtml
converter,
the result may not be rendered correctly as you want.
To package for distribution:
sbt/sbt xitrum-package
Directory target/xitrum
will be created.
To run:
cd target/xitrum script/start
It will run main
method in class skeleton.App
.
Please modify the start script if you want to run other.