-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish to sonatype upgrade to sbt 1.5.0
- Upgrade sbt to 1.5.0 - Update build configs to publish to sonatype / maven central - Replace sbt-git-versioning with sbt-dynver plugin - Update Travis build - Pre-cache sbt 1.5.0 - Support Coursier cache
- Loading branch information
Showing
5 changed files
with
49 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
language: scala | ||
scala: | ||
- 2.13.0 | ||
- 2.13.5 | ||
jdk: | ||
- openjdk8 | ||
- openjdk11 | ||
|
||
before_script: | ||
# Download sbt because Travis can't find it automatically :( | ||
- mkdir -p $HOME/.sbt/launchers/1.5.0/ | ||
- curl -L -o $HOME/.sbt/launchers/1.5.0/sbt-launch.jar https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.5.0/sbt-launch-1.5.0.jar | ||
|
||
script: | ||
- sbt scalafmtCheckAll clean coverage test coverageAggregate coverageOff | ||
|
||
after_success: | ||
# Upload coverage reports to codecov.io | ||
- bash <(curl -s https://codecov.io/bash) | ||
|
||
# Tricks to avoid unnecessary cache updates | ||
- find $HOME/.sbt -name "*.lock" | xargs rm | ||
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm | ||
# Avoid unnecessary cache updates | ||
before_cache: | ||
- rm -fv $HOME/.ivy2/.sbt.ivy.lock | ||
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete | ||
- find $HOME/.sbt -name "*.lock" -print -delete | ||
|
||
# These directories are cached to S3 at the end of the build | ||
cache: | ||
directories: | ||
- $HOME/.m2/repository | ||
- $HOME/.ivy2 | ||
- $HOME/.cache/coursier | ||
- $HOME/.ivy2/cache | ||
- $HOME/.sbt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ name := "vapors-root" | |
ThisBuild / organization := "com.rallyhealth" | ||
ThisBuild / organizationName := "Rally Health" | ||
|
||
ThisBuild / licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")) | ||
|
||
ThisBuild / versionScheme := Some("early-semver") | ||
ThisBuild / scalaVersion := Dependencies.Scala_2_13 | ||
ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")) | ||
|
||
ThisBuild / scalacOptions ++= Seq( | ||
"-deprecation:false", | ||
|
@@ -16,19 +16,20 @@ ThisBuild / scalacOptions ++= Seq( | |
"-Ymacro-annotations", | ||
) | ||
|
||
ThisBuild / bintrayOrganization := Some("rallyhealth") | ||
ThisBuild / bintrayRepository := "maven" | ||
// reload sbt when the build files change | ||
Global / onChangedBuildSource := ReloadOnSourceChanges | ||
|
||
ThisBuild / resolvers += Resolver.bintrayRepo("rallyhealth", "maven") | ||
//homepage := Some(url("https://(your project url)")) | ||
developers := List( | ||
Developer(id = "jeffmay", name = "Jeff May", email = "[email protected]", url = url("https://github.com/jeffmay")), | ||
) | ||
|
||
// ScalaDoc generation is generally broken. It's really mostly useful from within the IDE anyway | ||
// so just disable generation to allow publishing without ScalaDoc errors. | ||
ThisBuild / Compile / packageDoc / publishArtifact := false | ||
ThisBuild / packageDoc / publishArtifact := false | ||
|
||
// Disable publishing of the root project | ||
publish := {} | ||
publishLocal := {} | ||
publish / skip := true | ||
|
||
def commonProject(dir: String): Project = { | ||
Project(dir, file(dir)).settings( | ||
|
@@ -38,5 +39,6 @@ def commonProject(dir: String): Project = { | |
|
||
lazy val core = commonProject("core") | ||
.settings( | ||
resolvers += Resolver.bintrayRepo("rallyhealth", "maven"), | ||
libraryDependencies ++= Dependencies.CoreProject.all(scalaVersion.value), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.3.13 | ||
sbt.version=1.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,6 @@ | ||
resolvers += Classpaths.sbtPluginReleases | ||
|
||
resolvers += Resolver.url( | ||
"Rally Plugin Releases", | ||
url("https://dl.bintray.com/rallyhealth/sbt-plugins"), | ||
)(Resolver.ivyStylePatterns) | ||
|
||
resolvers += Resolver.url( | ||
"bintray-sbt-plugin-releases", | ||
url("https://dl.bintray.com/content/sbt/sbt-plugin-releases"), | ||
)(Resolver.ivyStylePatterns) | ||
|
||
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6") | ||
// Not needed for Scala 2.13, but leaving this here for if we want to cross-compile to Scala 2.11 | ||
// addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.2") | ||
addSbtPlugin("com.rallyhealth.sbt" %% "sbt-git-versioning" % "1.4.0") | ||
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") | ||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") | ||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") | ||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Your profile name of the sonatype account. The default is the same with the organization value | ||
sonatypeProfileName := "com.rallyhealth" | ||
|
||
// To sync with Maven central, you need to supply the following information: | ||
publishMavenStyle := true | ||
|
||
// publish to Maven Central | ||
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" | ||
ThisBuild / publishTo := Some { | ||
if (isSnapshot.value) | ||
Resolver.url("Sonatype", url("https://s01.oss.sonatype.org/content/repositories/snapshots")) | ||
else | ||
Resolver.url("Sonatype", url("https://s01.oss.sonatype.org/content/repositories/releases")) | ||
} | ||
|
||
// add SNAPSHOT to non-release versions so they are not published to the main repo | ||
ThisBuild / dynverSonatypeSnapshots := true | ||
// Use '-' instead of '+' for simpler snapshot URLs | ||
ThisBuild / dynverSeparator := "-" | ||
|
||
import xerial.sbt.Sonatype.GitHubHosting | ||
sonatypeProjectHosting := Some(GitHubHosting("jeffmay", "vapors", "[email protected]")) |