forked from twitter-archive/sbt-thrift
/
SbtThriftPlugin.scala
54 lines (48 loc) · 2.04 KB
/
SbtThriftPlugin.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import sbt._
import com.twitter.sbt._
class SbtThriftPlugin(info: ProjectInfo) extends PluginProject(info)
with StandardManagedProject with DefaultRepos with SubversionPublisher {
override def disableCrossPaths = true
val jruby = "org.jruby" % "jruby-complete" % "1.6.0"
override val proxyRepo = environment.get("TUMBLR_REPO")
override def repositories = {
val defaultRepos = List(
"ibiblio" at "http://mirrors.ibiblio.org/pub/mirrors/maven2/",
"twitter.com" at "http://maven.twttr.com/",
"powermock-api" at "http://powermock.googlecode.com/svn/repo/",
"scala-tools.org" at "http://scala-tools.org/repo-releases/",
"testing.scala-tools.org" at "http://scala-tools.org/repo-releases/testing/",
"oauth.net" at "http://oauth.googlecode.com/svn/code/maven",
"download.java.net" at "http://download.java.net/maven/2/",
"atlassian" at "https://m2proxy.atlassian.com/repository/public/",
// for netty:
"jboss" at "http://repository.jboss.org/nexus/content/groups/public/"
)
proxyRepo match {
case Some(url) => localRepos + ("Tumblr Nexus Repo" at url)
case None => super.repositories ++ Set(defaultRepos: _*)
}
}
override def ivyRepositories = Seq(Resolver.defaultLocal(None)) ++ repositories
override def managedStyle = ManagedStyle.Maven
def publishUrl = environment.get("TUMBLR_PUBLISH_URL")
def snapshotDeployRepo = "snapshots"
def releaseDeployRepo = "releases"
lazy val publishTo = publishUrl match {
case Some(url) => if (version.toString.endsWith("SNAPSHOT")) {
"Tumblr Nexus" at (url + "/" + snapshotDeployRepo)
} else {
"Tumblr Nexus" at (url + "/" + releaseDeployRepo)
}
case None => throw new Exception("No TUMBLR_PUBLISH_URL specified")
}
Credentials(Path.userHome / ".ivy2" / ".credentials", log)
override def pomExtra =
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
}