Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ incremental recompile times.

## Building the plugin from source

`sbt package` will create `target/scala-2.11/scala-sculpt_2.11-0.1.0.jar`.
`sbt assembly` will create `target/scala-2.11/scala-sculpt_2.11-0.1.1.jar`.
(The JAR is a fat JAR that bundles its dependency on spray-json.)

## Using the plugin

You can use the compiled plugin with the Scala 2.11 compiler as follows.

Supposing you have `scala-sculpt_2.11-0.1.0.jar` in your current working directory,
along with `spray-json_2.11-1.3.2.jar` (which you can download
[here](http://repo1.maven.org/maven2/io/spray/spray-json_2.11/1.3.2/spray-json_2.11-1.3.2.jar).
Supposing you have `scala-sculpt_2.11-0.1.1.jar` in your current working directory,

Then you can do e.g.:

scalac -Xplugin:scala-sculpt_2.11-0.1.0.jar:spray-json_2.11-1.3.2.jar \
scalac -Xplugin:scala-sculpt_2.11-0.1.1.jar \
-Xplugin-require:sculpt \
-P:sculpt:out=dep.json \
Dep.scala
Expand Down Expand Up @@ -124,7 +123,7 @@ manipulation, e.g. in the REPL.

Now in a Scala 2.11 REPL with the same JARs on the classpath:

scala -classpath scala-sculpt_2.11-0.1.0.jar:spray-json_2.11-1.3.2.jar
scala -classpath scala-sculpt_2.11-0.1.1.jar

If we load `dep.json` as follows, we'll see the following graph:

Expand Down
8 changes: 7 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

organization := "com.typesafe"
name := "scala-sculpt"
version := "0.1.0"
version := "0.1.1"
licenses := Seq("Apache License v2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
homepage := Some(url("http://github.com/typesafehub/scala-sculpt"))

Expand All @@ -24,6 +24,12 @@ scalacOptions ++= Seq(
"-Xfatal-warnings"
)

// generate same JAR name as `package` would:
// - don't append "-assembly"; see issue #18
// - and do include the "_2.11", don't know why assembly removes that by default
assemblyJarName in assembly :=
s"${name.value}_${scalaBinaryVersion.value}-${version.value}.jar"

mappings in (Compile, packageBin) ++= Seq(
(baseDirectory.value / "README.md") -> "README.md",
(baseDirectory.value / "LICENSE.md") -> "LICENSE.md")
Expand Down
1 change: 1 addition & 0 deletions project/assembly.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.1")