Skip to content

Commit ac92653

Browse files
committed
Merge pull request #19 from SethTisue/fat-jar
package as fat JAR, bump version to 0.1.1
2 parents 5c7e573 + 10f450b commit ac92653

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,18 @@ incremental recompile times.
1515

1616
## Building the plugin from source
1717

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

2021
## Using the plugin
2122

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

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

2827
Then you can do e.g.:
2928

30-
scalac -Xplugin:scala-sculpt_2.11-0.1.0.jar:spray-json_2.11-1.3.2.jar \
29+
scalac -Xplugin:scala-sculpt_2.11-0.1.1.jar \
3130
-Xplugin-require:sculpt \
3231
-P:sculpt:out=dep.json \
3332
Dep.scala
@@ -124,7 +123,7 @@ manipulation, e.g. in the REPL.
124123

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

127-
scala -classpath scala-sculpt_2.11-0.1.0.jar:spray-json_2.11-1.3.2.jar
126+
scala -classpath scala-sculpt_2.11-0.1.1.jar
128127

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

build.sbt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

@@ -24,6 +24,12 @@ scalacOptions ++= Seq(
2424
"-Xfatal-warnings"
2525
)
2626

27+
// generate same JAR name as `package` would:
28+
// - don't append "-assembly"; see issue #18
29+
// - and do include the "_2.11", don't know why assembly removes that by default
30+
assemblyJarName in assembly :=
31+
s"${name.value}_${scalaBinaryVersion.value}-${version.value}.jar"
32+
2733
mappings in (Compile, packageBin) ++= Seq(
2834
(baseDirectory.value / "README.md") -> "README.md",
2935
(baseDirectory.value / "LICENSE.md") -> "LICENSE.md")

project/assembly.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.1")

0 commit comments

Comments
 (0)