scala-s3

aws s3 client in scala

git clone https://9o.is/git/scala-s3.git

BuildSettings.scala

(2282B)


      1 import sbt._
      2 import sbt.Keys._
      3 
      4 import sbtbuildinfo.Plugin._
      5 import com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseKeys
      6 import ohnosequences.sbt.SbtS3Resolver._
      7 
      8 object BuildSettings {
      9   val buildTime = SettingKey[String]("build-time")
     10 
     11   val basicSettings = Defaults.defaultSettings ++ Seq(
     12     name := "aws-s3",
     13     version := "0.1",
     14     organization := "inc.pyc",
     15     scalaVersion := "2.10.3",
     16     scalacOptions <<= scalaVersion map { sv: String =>
     17       if (sv.startsWith("2.10."))
     18         Seq("-deprecation", "-unchecked", "-feature", "-language:postfixOps", "-language:implicitConversions")
     19       else
     20         Seq("-deprecation", "-unchecked")
     21     },
     22     resolvers += "Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases"
     23   )
     24 
     25   val appSettings = 
     26     basicSettings ++
     27     S3Resolver.defaults ++
     28     buildInfoSettings ++
     29     seq(
     30       buildTime := System.currentTimeMillis.toString,
     31 
     32       // build-info
     33       buildInfoKeys ++= Seq[BuildInfoKey](buildTime),
     34       buildInfoPackage := "inc.pyc",
     35       sourceGenerators in Compile <+= buildInfo,
     36 
     37       // eclipse
     38       EclipseKeys.withSource := true,
     39       
     40       publishMavenStyle := true,
     41             
     42       publishTo := Some(s3resolver.value(
     43           "My "+{if (isSnapshot.value) "snapshots-pyc-inc" else "releases-pyc-inc"}+" S3 bucket", 
     44           s3(if (isSnapshot.value) "snapshots-pyc-inc" else "releases-pyc-inc"))),
     45       
     46       s3credentials := {
     47         Path.userHome / ".ivy2" / ".s3credentials"
     48       },
     49       
     50       s3region := com.amazonaws.services.s3.model.Region.US_Standard,
     51       
     52       publishMavenStyle := true,
     53       publishArtifact in Test := false,
     54       pomIncludeRepository := { _ => false },
     55       licenses := Seq("Apache 2.0 License" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")),
     56       pomExtra := (
     57         <url>https://bitbucket.org/pyd/s3</url>
     58         <scm>
     59           <url>git@bitbucket.org:pyd/s3.git</url>
     60           <connection>scm:git:git@bitbucket.org:pyd/s3.git</connection>
     61         </scm>
     62         <developers>
     63           <developer>
     64             <id>jcabrra</id>
     65             <name>Julio Cabrera</name>
     66           </developer>
     67         </developers>
     68       )
     69     )
     70 
     71   lazy val noPublishing = seq(
     72     publish := (),
     73     publishLocal := ()
     74   )
     75 }
     76