Skip to content

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
xerial committed Aug 27, 2013
2 parents 48c3a55 + 5b87484 commit 0a5919f
Show file tree
Hide file tree
Showing 18 changed files with 684 additions and 120 deletions.
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
sbt-pack plugin
========

A sbt plugin for creating distributable Scala packages that include dependent jars and launch scripts.
A sbt plugin for creating a distributable Scala package that includes dependent jars and launch scripts.

### Features

- `sbt pack` creates a distributable package in `target/pack` folder.
- All dependent jars, including scala-library, are collected in `target/pack/lib` folder. This process is much faster than creating a single-jar as in `sbt-assembly` or `proguard` plugins.
- Multi-module projects are supported.
- All dependent jars including scala-library.jar are collected in `target/pack/lib` folder. This process is much faster than creating a single-jar as in `sbt-assembly` or `proguard` plugins.
- sbt-pack supports multi-module projects.
- `tar.gz` archive generation via `sbt pack-archive` command.
- Generates program launch scripts `target/pack/bin/{program name}`
- To run the program no need exists to install Scala, since it is included in the lib folder. Only java command needs to be found in the system.
- `sbt pack-archive` command creates a tar.gz archive, `target/{program name}-{version}.tar.gz`.
- You can install your Scala programs to local machine via `cd target/pack; make install`. Then you can run the command with `~/local/bin/{program name}`
- You can install multiple versions of your program in the system.
- The above Makefile script uses a separate folder for each version (e.g., `~/local/{project name}/{project version}`).
- The latest version is linked from `~/local/{project name}/current`
- You can add other resources to be packed in `src/pack` folder.
- You can add other resources pack in `src/pack` folder.
- All resources in this folder will be copied to `target/pack`.

### Release Notes
- August 21, 2013 - 0.3.0 release (only for sbt-0.13 or higher)

- August 21, 2013 - 0.2.4 release (for sbt-0.12.x)
* Refine log messages
- August 20, 2013 - 0.2.1 release
* Add a sample multi-module project
* Fixes #11, #12
- May 16, 2013 - Version 0.2 release
- Stable version
- Delete only lib folder when `make install`
Expand All @@ -31,9 +40,10 @@ Add `sbt-pack` plugin to your sbt configuration:
**project/plugins.sbt**

```scala
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.2")
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.2.4") // for sbt-0.12.x

addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.3.0") // for sbt-0.13.x or higher
```
- sbt 0.12.x or higher is required.

Import `xerial.sbt.Pack.packSettings` into your project settings. Then set `packMain` variable, a mapping from the your program names to their corresponding main classes. The main classes must be Scala objects that define `def main(args:Array[])` method:

Expand Down Expand Up @@ -117,3 +127,16 @@ in the source code. It contains several Scala project examples using sbt-pack.
- A minimal project to start writing Scala programs.


### For developers

Creating IntelliJ project:

$ bin/sbt "gen-idea sbt-classifiers"

To test sbt-pack plugin, run

$ bin/sbt scripted

Run a single test project, e.g., `src/sbt-test/sbt-pack/multi-module`:

$ bin/sbt "scripted sbt-pack/multi-module"
6 changes: 3 additions & 3 deletions bin/sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ die() {
}

# todo - make this dynamic
declare -r sbt_release_version=0.12.2
declare -r sbt_release_version=0.13.0
unset sbt_rc_version
declare -r sbt_rc_version=0.12.2
declare -r sbt_rc_version=0.13.0
declare -r sbt_snapshot_version=0.13.0-SNAPSHOT
declare -r sbt_snapshot_baseurl="http://typesafe.artifactoryonline.com/typesafe/ivy-snapshots/org.scala-sbt/sbt-launch/"

Expand All @@ -49,7 +49,7 @@ declare -r sbt_opts_file=".sbtopts"
declare -r jvm_opts_file=".jvmopts"
declare -r latest_28="2.8.2"
declare -r latest_29="2.9.2"
declare -r latest_210="2.10.0"
declare -r latest_210="2.10.2"

declare -r script_path=$(get_script_path "$BASH_SOURCE")

Expand Down
7 changes: 3 additions & 4 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import ScalateKeys._

object PackBuild extends Build {

val SCALA_VERSION = "2.9.2"
val SCALA_VERSION = "2.10.2"

def releaseResolver(v: String): Resolver = {
val profile = System.getProperty("xerial.profile", "default")
Expand Down Expand Up @@ -61,7 +61,7 @@ object PackBuild extends Build {
sbtPlugin := true,
parallelExecution := true,
crossPaths := false,
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-target:jvm-1.5"),
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-target:jvm-1.6"),
scriptedBufferLog := false,
scriptedLaunchOpts ++= {
import scala.collection.JavaConverters._
Expand Down Expand Up @@ -101,8 +101,7 @@ object PackBuild extends Build {
settings = buildSettings ++
Seq(libraryDependencies ++=
Seq(
"org.scalatest" %% "scalatest" % "2.0.M5" % "test",
"org.fusesource.scalate" % "scalate-core_2.9" % "1.6.1",
"org.fusesource.scalate" % "scalate-core_2.10" % "1.6.1",
"org.kamranzafar" % "jtar" % "2.2",
"org.slf4j" % "slf4j-nop" % "1.7.5"
)
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.12.2
sbt.version=0.13.0
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1")

addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.6")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.7.1")

addSbtPlugin("com.mojolly.scalate" % "xsbt-scalate-generator" % "0.4.2")

Expand Down
Loading

0 comments on commit 0a5919f

Please sign in to comment.