Browse files

fix for local publish

  • Loading branch information...
1 parent 4fd415a commit 9d3c852d2b242f509f7124cf9f71ad00923bf7a9 Robey Pointer committed May 30, 2012
Showing with 10 additions and 4 deletions.
  1. +2 −2 project/Build.scala
  2. +8 −2 src/main/scala/com/twitter/sbt/CompileScrooge.scala
View
4 project/Build.scala
@@ -7,7 +7,8 @@ object SbtScroogePlugin extends Build {
id = "sbt11-scrooge",
base = file("."),
settings = StandardProject.newSettings ++
- SubversionPublisher.newSettings
+ SubversionPublisher.newSettings ++
+ ScriptedPlugin.scriptedSettings
).settings(
name := "sbt11-scrooge",
organization := "com.twitter",
@@ -16,5 +17,4 @@ object SbtScroogePlugin extends Build {
SubversionPublisher.subversionRepository := Some("https://svn.twitter.biz/maven-public")
)
- .settings(ScriptedPlugin.scriptedSettings: _*)
}
View
10 src/main/scala/com/twitter/sbt/CompileScrooge.scala
@@ -168,8 +168,14 @@ object CompileThriftScrooge extends Plugin {
out.log.info("Fetching scrooge " + ver + " ...")
val environment = System.getenv().asScala
- val repoUrl = environment.get("SBT_PROXY_REPO") getOrElse "http://maven.twttr.com/"
- val fetchUrl = repoUrl + "/com/twitter/scrooge/" + ver + "/scrooge-" + ver + ".zip"
+ val homeRepo = environment.get("SBT_PROXY_REPO") getOrElse "http://maven.twttr.com/"
+ val localRepo = System.getProperty("user.home") + "/.m2/repository/"
+ val zipPath = "/com/twitter/scrooge/" + ver + "/scrooge-" + ver + ".zip"
+ val fetchUrl = if (new File(localRepo + zipPath).exists) {
+ "file:" + localRepo + zipPath
+ } else {
+ homeRepo + zipPath
+ }
out.log.info("Fetching from: " + fetchUrl)
cacheFolder.asFile.mkdirs()

0 comments on commit 9d3c852

Please sign in to comment.