These are chat archives for sbt/sbt

24th
Apr 2017
Schmitt Christian
@schmitch
Apr 24 08:09
is there a way to show the dependencyTree of the sbt build project?
marios iliofotou
@imarios
Apr 24 08:09
@schmitch library dependencies?
Schmitt Christian
@schmitch
Apr 24 08:10
I have defined some plugins where I want to see the dependency tree
is this possible?
marios iliofotou
@imarios
Apr 24 08:11
what dependencies? library, project, tasks/settings?
Schmitt Christian
@schmitch
Apr 24 08:11
?!
on my normal project I can inspect the dependencies via dependencyTree however I can't inspect the dependencies for the sbt build itself.
marios iliofotou
@imarios
Apr 24 08:12
ok, now i see the question.
reload plugins should take you to the right project, but I am not sure if you will need to recursively define sbt-dependency-graph as plugin for your build project
Schmitt Christian
@schmitch
Apr 24 08:17
well when I do reload plugins and then dependencyTree I get nothing
marios iliofotou
@imarios
Apr 24 08:17
yes, it's because you don't have sbt-dependency-graph as plugin for your build project
echo addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2") > project/project/plugins.sbt
and try again using reload plugins
Schmitt Christian
@schmitch
Apr 24 08:20
that's not the problem since I have defined it in .sbt/0.13/plugins/plugins.sbt, but I also tried it to add it, and it does not work
marios iliofotou
@imarios
Apr 24 08:21
did you add it in "$YOUR_PROJECT_ROOT/project/project/plugins.sbt"?
the project appearing twice is not a type
typo
Todd Leo
@toddleo
Apr 24 08:22
Current sbt version don't support re-run command anymore?
Schmitt Christian
@schmitch
Apr 24 08:23
@imarios I added it to my SBT_HOME AND it was also added in project/project
marios iliofotou
@imarios
Apr 24 08:24
then did you restart sbt in interactive mode? and typed reload plugins and then dependencyTree and it didn't work?
Schmitt Christian
@schmitch
Apr 24 08:36
yes
Nicolas Rinaudo
@nrinaudo
Apr 24 09:34
I'm running into what looks like a regression, but might be my fault: overwriting SNAPSHOT artifacts is not picked up (any longer) by dependents
if I clear my cache manually everything behaves as expected, but however much I might reload, clean, restart SBT, it will not check that it has the latest SNAPSHOT artifacts. I thought that artifacts containing -SNAPSHOT in the same were automatically marked as changing(), did that change?
(manually adding changing() and then running update works fine)
Dale Wijnand
@dwijnand
Apr 24 09:55
do you mean when you publishLocal SNAPSHOTs to ~/.ivy2/local they are ignored in favour of older ones in ~/.ivy2/cache?
Sam Halliday
@fommil
Apr 24 10:04
@nrinaudo @dwijnand that sounds exactly like what I seen
Dale Wijnand
@dwijnand
Apr 24 10:05
sbt/sbt#2687
Sam Halliday
@fommil
Apr 24 10:05
I am writing an autoplugin that depends on BuildInfoPlugin ... but when I do that it seems to disable my plugin. Is it doing something funky? https://github.com/sbt/sbt-buildinfo/blob/master/src/main/scala/sbtbuildinfo/BuildInfoPlugin.scala
Dale Wijnand
@dwijnand
Apr 24 10:06
not funky, it just doesn't auto-trigger
Sam Halliday
@fommil
Apr 24 10:06
maybe I misunderstand requires
Dale Wijnand
@dwijnand
Apr 24 10:06
so neither will your downstream plugin
Sam Halliday
@fommil
Apr 24 10:06
is there a way to say "my autoplugin should transitively bring in X"
Dale Wijnand
@dwijnand
Apr 24 10:07
no, that feature is in debate sbt/sbt#2093
Nicolas Rinaudo
@nrinaudo
Apr 24 10:18
@dwijnand no, not quite. I'm publishing to an Artifactory mvn repository
@dwijnand I need to be off for a bit, but I'll try to give you a more usable description when I'm back
Dale Wijnand
@dwijnand
Apr 24 10:19
Better yet a reproducation, so we can confirm if it's a regression from 0.13.13
Nicolas Rinaudo
@nrinaudo
Apr 24 10:19
absolutely
although you'll need somewhere to publish, I can't provide that. I don't want to do it on the local repo, since it's not the problem I'm observing and might be an entirely different issue
Dale Wijnand
@dwijnand
Apr 24 10:21
no that won't be necessary
Sam Halliday
@fommil
Apr 24 11:03
here's a weird requirement... is there any way to automatically disable a plugin? play (of course) uses a crazy project layout by default and we'd like to use the standard sbt one. this involves disablePlugins(PlayLayoutPlugin)
@nrinaudo to workaround, I just manually set isSnapshot
seems to fix it locally
:scream_cat: I forgot to put in my trademark WORKAROUND: rant!
Dale Wijnand
@dwijnand
Apr 24 11:10
:) welcome to the world of build tools. Some always want something to be auto-enabled, some want it opt-in, then some want a "always trigger my downstream plugins" toggle, and finally there's a use case for "always disable that plugin that auto-enables". aaaaaaah!
Sam Halliday
@fommil
Apr 24 11:11
heh
Nicolas Rinaudo
@nrinaudo
Apr 24 11:27
@fommil my problem isn't with isSnapshot, I can confirm that this is properly set
that is, whenever version contains SNAPSHOT, isSnapshot is set to true, and false otherwise
I'm having issues when resolving, not publishing - or did I misunderstand what you were telling me?
@dwijnand the problem cannot be reproduced when publishing locally, either - but that sort of makes sense, doesn't it? When published locally, the actual file used by other projects is overwritten and the old version doesn't even exist physically anymore?
Dale Wijnand
@dwijnand
Apr 24 11:34
yeah in that case it just overwrites the files
Nicolas Rinaudo
@nrinaudo
Apr 24 11:48
@dwijnand not sure what's the best way to submit a reproduction: repo that you can clone and run through, or individual files?
I'd usually go with the repo approach, but you might want it to be more permanent than a demo repo in my account is likely to be
Dale Wijnand
@dwijnand
Apr 24 11:50
individual steps is best. Something like sbt/sbt#2088
Nicolas Rinaudo
@nrinaudo
Apr 24 11:52
precisely what I was looking for, thank you
Bassel
@Shokodemon
Apr 24 12:43

