Skip to content

Commit

Permalink
Open JDK 11; sbt 1.3.2; Scala 2.12.10; plugins++ (#16)
Browse files Browse the repository at this point in the history
* sbt 1.3.2; Scala 2.12.10; plugins++
* usd OpenJDK 11
* scalafmt & scalafmtSbt
  • Loading branch information
ennru authored Oct 8, 2019
1 parent 52d0387 commit 2bd8a8f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 39 deletions.
1 change: 1 addition & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version = 2.1.0-RC2
maxColumn = 120
docstrings = JavaDoc
assumeStandardLibraryStripMargin = true
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: scala
jdk: oraclejdk8
scala: 2.12.7
jdk: openjdk11
scala: 2.12.10

jobs:
include:
Expand All @@ -21,8 +21,8 @@ stages:

cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt
- $HOME/cache/coursier/v1

before_cache:
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
Expand Down
13 changes: 10 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scalaVersion := "2.12.7"
scalaVersion := "2.12.10"

sbtPlugin := true

Expand All @@ -21,8 +21,11 @@ resolvers += Resolver.bintrayIvyRepo("2m", "sbt-plugins")
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))
homepage := Some(url("https://github.com/lightbend/sbt-paradox-dependencies"))
scmInfo := Some(
ScmInfo(url("https://github.com/lightbend/sbt-paradox-dependencies"),
"[email protected]:lightbend/sbt-paradox-dependencies.git"))
ScmInfo(
url("https://github.com/lightbend/sbt-paradox-dependencies"),
"[email protected]:lightbend/sbt-paradox-dependencies.git"
)
)
developers += Developer(
"contributors",
"Contributors",
Expand All @@ -37,3 +40,7 @@ bintrayRepository := "sbt-plugin-releases"

enablePlugins(AutomateHeaderPlugin)
scalafmtOnCompile := true

// don't do any API docs
doc / sources := Seq()
packageDoc / publishArtifact := false
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.6
sbt.version=1.3.2
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "3.1.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.0.0")
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.5.1")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.5")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.6")
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class DependenciesDirective(projectIdToDependencies: String => ModuleTree) exten
.print("</td><td>")
.print(name)
.print("</td><td>")
.print(s"""<a href="https://mvnrepository.com/artifact/${moduleId.organisation}/$name/${moduleId.version}" target="_blank">""")
.print(
s"""<a href="https://mvnrepository.com/artifact/${moduleId.organisation}/$name/${moduleId.version}" target="_blank">"""
)
.print(moduleId.version)
.print("</a></td>")
d.node.license.foreach(l => p.print("<td>").print(l).print("</td>"))
Expand Down Expand Up @@ -88,7 +90,8 @@ class DependenciesDirective(projectIdToDependencies: String => ModuleTree) exten
.print(" ")
.print(name)
.print(
s""" <a href="https://mvnrepository.com/artifact/${moduleId.organisation}/$name/${moduleId.version}" target="_blank">""")
s""" <a href="https://mvnrepository.com/artifact/${moduleId.organisation}/$name/${moduleId.version}" target="_blank">"""
)
.print(moduleId.version)
.print("</a>")
n.node.license.foreach(l => p.print(" ").print(l))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,41 @@ object ParadoxDependenciesPlugin extends AutoPlugin {

def dependenciesZeroSettings: Seq[Setting[_]] = Seq(
paradoxDependenciesModuleTrees := Def.taskDyn {
val projectsToFilter = paradoxDependenciesProjects.?.value
.map(inProjects)
.getOrElse {
inAggregates(LocalRootProject, includeRoot = true)
}
val projectsToFilter = paradoxDependenciesProjects.?.value
.map(inProjects)
.getOrElse {
inAggregates(LocalRootProject, includeRoot = true)
}

val filter: ScopeFilter = ScopeFilter(projectsToFilter, inConfigurations(Compile))
val filter: ScopeFilter = ScopeFilter(projectsToFilter, inConfigurations(Compile))

val projectIdWithTree = Def.task {
(thisProject.value.id, ModuleTree(DependencyGraphKeys.moduleGraphSbt.value))
}
val projectIdWithTree = Def.task {
(thisProject.value.id, ModuleTree(DependencyGraphKeys.moduleGraphSbt.value))
}

projectIdWithTree.all(filter).map(_.toMap)
}.value,
projectIdWithTree.all(filter).map(_.toMap)
}.value,
paradoxDirectives ++= Def.taskDyn {
Def.task {
val trees = paradoxDependenciesModuleTrees.value
Seq(
{ _: Writer.Context
new DependenciesDirective(projectId => {
trees.get(projectId) match {
case Some(deps) => deps
case _ => throw new Error(s"Could not retrieve dependency information for project [$projectId]")
Def.task {
val trees = paradoxDependenciesModuleTrees.value
Seq(
{ _: Writer.Context
new DependenciesDirective(projectId => {
trees.get(projectId) match {
case Some(deps) => deps
case _ => throw new Error(s"Could not retrieve dependency information for project [$projectId]")
}
})
}
})
)
}
)
}
}.value
}.value
)

def dependenciesSettings(config: Configuration): Seq[Setting[_]] =
dependenciesZeroSettings ++ inConfig(config)(
Seq(
// scoped settings here
))
Seq(
// scoped settings here
)
)
}

0 comments on commit 2bd8a8f

Please sign in to comment.