Skip to content

Commit

Permalink
Improve Build (#12)
Browse files Browse the repository at this point in the history
Improve Build
  • Loading branch information
ChristopherDavenport authored Sep 23, 2019
2 parents 8c8573a + 0530b56 commit 6c68835
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 86 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ language: scala
jdk:
- openjdk11

scala_version_212: &scala_version_212 "2.12.10"

before_install:
- git fetch --tags
- export PATH=${PATH}:./vendor/bundle
Expand All @@ -16,14 +18,14 @@ stages:
jobs:
include:
- name: test 2.12
scala: 2.12.9
scala: *scala_version_212
script: sbt ++$TRAVIS_SCALA_VERSION test
# -
# name: mima
# script: sbt +mimaReportBinaryIssues
-
name: docs
scala: 2.12.9
scala: *scala_version_212
install:
- rvm use 2.6.0 --install --fuzzy
- gem update --system
Expand All @@ -37,7 +39,7 @@ jobs:
- sbt ci-release
- stage: release
name: microsite
scala: 2.12.9
scala: *scala_version_212
install:
- rvm use 2.6.0 --install --fuzzy
- gem update --system
Expand All @@ -49,4 +51,5 @@ cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.coursier/cache
- $HOME/.cache
- $HOME/.sbt
139 changes: 56 additions & 83 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
lazy val `sbt-mima-version-check` = project.in(file("."))
.disablePlugins(MimaPlugin)
.enablePlugins(NoPublishPlugin)
.settings(commonSettings, releaseSettings)
.aggregate(core, docs)

lazy val core = project.in(file("core"))
.settings(commonSettings, releaseSettings)
.enablePlugins(SbtPlugin)
.settings(
name := "sbt-mima-version-check",
sbtPlugin := true,
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1"),

scriptedLaunchOpts := { scriptedLaunchOpts.value ++
Expand All @@ -27,95 +24,71 @@ lazy val docs = project.in(file("docs"))
.enablePlugins(MicrositesPlugin)
.enablePlugins(TutPlugin)
.enablePlugins(NoPublishPlugin)
.settings(commonSettings, micrositeSettings)
.settings{
import microsites._
List(
micrositeName := "sbt-mima-version-check",
micrositeDescription := "Plugin to Automate which Mima Versions to Check",
micrositeAuthor := "Christopher Davenport",
micrositeGithubOwner := "ChristopherDavenport",
micrositeGithubRepo := "sbt-mima-version-check",
micrositeBaseUrl := "/sbt-mima-version-check",
micrositeDocumentationUrl := "https://www.javadoc.io/doc/io.chrisdavenport/sbt-mima-version-check_2.12",
micrositeGitterChannelUrl := "ChristopherDavenport/libraries",
micrositeFooterText := None,
micrositeHighlightTheme := "atom-one-light",
micrositePalette := Map(
"brand-primary" -> "#3e5b95",
"brand-secondary" -> "#294066",
"brand-tertiary" -> "#2d5799",
"gray-dark" -> "#49494B",
"gray" -> "#7B7B7E",
"gray-light" -> "#E5E5E6",
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#FFFFFF"
),
fork in tut := true,
scalacOptions in Tut --= Seq(
"-Xfatal-warnings",
"-Ywarn-unused-import",
"-Ywarn-numeric-widen",
"-Ywarn-dead-code",
"-Ywarn-unused:imports",
"-Xlint:-missing-interpolator,_"
),
libraryDependencies += "com.47deg" %% "github4s" % "0.20.1",
micrositePushSiteWith := GitHub4s,
micrositeGithubToken := sys.env.get("GITHUB_TOKEN"),
micrositeExtraMdFiles := Map(
file("CHANGELOG.md") -> ExtraMdFileConfig("changelog.md", "page", Map("title" -> "changelog", "section" -> "changelog", "position" -> "100")),
file("CODE_OF_CONDUCT.md") -> ExtraMdFileConfig("code-of-conduct.md", "page", Map("title" -> "code of conduct", "section" -> "code of conduct", "position" -> "101")),
file("LICENSE") -> ExtraMdFileConfig("license.md", "page", Map("title" -> "license", "section" -> "license", "position" -> "102"))
)
)
}
.dependsOn(core)

lazy val contributors = Seq(
"ChristopherDavenport" -> "Christopher Davenport"
)


// General Settings
lazy val commonSettings = Seq(
organization := "io.chrisdavenport",
inThisBuild(List(
scalaVersion := "2.12.10",

organization := "io.chrisdavenport",
scalacOptions in (Compile, doc) ++= Seq(
"-groups",
"-sourcepath", (baseDirectory in LocalRootProject).value.getAbsolutePath,
"-doc-source-url", "https://github.com/ChristopherDavenport/sbt-mima-version-check/blob/v" + version.value + "€{FILE_PATH}.scala"
),
)

lazy val releaseSettings = {
Seq(
publishArtifact in Test := false,
scmInfo := Some(
ScmInfo(
url("https://github.com/ChristopherDavenport/sbt-mima-version-check"),
"[email protected]:ChristopherDavenport/sbt-mima-version-check.git"
)
),
homepage := Some(url("https://github.com/ChristopherDavenport/sbt-mima-version-check")),
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
pomExtra := {
<developers>
{for ((username, name) <- contributors) yield
<developer>
<id>{username}</id>
<name>{name}</name>
<url>http://github.com/{username}</url>
</developer>
}
</developers>
}
)
}


lazy val micrositeSettings = {
import microsites._
Seq(
micrositeName := "sbt-mima-version-check",
micrositeDescription := "Plugin to Automate which Mima Versions to Check",
micrositeAuthor := "Christopher Davenport",
micrositeGithubOwner := "ChristopherDavenport",
micrositeGithubRepo := "sbt-mima-version-check",
micrositeBaseUrl := "/sbt-mima-version-check",
micrositeDocumentationUrl := "https://www.javadoc.io/doc/io.chrisdavenport/sbt-mima-version-check_2.12",
micrositeGitterChannelUrl := "ChristopherDavenport/libraries",
micrositeFooterText := None,
micrositeHighlightTheme := "atom-one-light",
micrositePalette := Map(
"brand-primary" -> "#3e5b95",
"brand-secondary" -> "#294066",
"brand-tertiary" -> "#2d5799",
"gray-dark" -> "#49494B",
"gray" -> "#7B7B7E",
"gray-light" -> "#E5E5E6",
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#FFFFFF"
),
fork in tut := true,
scalacOptions in Tut --= Seq(
"-Xfatal-warnings",
"-Ywarn-unused-import",
"-Ywarn-numeric-widen",
"-Ywarn-dead-code",
"-Ywarn-unused:imports",
"-Xlint:-missing-interpolator,_"
),
libraryDependencies += "com.47deg" %% "github4s" % "0.20.1",
micrositePushSiteWith := GitHub4s,
micrositeGithubToken := sys.env.get("GITHUB_TOKEN"),
micrositeExtraMdFiles := Map(
file("CHANGELOG.md") -> ExtraMdFileConfig("changelog.md", "page", Map("title" -> "changelog", "section" -> "changelog", "position" -> "100")),
file("CODE_OF_CONDUCT.md") -> ExtraMdFileConfig("code-of-conduct.md", "page", Map("title" -> "code of conduct", "section" -> "code of conduct", "position" -> "101")),
file("LICENSE") -> ExtraMdFileConfig("license.md", "page", Map("title" -> "license", "section" -> "license", "position" -> "102"))
scmInfo := Some(
ScmInfo(
url("https://github.com/ChristopherDavenport/sbt-mima-version-check"),
"[email protected]:ChristopherDavenport/sbt-mima-version-check.git"
)
)
}
),
homepage := Some(url("https://github.com/ChristopherDavenport/sbt-mima-version-check")),
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
pomIncludeRepository := { _ => false },
developers := List(
Developer("ChristopherDavenport", "Christopher Davenport", "[email protected]", url("https://github.com/ChristopherDavenport"))
),
))


0 comments on commit 6c68835

Please sign in to comment.