diff --git a/.travis.yml b/.travis.yml index a75da83a6..69aa34f5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/build.sbt b/build.sbt index b1eb7d992..2a21b8c89 100644 --- a/build.sbt +++ b/build.sbt @@ -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 = "jeff.n.may@gmail.com", 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), ) diff --git a/project/build.properties b/project/build.properties index 0837f7a13..e67343ae7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.13 +sbt.version=1.5.0 diff --git a/project/plugins.sbt b/project/plugins.sbt index 91b7cc791..8f195addf 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -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") diff --git a/sonatype.sbt b/sonatype.sbt new file mode 100644 index 000000000..d175f5afc --- /dev/null +++ b/sonatype.sbt @@ -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", "jeff.n.may@gmail.com"))