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
3
votes
0 answers

PureConfig: I cannot read a reference.conf in a sbt Plugin

I created a sbt Plugin, that reads its configuration from a reference.conf. The test in the Plugin works (can read the `reference.conf). Wenn I publish the Plugin, there is the reference.conf in the Root of the Jar. However when running the SBT Task…
pme
  • 14,156
  • 3
  • 52
  • 95
3
votes
1 answer

IntelliJ Idea Cannot find sbt-idea-compiler-indices

Installed IntelliJ Idea CE 2019.1 (on Win64, Windows 7 and 10, from zip) - and in both cases it cannot find the dependency shown below, so it cannot import an sbt project. The project is valid, i.e. it compiles using sbt on the command line. I am…
radumanolescu
  • 4,059
  • 2
  • 31
  • 44
3
votes
2 answers

SBT plugin -- execute custom task before compilation

I've just written my first SBT Autoplugin which has a custom task that generates a settings file (if the file is not already present). Everything works as expected when the task is explicitly invoked, but I'd like to have it automatically invoked…
Timothy Perrigo
  • 723
  • 4
  • 18
3
votes
2 answers

How to make a SBT task depend on a module defined in the same SBT project?

I have module A and module B in a multi-module SBT project. I want to write a resource generator task for module B that invokes code from module A. One way to do this is to pull all the code from module A under project/ but that is unfeasible as…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
3
votes
1 answer

How can I run scalafmt automatically in project?

I use scalafmt plugin in my project, also I use scalafmt plugin for Intellj in order to format my Scala code. Usually I use hot keys or run sbt scalafmt to formatting. sbt.version=1.0.3 addSbtPlugin("com.geirsson" % "sbt-scalafmt" %…
mkUltra
  • 2,828
  • 1
  • 22
  • 47
3
votes
2 answers

sbt add plugin error

i've read all of the similar questions but neither of the suggestions fixes my problem. Perhaps i am unable to see it. The problem is i have project/plugins.sbt and when i try to add for example addSbtPlugin("com.eed3si9n" % "sbt-assembly" %…
whb
  • 661
  • 2
  • 10
  • 22
3
votes
1 answer

Can't add compile dependencies using sbt.AutoPlugins

I am trying to build a plugin that automatically sets up a set of scalariform preferences. My plugin's build.sbt: name := "my-scalariform" organization := "com.my" version := "1.0-SNAPSHOT" sbtPlugin := true scalacOptions ++= Seq("-feature",…
Stephen L
  • 402
  • 5
  • 9
3
votes
1 answer

In SBT, Is it possible to add IntegrationTest config to a project using an AutoPlugin?

I'm developing an AutoPlugin and I want it to add the IntegrationTest config to projects that enable the plugin. Is this possible? My first thought was this could be possible in the buildSettings, however examples I've seen for adding…
Mark S
  • 1,488
  • 12
  • 19
3
votes
0 answers

SBT Plugin to modify compile and test tasks

I am in the process of creating a plugin that will modify both the compile:compile and test:test tasks. My ultimate aim is to be able to do sbt monkjack or sbt monkjack:test (either is fine). In the compile:compile scope I need to add a compiler…
sksamuel
  • 16,154
  • 8
  • 60
  • 108
2
votes
1 answer

Running custom sbt plugin task for one project in a multi-project build.sbt

I am writing a custom sbt plugin, whose tasks are intended to target specific projects from another multi-project. Note that the 'plugin' and 'multi-project' client are two separate projects, so the plugin gets published (locally) and then used via…
Nigel Eke
  • 531
  • 1
  • 6
  • 18
2
votes
0 answers

SBT Dynamic Project Dependency

I recently need to integrate some projects as submodules, and each of them has its own build.sbt. And there are also dependencies between submodules. Therefore, I need to dynamically convert the libraryDependencies to dependsOn format. The project…
2
votes
2 answers

How can I conditionally add an sbt plugin, depending on the active sbt version?

Use case: I like to be able to show the dependency tree for my sbt projects, so I have added addDependencyTreePlugin to my ~/.sbt/1.0/plugins.sbt, to make it globally available on my machine. However, that plugin is only available since sbt 1.4.x…
JeanMarc
  • 306
  • 1
  • 10
2
votes
1 answer

Sbt plugin published to nexus with sbt.version 1.2.8 is not resolved by sbt projects which are using sbt.version >1.2.8

We published our sbt plugin to local m2 repository using sbt clean compile publishM2. Below is the simplified plugin source code :- build.sbt :- name := "base-plugin" version := "0.1" organization := "io.github.moglideveloper" sbtPlugin :=…
mogli
  • 1,549
  • 4
  • 29
  • 57
2
votes
1 answer

Multiple jars for multiple test packages in sbt

Is there any way in sbt (custom task or plugin) to pack packages in separate jars. For example :- In this sample project, there should be 6 jar files generated for packages eg1, eg2, eg3, eg4, eg49, eg50 Given, there is no inter dependency of any…
mogli
  • 1,549
  • 4
  • 29
  • 57
2
votes
0 answers

Listing the dependencies of a configuration with a custom Scala libray

I have a CLI app which compile only to 2.11 (because of some internal dependency). I want to package this app as a sbt plugin. This sbt plugin run the app by forking the JVM, running separately with its own classpath to avoid Scala library…
tibo
  • 5,326
  • 4
  • 37
  • 53
1 2
3
12 13