Questions tagged [sbt-plugin]

A plugin extends the build definition, most commonly by adding new settings. The new settings could be new tasks. For example, a plugin could add a codeCoverage task which would generate a test coverage report.

An SBT plugin extends the build definition, most commonly by adding new settings. The new settings could be new tasks. For example, a plugin could add a codeCoverage task which would generate a test coverage report.

192 questions
1
vote
0 answers

SBT: Discovering previous version of a task

The goal is a master plugin that can decide which other plugins to run based on settings in project that uses the master plugin. It's become academic at this point and I've learned a lot. Current implementation that is compiling has the packaging…
Brian Topping
  • 3,235
  • 28
  • 33
1
vote
1 answer

How can I access sub-projects of an sbt-plugin by using it as dependency in a multi-project build?

I have an sbt plugin project that uses multi-project build. I would like to use this plugin as a dependency for the other sbt project and access sub-project of this sbt plugin. I have created a plugin and I added plugin to an sbt project, but i am…
Jitendera Kumar
  • 136
  • 1
  • 12
1
vote
1 answer

ThisBuild ignored for plugin settingKey

This issue is connected with my troubles with sbt-scapegoat but I would like to understand this thing globally. So, sbt-scapegoat defines a setting scapegoatVersion and config scapegoat. Short and complete source code is availible here. When I set…
Krever
  • 1,371
  • 1
  • 13
  • 32
1
vote
1 answer

Understanding spark-sbt-plugin

I came across this detailed explanation on how to setup build.sbt for Spark. But then I read about the SBT plugin for Spark packages where apparently a single line like https://github.com/databricks/sbt-spark-package is OK as the plugin is doing…
Cedric H.
  • 7,980
  • 10
  • 55
  • 82
1
vote
0 answers

Run sbt plugin not in build.sbt

I am trying to write an SBT plugin for an IDE to query for information like the source path. Using maven, I would do something like mvn my.org:myPlugin:myGoal This works, even if the pom.xml does not reference the plugin. Is there a similar way…
Troy Daniels
  • 3,270
  • 2
  • 25
  • 57
1
vote
1 answer

How to deal with library eviction when writing sbt plugin?

I try to write a simple sbt plugin which is using jsch. Due to the security reasons (ecdsa) my requirement is to use jsch in 0.1.53. I have declared the dependency in my build.sbt file: libraryDependencies += "com.jcraft" % "jsch" %…
ar2r
  • 56
  • 3
1
vote
1 answer

How can I ask sbt-buildinfo to run only at (re)load time and not compile time?

I use the sbt-buildinfo SBT plugin, which works great. I would like to improve the following thing: currently, all values in the generated file can only change if the whole sbt project is reloaded, and thus not at every compile run. I would…
Jean-Philippe Pellet
  • 59,296
  • 21
  • 173
  • 234
1
vote
1 answer

sbt - have build fail on presence of undesired dependency

I have the requirement that my sbt build should fail if there are unwanted dependencies present. Concrete use case: We want to use log4j2 as logging framework und don't want any dependency to transitively include logback, commons-logging et. al.…
ftr
  • 2,105
  • 16
  • 29
1
vote
1 answer

How to run task defined in sbt plugin

In my project I use plugin which exposes task genExport. I can run genExport task from console with: sbt genExport My problem is I cannot configure my sbt project to run genExport after project compilation: lazy val sample:Project = project …
Nyavro
  • 8,806
  • 2
  • 26
  • 33
1
vote
1 answer

Calling a TaskKey with different settings

I'm using the plugin sbt-assembly (version 0.13.0), and I would like to call assemblyPackageDependency with or without appendContentHash depending on some InputKey Basically, I would like to do something like this: lazy val isGlobalCached =…
lev
  • 3,986
  • 4
  • 33
  • 46
1
vote
0 answers

How to set Distribution section in changes file using sbt-native-packager Debian plugin?

When I generate .deb and .changes files using JavaServerAppPackaging plugin, my changes file contains Distribution: unknown. How I can change that?
Tolsi
  • 656
  • 9
  • 20
1
vote
1 answer

How to 'embed' SBT plugin in my Scala project

Im currently using an SBT plugin that runs as part of the compile task but wish to amend it. Have contacted author but no responses. Can anyone give me a high-level overview of steps to import the functionality into my project so I can customise it?…
JamieP
  • 1,664
  • 2
  • 13
  • 16
1
vote
0 answers

How to extend task in all scopes (even currently undefined)?

I am writing a plugin that adds sets to the compile task. package myplugin import sbt._ import Keys._ object MyPlugin extends AutoPlugin { object autoImport {} override lazy val projectSettings = Seq( compile <<= compile.andFinally { …
Paul Draper
  • 78,542
  • 46
  • 206
  • 285
1
vote
0 answers

Why does custom plugin fail to fork a Java process?

I wrote sbt plugin that use Fork.java.fork(forkOptions, Seq("-cp", (deps mkString File.pathSeparator) + File.pathSeparator + cp ) ++ args) start Jetty. It report an error Error: Could not find or load main class …
mqshen
  • 501
  • 3
  • 11
1
vote
1 answer

An undefined variable used by `enablePlugins` method?

My build.sbt looks like this: lazy val root = (project in file(".")).enablePlugins(PlayScala) name := "slick" version := "1.0" scalaVersion := "2.11.4" libraryDependencies ++= Seq( "com.typesafe.slick" %% "slick" % "2.1.0", "org.postgresql"…
Hanfei Sun
  • 45,281
  • 39
  • 129
  • 237