Skip to content

Instantly share code, notes, and snippets.

@weberste
Created February 15, 2011 16:05
Show Gist options
  • Save weberste/827705 to your computer and use it in GitHub Desktop.
Save weberste/827705 to your computer and use it in GitHub Desktop.
Unzip source JARs to simplify browsing in text editors.
trait SourceExtractor {
self: BasicScalaProject =>
def srcManagedDir = info.projectPath / "src_managed"
def scalaPaths = info.projectPath / "project" / "boot" / ("scala-" + crossScalaVersionString) ** "*-src.jar"
def libPaths = (managedDependencyPath ** "*-sources.jar")
lazy val sources = sourcesAction
def sourcesAction = task {
FileUtilities.clean(srcManagedDir, log)
(libPaths +++ scalaPaths).get.foreach { libPath: Path =>
FileUtilities.unzip(libPath, srcManagedDir, log)
}
None
} describedAs ("Extracts all the source JARs to make it easily browsable from an editor.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment