sbt-eta

Build Status

An sbt plugin that overrides the build cycle to compile Etlas projects located in src/main/eta. It also provides tasks for compiling & running Scala/Eta programs.

Prerequisites

  • Etlas >= 1.5.0.0
    • Make sure it's visible on the PATH.

      etlas --version

Install

Add the following to your project/plugins.sbt file:

addSbtPlugin("com.typelead" % "sbt-eta" % "0.3.0")

For projects using Eta enable SbtEta plugin, e.g.:

val root = (project in file(".")).enablePlugins(SbtEta)

Example

An example project integration Eta with Scala is provided in the example directory.

An example of multi-project build included Eta projects is provided in the example-multi directory.

Basics

  1. Create a standard Scala/SBT project using your favorite method.

  2. Describe Eta project in build.sbt using plugin's DSL.

  3. Write Scala/Eta code to perform your task.

  4. Start up sbt and run the compile and/or run task.

Configuration

baseDirectory in Eta := target.value / "eta"
  • Type: File
  • Default: target/eta

This is the root of your Etlas project (where the .cabal file is placed).

target in Eta := target.value / "eta" / "dist"
  • Type: File
  • Default: target/eta/dist

This is where all of Etlas's build artifacts are stored.

sourceDirectory in EtaLib := (sourceDirectory in Compile).value / "eta"
  • Type: File
  • Default: src/main/eta

This is a directory containing sources of your Etlas project.

TODO

Project layout

By default the directory structure of project looks like the default one used by SBT and Maven:

   example/
   ├── build.sbt
   ├── src/
   |   ├── main/
   |   │   ├── eta/
   |   │   │   └── Example/
   |   │   │       └── Transform.hs
   |   │   └── java/
   |   │       └── Main.java
   |   └── test/
   |       └── eta/
   |           └── Example/
   |               └── TransformTest.hs
   └── target/
       └── eta/
           ├── dist/
           └── example-eta.cabal

License

sbt-eta is available under the BSD 3-Clause License, see LICENSE for more information.