Created
November 24, 2009 22:35
-
-
Save al3x/242304 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override def mainClass = Some("com.yourcompany.yourproject.Main") | |
| /** | |
| * In the classpath: | |
| * - all dependencies (via Ivy/Maven and in lib) | |
| * - package classes | |
| * On the filesystem: | |
| * - scripts | |
| * - config | |
| */ | |
| def distPath = ( | |
| // NOTE the double hashes (##) hoist the files in the preceeding directory | |
| // to the top level - putting them in the "base directory" in sbt's terminology | |
| ((outputPath ##) / defaultJarName) +++ | |
| mainResources +++ | |
| mainDependencies.scalaJars +++ | |
| descendents(info.projectPath, "*.sh") +++ | |
| descendents(info.projectPath, "*.rb") +++ | |
| descendents(info.projectPath, "*.conf") +++ | |
| descendents(info.projectPath / "lib" ##, "*.jar") +++ | |
| descendents(managedDependencyRootPath / "compile" ##, "*.jar") | |
| ) | |
| // creates a sane classpath including all JARs and populates the manifest with it | |
| override def manifestClassPath = Some( | |
| distPath.getFiles | |
| .filter(_.getName.endsWith(".jar")) | |
| .map(_.getName).mkString(" ") | |
| ) | |
| def distName = "yourproject-%s.zip".format(version) | |
| lazy val zip = zipTask(distPath, "dist", distName) dependsOn (`package`) describedAs("Zips up the project.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment