Skip to content

Instantly share code, notes, and snippets.

@pchiusano
Created March 29, 2012 12:16
Show Gist options
  • Save pchiusano/2236706 to your computer and use it in GitHub Desktop.
Save pchiusano/2236706 to your computer and use it in GitHub Desktop.
Infinite jar
object ProjectBuild extends Build {
val pname = "ark"
lazy val project = Project (
pname,
file ("."),
settings = Defaults.defaultSettings ++ List(
name := pname,
organization := "org." + pname,
version := "0.1",
// logLevel in publishLocal := Level.Debug
// traceLevel in publishLocal := 1
packageOptions <+= version map { v =>
val m = new java.util.jar.Manifest
val attrs = new java.util.jar.Attributes
attrs.putValue("Version", v)
m.getEntries.put(pname, attrs)
Package.JarManifest(m)
},
libraryDependencies += "org.scala-tools.testing" %% "scalacheck" % "1.9",
scalaVersion := "2.9.1",
scalacOptions ++= List("-deprecation", "-unchecked"),
publishMavenStyle := false,
//ivyLoggingLevel := UpdateLogging.Full,
classpathConfiguration in Compile := Compile,
classpathConfiguration in Test := Test,
classpathConfiguration in Runtime := Runtime,
// Uncommenting the lines below seemed to cause infinite loop in one-jar task that resulted
// in it recursively including itself over and over again...
// Drop version numbers from our generated artifacts (jars)
//artifactName := { (config: String, module: ModuleID, artifact: Artifact) =>
// artifact.name + "." + artifact.extension
//},
mainClass := Some("ark.Main")
) ++ com.github.retronym.SbtOneJar.oneJarSettings
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment