Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plugin to sbt 1.0.2 #9

Merged
merged 15 commits into from
Feb 12, 2018
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ scala:
- 2.11.11

script:
- sbt clean scripted headerCheck
- sbt clean scripted scalafmt headerCheck
- "git diff --exit-code || (echo ERROR: Git changes detected, please regenerate the readme and run scalafmt with: sbt headerCreate scalafmt && exit 1)"
#after_success:
# - sbt coveralls
Expand Down
19 changes: 9 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ publishMavenStyle := true

sbtPlugin := true

scalaVersion := "2.10.6"
scalaVersion := "2.12.3"

resolvers += Resolver.sonatypeRepo("snapshots")

Expand All @@ -34,7 +34,6 @@ publishTo := {
Some(Opts.resolver.sonatypeStaging)
}

ScriptedPlugin.scriptedSettings
scriptedLaunchOpts := { scriptedLaunchOpts.value ++
Seq("-Xmx1024M",
"-Dplugin.version=" + version.value)
Expand Down Expand Up @@ -72,32 +71,32 @@ libraryDependencies ++= Seq(
(scalaBinaryVersion in pluginCrossBuild).value
),
Defaults.sbtPluginExtra(
"org.planet42" % "laika-sbt" % "0.7.0",
"org.planet42" % "laika-sbt" % "0.7.5",
(sbtBinaryVersion in pluginCrossBuild).value,
(scalaBinaryVersion in pluginCrossBuild).value
),
Defaults.sbtPluginExtra(
"com.eed3si9n" % "sbt-assembly" % "0.14.5",
"com.eed3si9n" % "sbt-assembly" % "0.14.6",
(sbtBinaryVersion in pluginCrossBuild).value,
(scalaBinaryVersion in pluginCrossBuild).value
),
Defaults.sbtPluginExtra(
"com.jsuereth" % "sbt-pgp" % "1.0.0",
"com.jsuereth" % "sbt-pgp" % "1.1.0",
(sbtBinaryVersion in pluginCrossBuild).value,
(scalaBinaryVersion in pluginCrossBuild).value
),
Defaults.sbtPluginExtra(
"org.xerial.sbt" % "sbt-sonatype" % "1.1",
"org.xerial.sbt" % "sbt-sonatype" % "2.0",
(sbtBinaryVersion in pluginCrossBuild).value,
(scalaBinaryVersion in pluginCrossBuild).value
),
Defaults.sbtPluginExtra(
"com.typesafe.sbt" % "sbt-site" % "1.3.1",
"com.typesafe.sbt" % "sbt-site" % "1.3.2",
(sbtBinaryVersion in pluginCrossBuild).value,
(scalaBinaryVersion in pluginCrossBuild).value
),
Defaults.sbtPluginExtra(
"com.github.gseitz" % "sbt-release" % "1.0.6",
"com.github.gseitz" % "sbt-release" % "1.0.7",
(sbtBinaryVersion in pluginCrossBuild).value,
(scalaBinaryVersion in pluginCrossBuild).value
),
Expand All @@ -112,12 +111,12 @@ libraryDependencies ++= Seq(
(scalaBinaryVersion in pluginCrossBuild).value
),
Defaults.sbtPluginExtra(
"de.heikoseeberger" % "sbt-header" % "4.0.0",
"de.heikoseeberger" % "sbt-header" % "4.1.0",
(sbtBinaryVersion in pluginCrossBuild).value,
(scalaBinaryVersion in pluginCrossBuild).value
),
Defaults.sbtPluginExtra(
"com.lucidchart" % "sbt-scalafmt" % "1.10",
"com.lucidchart" % "sbt-scalafmt" % "1.15",
(sbtBinaryVersion in pluginCrossBuild).value,
(scalaBinaryVersion in pluginCrossBuild).value
)
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.16
sbt.version=1.0.2
15 changes: 6 additions & 9 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.6")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.7")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.3")
addSbtPlugin("org.planet42" % "laika-sbt" % "0.7.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "4.0.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "4.1.0")
2 changes: 1 addition & 1 deletion project/scripted.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libraryDependencies += { "org.scala-sbt" % "scripted-plugin" % sbtVersion.value }
libraryDependencies += { "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value }
49 changes: 25 additions & 24 deletions src/main/scala/nl/biopet/sbtbiopet/BiopetPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import com.typesafe.sbt.site.laika.LaikaSitePlugin
import com.typesafe.sbt.site.laika.LaikaSitePlugin.autoImport.LaikaSite
import com.typesafe.sbt.site.{SitePlugin, SiteScaladocPlugin}
import de.heikoseeberger.sbtheader.HeaderPlugin
import laika.sbt.LaikaSbtPlugin.LaikaKeys.{Laika, rawContent}
import laika.sbt.LaikaPlugin.autoImport.{Laika, laikaRawContent}
import org.scoverage.coveralls.CoverallsPlugin
import sbt.Keys._
import sbt.{Def, _}
Expand Down Expand Up @@ -188,7 +188,7 @@ object BiopetPlugin extends AutoPlugin {
siteSubdirName in SiteScaladoc := {
if (isSnapshot.value) { "develop/api" } else s"${version.value}/api"
},
rawContent in Laika := true, //Laika use raw HTML content in markdown.
laikaRawContent in Laika := true, //Laika use raw HTML content in markdown.
includeFilter in ghpagesCleanSite := biopetCleanSiteFilter.value,
biopetGenerateDocs := biopetGenerateDocsFunction().value,
biopetGenerateReadme := biopetGenerateReadmeFunction().value,
Expand All @@ -201,16 +201,16 @@ object BiopetPlugin extends AutoPlugin {
* The merge strategy that is used in biopet projects
*/
protected def biopetMergeStrategy: String => MergeStrategy = {
case PathList(ps @ _ *) if ps.last endsWith "pom.properties" =>
case PathList(ps @ _*) if ps.last endsWith "pom.properties" =>
MergeStrategy.first
case PathList(ps @ _ *) if ps.last endsWith "pom.xml" =>
case PathList(ps @ _*) if ps.last endsWith "pom.xml" =>
MergeStrategy.first
case x if Assembly.isConfigFile(x) =>
MergeStrategy.concat
case PathList(ps @ _ *)
case PathList(ps @ _*)
if Assembly.isReadme(ps.last) || Assembly.isLicenseFile(ps.last) =>
MergeStrategy.rename
case PathList("META-INF", xs @ _ *) =>
case PathList("META-INF", xs @ _*) =>
xs map {
_.toLowerCase
} match {
Expand Down Expand Up @@ -284,8 +284,7 @@ object BiopetPlugin extends AutoPlugin {
f.getPath.contains("develop")
} else {
f.getPath.contains(s"${version.value}") ||
f.getPath == new java.io.File(ghpagesRepository.value,
"index.html").getPath
f.getPath == new java.io.File(ghpagesRepository.value, "index.html").getPath
}
}
}
Expand All @@ -296,22 +295,23 @@ object BiopetPlugin extends AutoPlugin {
*/
protected def biopetGenerateDocsFunction(): Def.Initialize[Task[Unit]] =
Def.task[Unit] {
val r = (runner in Compile).value
val classPath = (fullClasspath in Runtime).value
val mainClassString = s"${(mainClass in assembly).value.get}"
val streamsLogValue = streams.value.log
if (biopetIsTool.value) {
import Attributed.data
val r = (runner in Compile).value
val args = Seq("--generateDocs",
s"outputDir=${biopetDocsDir.value.toString}," +
s"version=${version.value}," +
s"release=${!isSnapshot.value}",
version.value)
val classPath = (fullClasspath in Compile).value
r.run(
s"${(mainClass in assembly).value.get}",
data(classPath),
args,
streams.value.log
)
.foreach(sys.error)
mainClassString,
data(classPath),
args,
streamsLogValue
)
}
}

Expand All @@ -321,18 +321,19 @@ object BiopetPlugin extends AutoPlugin {
protected def biopetGenerateReadmeFunction(): Def.Initialize[Task[Unit]] =
Def
.task[Unit] {
val r: ScalaRun = (runner in Compile).value
val classPath = (fullClasspath in Runtime).value
val mainClassString = s"${(mainClass in assembly).value.get}"
val streamsLogValue = streams.value.log
if (biopetIsTool.value) {
import sbt.Attributed.data
val r: ScalaRun = (runner in Compile).value
val args = Seq("--generateReadme", biopetReadmePath.value.toString)
val classPath = (fullClasspath in Compile).value
r.run(
s"${(mainClass in assembly).value.get}",
data(classPath),
args,
streams.value.log
)
.foreach(sys.error)
mainClassString,
data(classPath),
args,
streamsLogValue
)
}
}
.dependsOn(compile in Compile)
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion src/sbt-test/sbtbiopet/developtool/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.github.biopet" % "sbt-biopet" % x)
case _ => addSbtPlugin("com.github.biopet" % "sbt-biopet" % "0.2-SNAPSHOT")
case _ => addSbtPlugin("com.github.biopet" % "sbt-biopet" % "0.4-SNAPSHOT")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be done with a variable? This seems likely to break in next versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

/* case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
*/
Expand Down