hey ho, im using the init example to boostrapp a system im building, that said, im having to duplicate some code; not sure how to explain this; but take a look at this:

def main(args: Array[String]): Unit = {
// Break into debug REPL with
ammonite.Main(
).run(
"initProperties" -> setSystemProperties,
"initImports" -> getImports,
"dba" -> getDba,
"aS" -> {
val dba = getDba
getAkkaSystem(dba)
},
//"serverListRemote" -> getCliActor,
"startSecond" -> startSsh
)
}

the problem is with getAkkaSystem not seeing the "dba" being called over there
or being defined
just solved it!
moved a the dba definition to the main class and just pointed the shell variable to the main one
Nicolas Rinaudo
@nrinaudo
Apr 24 12:52
@Shokodemon it's usually helpful to wrap your code examples in triple-backticks so that they're beautified
not sure how to provide an example of the syntax without it being interpreted by gitter though...
Dale Wijnand
@dwijnand
Apr 24 12:59
```
Bassel
@Shokodemon
Apr 24 13:29
np @nrinaudo, ill do it next time. currently having an issue with ammonite imports, ill try to sovle it first, ill beautify my code next time
Amanj Sherwany
@amanjpro
Apr 24 14:54
Hello, I have a question. Where should I put sbtopts so it can be seen globally. I belive it should be /etc/sbt/sbtopts as sbt -help suggests, but looking at the launcher script I see this: declare -r etc_sbt_opts_file="${sbt_home}/conf/sbtopts”
Nicolas Rinaudo
@nrinaudo
Apr 24 15:25
@dwijnand I can actually reproduce the issue in 0.13.13, so maybe I'm being stupid. Can you confirm that the following is the expected behaviour?
  • push version 1.0.1-SNAPSHOT of foolib to maven
  • have project foocmd depend on version 1.0.1-SNAPSHOT of foolib
  • start sbt in foocmd, run compile (all dependencies are resolved and downloaded)
  • overwrite 1.0.1-SNAPSHOT of foolib in maven
  • run compile, or update, or clean followed by update, in the foocmd SBT session
  • the new version of foolib is spotted, resolved and downloaded
Brian Topping
@briantopping
Apr 24 21:33

So I think I've gotten a little further on this since Friday, lol:

  lazy val featureFile = SettingKey[Option[File]]("features")
    someSettings <<= Def.task {
      featureFile.map { _.map { f=>
        // need to build the `Seq[Setting[_]]` here (or Seq.empty), but how?
      }}
      Seq.empty[Setting[_]]
    }

What is the syntax to build the sequence within the map of the file?

Brian Topping
@briantopping
Apr 24 21:41
Or grateful if anyone knows a better way to solve for this. The map of a map feels odd, but it's not a flatMap
Dominik Dorn
@domdorn
Apr 24 21:43
well.. what do you wanna do with your file?
Brian Topping
@briantopping
Apr 24 21:44
I'll be using it with addArtifact to generate some of the settings
Brian Topping
@briantopping
Apr 24 23:25
    someSettings := featureFile.value.map { f =>
      Seq(
        Keys.artifact in(Compile, Keys.packageBin) ~= (_.copy(`type` = "jar")),
        OsgiKeys.exportPackage := Seq(s"${packageName.value}.*"),
        OsgiKeys.privatePackage := Seq.empty
      ) ++ addArtifact(Def.setting(Artifact(moduleName.value, "xml", "xml", "feature")), Def.task(f))
    }.getOrElse(Seq.empty[sbt.Setting[_]])
I guess it makes more sense now, not sure about the arguments to addArtifact needing to be wrapped like that, if there's a simpler way or not
Brian Topping
@briantopping
Apr 24 23:36
Now wondering if there's away to remove someSettings := and splat the results in a Seq[Setting[_]], but it seems that would lose the magic that := provides to resolve the values
the way I have it now is the someSettings task key is set in projectSettings (it's a plugin):
  override lazy val projectSettings: Seq[Setting[_]] =
    commonSettings ++ gitStampSettings ++ nexusPublishing ++ buildInfo ++ osgiSettings.value
The thing that is still wrong about this plugin is I am creating a TaskKey on line 25, trying to set the value of it in projectSettings, but the definition of the task is in other settings that are already included.