Skip to content

Commit

Permalink
Integrates sbt-org-policies
Browse files Browse the repository at this point in the history
* Upgrades sbt version
* Upgrades sbt-ghpages plugin version
* Moves the artifact to groupId com.47deg
  • Loading branch information
juanpedromoreno committed Mar 21, 2017
1 parent 0898466 commit 37d7b64
Show file tree
Hide file tree
Showing 16 changed files with 613 additions and 453 deletions.
2 changes: 0 additions & 2 deletions .scalafmt

This file was deleted.

23 changes: 23 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
style = defaultWithAlign
maxColumn = 100

continuationIndent.callSite = 2

newlines {
sometimesBeforeColonInMethodReturnType = false
}

align {
arrowEnumeratorGenerator = false
ifWhileOpenParen = false
openParenCallSite = false
openParenDefnSite = false
}

docstrings = JavaDoc

rewrite {
rules = [SortImports, RedundantBraces]
redundantBraces.maxLines = 1
}

117 changes: 9 additions & 108 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,124 +1,25 @@
import sbt.Keys._
import de.heikoseeberger.sbtheader.license.Apache2_0
import catext.Dependencies._

val dev = Seq(Dev("47 Degrees (twitter: @47deg)", "47 Degrees"))
val gh = GitHubSettings("com.fortysevendeg", "sbt-microsites", "47 Degrees", apache)
val vAll = Versions(versions, libraries, scalacPlugins)

lazy val artifactSettings = Seq(
name := gh.proj,
organization := gh.org,
organizationName := gh.publishOrg,
homepage := Option(url("http://www.47deg.com")),
organizationHomepage := Some(new URL("http://47deg.com")),
headers := Map(
"scala" -> Apache2_0("2016", "47 Degrees, LLC. <http://www.47deg.com>")
)
)

pgpPassphrase := Some(sys.env.getOrElse("PGP_PASSPHRASE", "").toCharArray)
pgpPublicRing := file(s"${sys.env.getOrElse("PGP_FOLDER", ".")}/pubring.gpg")
pgpSecretRing := file(s"${sys.env.getOrElse("PGP_FOLDER", ".")}/secring.gpg")

lazy val pluginSettings = Seq(
sbtPlugin := true,
scalaVersion in ThisBuild := "2.10.6",
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
"jgit-repo" at "http://download.eclipse.org/jgit/maven"
),
libraryDependencies ++= Seq(
"com.lihaoyi" %% "scalatags" % "0.6.0",
"org.scalactic" %% "scalactic" % "3.0.0",
"net.jcazevedo" %% "moultingyaml" % "0.4.0",
"org.scalatest" %% "scalatest" % versions("scalatest") % "test",
"org.scalacheck" %% "scalacheck" % versions("scalacheck") % "test",
"com.sksamuel.scrimage" %% "scrimage-core" % "2.1.7"
),
scalafmtConfig in ThisBuild := Some(file(".scalafmt"))
) ++ reformatOnCompileSettings

lazy val micrositeSettings = Seq(
micrositeName := "sbt-microsites",
micrositeDescription := "An sbt plugin to create awesome microsites for your project",
micrositeBaseUrl := "sbt-microsites",
micrositeDocumentationUrl := "/sbt-microsites/docs/",
micrositeGithubOwner := "47deg",
micrositeGithubRepo := "sbt-microsites",
micrositeHighlightTheme := "color-brewer",
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md"
)

lazy val jsSettings = Seq(
scalaVersion := "2.11.8",
scalaJSStage in Global := FastOptStage,
parallelExecution := false,
scalaJSUseRhino := false,
requiresDOM := false,
skip in packageJSDependencies := false,
jsEnv := NodeJSEnv().value,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.0",
"be.doeraene" %%% "scalajs-jquery" % "0.9.0",
"com.lihaoyi" %%% "upickle" % "0.4.1",
"org.scala-exercises" %%% "evaluator-client" % "0.1.2-SNAPSHOT",
"com.lihaoyi" %%% "scalatags" % "0.6.0",
"org.querki" %%% "jquery-facade" % "1.0-RC6",
"org.denigma" %%% "codemirror-facade" % "5.11-0.7",
"com.fortysevendeg" %%% "github4s" % "0.9.0",
"fr.hmil" %%% "roshttp" % "2.0.0-RC1"
),
resolvers ++= Seq(Resolver.url("bintray-sbt-plugin-releases",
url("https://dl.bintray.com/content/sbt/sbt-plugin-releases"))(
Resolver.ivyStylePatterns),
Resolver.sonatypeRepo("snapshots"),
Resolver.bintrayRepo("denigma", "denigma-releases")),
jsDependencies ++= Seq(
"org.webjars" % "jquery" % "2.1.3" / "2.1.3/jquery.js",
ProvidedJS / "codemirror.js",
ProvidedJS / "clike.js" dependsOn "codemirror.js"
)
)

lazy val buildInfoSettings = Seq(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "microsites"
)

lazy val commonSettings = artifactSettings ++ miscSettings ++ reformatOnCompileSettings ++ Seq(
scalafmtConfig in ThisBuild := Some(file(".scalafmt"))
)

lazy val allSettings = pluginSettings ++
commonSettings ++
tutSettings ++
testScriptedSettings ++
sharedReleaseProcess ++
credentialSettings ++
sharedPublishSettings(gh, dev)
pgpPassphrase := Some(getEnvVar("PGP_PASSPHRASE").getOrElse("").toCharArray)
pgpPublicRing := file(s"$gpgFolder/pubring.gpg")
pgpSecretRing := file(s"$gpgFolder/secring.gpg")

lazy val `sbt-microsites` = (project in file("."))
.settings(moduleName := "sbt-microsites")
.settings(allSettings: _*)
.settings(addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.3"))
.settings(addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.7"))
.settings(addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.0.0"))
.settings(addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4"))
.enablePlugins(JekyllPlugin, AutomateHeaderPlugin)
.settings(pluginSettings: _*)
.settings(tutSettings: _*)
.settings(testScriptedSettings: _*)
.enablePlugins(JekyllPlugin)
.enablePlugins(AutomateHeaderPlugin)

lazy val docs = (project in file("docs"))
.settings(commonSettings: _*)
.settings(moduleName := "docs")
.settings(micrositeSettings: _*)
.settings(noPublishSettings: _*)
.settings(buildInfoSettings: _*)
.settings(moduleName := "docs")
.enablePlugins(MicrositesPlugin)
.enablePlugins(BuildInfoPlugin)

lazy val kazari = (project in file("kazari"))
.settings(moduleName := "kazari")
.settings(commonSettings: _*)
.settings(jsSettings: _*)
.settings(KazariBuild.kazariTasksSettings: _*)
.enablePlugins(ScalaJSPlugin)
Loading

0 comments on commit 37d7b64

Please sign in to comment.