Skip to content

Commit

Permalink
Cherry-pick commit #1377486 (upgrade to bintray deployment)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlecan committed Jul 9, 2015
1 parent f75bcca commit e9541cb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
55 changes: 27 additions & 28 deletions project-code/project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import Keys._
import java.io.File
import com.typesafe.sbteclipse.plugin.EclipsePlugin._
import org.scalastyle.sbt.ScalastylePlugin
import bintray.BintrayPlugin
import bintray.BintrayPlugin.autoImport._

object Build extends Build {

import BuildSettings._
import Generators._

val nexus = "https://oss.sonatype.org/"
val scalasbt = "http://repo.scala-sbt.org/scalasbt/"

val curDir = new File(".")

val servlet31SampleProjectTargetDir = new File(curDir, "../sample/servlet31/target")
Expand All @@ -28,33 +27,33 @@ object Build extends Build {
//
// Root project
//
lazy val root = Project(id = "play2-war",
lazy val root = project(id = "play2-war",
base = file("."),
settings = commonSettings ++ mavenSettings ++ Seq(
publishArtifact := false)) aggregate (play2WarCoreCommon, play2WarCoreservlet30, play2WarCoreservlet25, play2WarCoreservlet31, play2WarPlugin, play2WarIntegrationTests)

//
// Servlet implementations
//
lazy val play2WarCoreCommon = Project(id = "play2-war-core-common",
lazy val play2WarCoreCommon = project(id = "play2-war-core-common",
base = file("core/common"),
settings = commonSettings ++ mavenSettings ++ Seq(
libraryDependencies += playDependency,
libraryDependencies += "javax.servlet" % "servlet-api" % "2.5" % "provided->default"))

lazy val play2WarCoreservlet31 = Project(id = "play2-war-core-servlet31",
lazy val play2WarCoreservlet31 = project(id = "play2-war-core-servlet31",
base = file("core/servlet31"),
settings = commonSettings ++ mavenSettings ++ Seq(
libraryDependencies += playDependency,
libraryDependencies += "javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided->default")) dependsOn play2WarCoreCommon

lazy val play2WarCoreservlet30 = Project(id = "play2-war-core-servlet30",
lazy val play2WarCoreservlet30 = project(id = "play2-war-core-servlet30",
base = file("core/servlet30"),
settings = commonSettings ++ mavenSettings ++ Seq(
libraryDependencies += playDependency,
libraryDependencies += "javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided->default")) dependsOn play2WarCoreCommon

lazy val play2WarCoreservlet25 = Project(id = "play2-war-core-servlet25",
lazy val play2WarCoreservlet25 = project(id = "play2-war-core-servlet25",
base = file("core/servlet25"),
settings = commonSettings ++ mavenSettings ++ Seq(
libraryDependencies += playDependency,
Expand All @@ -66,6 +65,7 @@ object Build extends Build {
lazy val play2WarPlugin = Project(id = "play2-war-plugin",
base = file("plugin"),
settings = commonSettings ++ ivySettings ++ Seq(
publishArtifact := true,
scalaVersion := buildScalaVersionForSbt,
scalaBinaryVersion := buildScalaVersionForSbtBinaryCompatible,
sbtPlugin := true,
Expand All @@ -80,7 +80,7 @@ object Build extends Build {
//
// Integration tests
//
lazy val play2WarIntegrationTests = Project(id = "integration-tests",
lazy val play2WarIntegrationTests = project(id = "integration-tests",
base = file("integration-tests"),
settings = commonSettings ++ mavenSettings ++ Seq(
sbtPlugin := false,
Expand All @@ -107,7 +107,6 @@ object Build extends Build {
scalacOptions ++= Seq("-unchecked", "-deprecation"),
EclipseKeys.withSource := true,
EclipseKeys.executionEnvironment := Some(EclipseExecutionEnvironment.JavaSE16),

publishArtifact in Test := false)

object BuildSettings {
Expand Down Expand Up @@ -140,29 +139,21 @@ object Build extends Build {

def ivySettings = commonIvyMavenSettings ++ Seq(
publishMavenStyle := false,
publishTo <<= version {
version: String => {
val (name, url) = if (version.contains("-SNAPSHOT")) {
("sbt-plugin-snapshots", scalasbt+"sbt-plugin-snapshots")
} else {
("sbt-plugin-releases", scalasbt+"sbt-plugin-releases")
}
Some(Resolver.url(name, new URL(url))(Resolver.ivyStylePatterns))
}
}
bintrayReleaseOnPublish := false,
bintrayRepository := "sbt-plugins",
bintrayOrganization := Some("play2war")
)

def mavenSettings = commonIvyMavenSettings ++ Seq(
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
publishTo <<= version {
version: String => {
if (version.trim.endsWith("SNAPSHOT")) {
Some("snapshots" at nexus + "content/repositories/snapshots")
} else {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
}
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) {
Some("snapshots" at nexus + "content/repositories/snapshots")
} else {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
},
pomExtra :=
<scm>
Expand All @@ -175,6 +166,11 @@ object Build extends Build {
<name>Damien Lecan</name>
<email>dev@dlecan.com</email>
</developer>
<developer>
<id>ysimon</id>
<name>Yann Simon</name>
<email>yann.simon.fr@gmail.com</email>
</developer>
</developers>
)

Expand All @@ -193,4 +189,7 @@ object Build extends Build {
}

}

def project(id: String, base: File, settings: Seq[Def.Setting[_]] = Nil) =
Project(id, base, settings = settings)
}
2 changes: 1 addition & 1 deletion project-code/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.0
sbt.version=0.13.8
2 changes: 2 additions & 0 deletions project-code/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ resolvers += Resolver.typesafeRepo("releases")
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0")

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.3.2")

addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")

0 comments on commit e9541cb

Please sign in to comment.