Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
xerial committed Jan 5, 2014
0 parents commit 491f3bb
Show file tree
Hide file tree
Showing 11 changed files with 1,132 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .gitignore
@@ -0,0 +1,19 @@
.lib
*~
*.class
*.log

# sbt specific
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/

# Scala-IDE specific
.scala_dependencies
.idea*

src/sbt-test/*/*/bin/.lib

113 changes: 113 additions & 0 deletions project/Build.scala
@@ -0,0 +1,113 @@
/*
* Copyright 2012 Taro L. Saito
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package xerial.sbt

import java.io.File
import sbt._
import Keys._
import sbt.ScriptedPlugin._
import sbtrelease.ReleasePlugin._

object SonatypeBuild extends Build {

val SCALA_VERSION = "2.10.3"

def releaseResolver(v: String): Resolver = {
val profile = System.getProperty("xerial.profile", "default")
profile match {
case "default" => {
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
"snapshots" at nexus + "content/repositories/snapshots"
else
"releases" at nexus + "service/local/staging/deploy/maven2"
}
case p => {
sys.error("unknown xerial.profile:%s".format(p))
}
}
}

lazy val buildSettings = Defaults.defaultSettings ++ releaseSettings ++ scriptedSettings ++ Seq[Setting[_]](
organization := "org.xerial.sbt",
organizationName := "Xerial project",
organizationHomepage := Some(new URL("http://xerial.org/")),
description := "A sbt plugin for automating staging processes in Sonatype",
scalaVersion := SCALA_VERSION,
publishMavenStyle := true,
publishArtifact in Test := false,
publishTo <<= version { (v) => Some(releaseResolver(v)) },
pomIncludeRepository := {
_ => false
},
sbtPlugin := true,
parallelExecution := true,
crossPaths := false,
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-target:jvm-1.6"),
scriptedBufferLog := false,
scriptedLaunchOpts ++= {
import scala.collection.JavaConverters._
management.ManagementFactory.getRuntimeMXBean().getInputArguments().asScala.filter(a => Seq("-Xmx","-Xms").contains(a) || a.startsWith("-XX")).toSeq
},
pomExtra := {
<url>http://xerial.org/</url>
<licenses>
<license>

<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<scm>
<connection>scm:git:github.com/xerial/sbt-sonatype.git</connection>
<developerConnection>scm:git:git@github.com:xerial/sbt-sonatype.git</developerConnection>
<url>github.com/xerial/sbt-sonatype.git</url>
</scm>
<developers>
<developer>
<id>leo</id>
<name>Taro L. Saito</name>
<url>http://xerial.org/leo</url>
</developer>
</developers>
}
)


// Project modules
lazy val sbtSonatype = Project(
id = "sbt-sonatype",
base = file("."),
settings = buildSettings ++ Seq(
libraryDependencies ++= Seq(
//"io.spray" % "spray-client" % "1.2.0",
//"com.typesafe.akka" %% "akka-actor" % "2.2.3",
"org.apache.httpcomponents" % "httpclient" % "4.2.6",
"org.scalatest" % "scalatest_2.10" % "2.0" % "test"
)
)
)

}








1 change: 1 addition & 0 deletions project/build.properties
@@ -0,0 +1 @@
sbt.version=0.13.1
8 changes: 8 additions & 0 deletions project/plugins.sbt
@@ -0,0 +1,8 @@

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1")

addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.7.1")

addSbtPlugin("com.mojolly.scalate" % "xsbt-scalate-generator" % "0.4.2")

libraryDependencies <+= sbtVersion("org.scala-sbt" % "scripted-plugin" % _)

0 comments on commit 491f3bb

Please sign in to comment.