Skip to content

Commit 86ddb28

Browse files
authored
Merge pull request #181 from ennru/travis-stages
2 parents 3069882 + 2e3ed78 commit 86ddb28

File tree

5 files changed

+76
-29
lines changed

5 files changed

+76
-29
lines changed

.travis.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
version: ~> 1.0
2+
13
language: scala
24

35
scala:
4-
- 2.12.10
5-
- 2.13.1
6+
- 2.12.11
7+
- 2.13.2
68

79
git:
810
depth: false # Avoid sbt-dynver not seeing the tag
@@ -22,6 +24,19 @@ script:
2224
- pushd samples/compile-timeDI/ && sbt ++$TRAVIS_SCALA_VERSION test && popd
2325
- pushd samples/runtimeDI/ && sbt ++$TRAVIS_SCALA_VERSION test && popd
2426

27+
jobs:
28+
include:
29+
- stage: deploy
30+
name: "TEMP Publish artifacts to Bintray"
31+
script: sbt +mimaReportBinaryIssues
32+
scala: 2.13.2
33+
env: TRAVIS_JDK=11
34+
35+
stages:
36+
- name: test
37+
- name: deploy
38+
if: ((branch = master AND type = push) OR (tag IS present)) AND NOT fork
39+
2540
cache:
2641
directories:
2742
- $HOME/.coursier/cache

build.sbt

+18-26
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import com.typesafe.sbt.SbtScalariform._
2-
import com.typesafe.tools.mima.plugin.MimaPlugin._
3-
import interplay.ScalaVersions
42
import scalariform.formatter.preferences._
53

64
ThisBuild / dynverVTagPrefix := false
75

8-
lazy val commonSettings = mimaDefaultSettings ++ Seq(
9-
// scalaVersion needs to be kept in sync with travis-ci
10-
scalaVersion := ScalaVersions.scala213,
11-
crossScalaVersions := Seq(ScalaVersions.scala212, ScalaVersions.scala213),
6+
lazy val commonSettings = Seq(
7+
scalaVersion := Dependencies.Scala213,
8+
crossScalaVersions := Dependencies.ScalaVersions,
129
scalariformAutoformat := true,
1310
ScalariformKeys.preferences := ScalariformKeys.preferences.value
1411
.setPreference(SpacesAroundMultiImports, true)
@@ -35,49 +32,44 @@ lazy val commonSettings = mimaDefaultSettings ++ Seq(
3532
"-Xlint:unchecked",
3633
"-Xlint:deprecation"
3734
),
38-
39-
mimaBinaryIssueFilters ++= Seq(
40-
)
4135
)
4236

43-
// needs to be kept in sync with travis-ci
44-
val PlayVersion = playVersion(sys.env.getOrElse("PLAY_VERSION", "2.8.0"))
45-
46-
// Version used to check binary compatibility
47-
val mimaPreviousArtifactsVersion = "7.0.1"
48-
4937
lazy val `play-mailer` = (project in file("play-mailer"))
50-
.enablePlugins(PlayLibrary)
38+
.enablePlugins(Common)
5139
.settings(commonSettings)
5240
.settings(
5341
libraryDependencies ++= Seq(
5442
"javax.inject" % "javax.inject" % "1",
5543
"com.typesafe" % "config" % "1.4.0",
5644
"org.slf4j" % "slf4j-api" % "1.7.30",
5745
"org.apache.commons" % "commons-email" % "1.5",
58-
"com.typesafe.play" %% "play" % PlayVersion % Test,
59-
"com.typesafe.play" %% "play-specs2" % PlayVersion % Test
46+
"com.typesafe.play" %% "play" % Dependencies.PlayVersion % Test,
47+
"com.typesafe.play" %% "play-specs2" % Dependencies.PlayVersion % Test
6048
),
61-
mimaPreviousArtifacts := Set("com.typesafe.play" %% "play-mailer" % mimaPreviousArtifactsVersion)
49+
mimaPreviousArtifacts := Set("com.typesafe.play" %% "play-mailer" % previousStableVersion.value
50+
.getOrElse(throw new Error("Unable to determine previous version")))
6251
)
6352

6453
lazy val `play-mailer-guice` = (project in file("play-mailer-guice"))
65-
.enablePlugins(PlayLibrary)
54+
.enablePlugins(Common)
6655
.settings(commonSettings)
6756
.dependsOn(`play-mailer`)
6857
.settings(
6958
libraryDependencies ++= Seq(
7059
"com.google.inject" % "guice" % "4.2.2",
71-
"com.typesafe.play" %% "play" % PlayVersion % Test,
72-
"com.typesafe.play" %% "play-specs2" % PlayVersion % Test
60+
"com.typesafe.play" %% "play" % Dependencies.PlayVersion % Test,
61+
"com.typesafe.play" %% "play-specs2" % Dependencies.PlayVersion % Test
7362
),
74-
mimaPreviousArtifacts := Set("com.typesafe.play" %% "play-mailer-guice" % mimaPreviousArtifactsVersion)
63+
mimaPreviousArtifacts := Set("com.typesafe.play" %% "play-mailer-guice" % previousStableVersion.value
64+
.getOrElse(throw new Error("Unable to determine previous version")))
7565
)
7666

7767
lazy val `play-mailer-root` = (project in file("."))
78-
.enablePlugins(PlayRootProject, PlayReleaseBase)
68+
.disablePlugins(MimaPlugin)
7969
.settings(commonSettings)
80-
.settings(mimaFailOnNoPrevious := false)
70+
.settings(
71+
crossScalaVersions := Nil,
72+
publish / skip := true
73+
)
8174
.aggregate(`play-mailer`, `play-mailer-guice`)
8275

83-
playBuildRepoName in ThisBuild := "play-mailer"

project/Common.scala

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import sbt.Keys._
2+
import sbt._
3+
import sbt.plugins.JvmPlugin
4+
5+
object Common extends AutoPlugin {
6+
override def trigger = allRequirements
7+
8+
override def requires = JvmPlugin
9+
10+
val repoName = "play-mailer"
11+
12+
override def globalSettings =
13+
Seq(
14+
organization := "com.typesafe.play",
15+
organizationName := "Lightbend Inc.",
16+
organizationHomepage := Some(url("https://www.lightbend.com/")),
17+
homepage := Some(url(s"https://github.com/playframework/${repoName}")),
18+
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")),
19+
20+
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-encoding", "utf8"),
21+
javacOptions ++= Seq("-encoding", "UTF-8", "-Xlint:-options"),
22+
23+
scmInfo := Some(ScmInfo(url(s"https://github.com/playframework/${repoName}"), s"scm:git:[email protected]:playframework/${repoName}.git")),
24+
developers += Developer("contributors",
25+
"Contributors",
26+
"https://gitter.im/playframework/contributors",
27+
url("https://github.com/playframework")),
28+
29+
description := "Play mailer plugin")
30+
}

project/Dependencies.scala

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import sbt._
2+
3+
object Dependencies {
4+
// scalaVersion needs to be kept in sync with travis-ci
5+
val Scala212 = "2.12.11"
6+
val Scala213 = "2.13.2"
7+
val ScalaVersions = Seq(Scala212, Scala213)
8+
9+
val PlayVersion = sys.props.getOrElse("play.version", sys.env.getOrElse("PLAY_VERSION", "2.8.0"))
10+
}

project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
addSbtPlugin("com.typesafe.play" % "interplay" % sys.props.getOrElse("interplay.version", "2.1.4"))
1+
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6")
22
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1")
33

44
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.3")

0 commit comments

Comments
 (0)