These are chat archives for sbt/sbt

20th
Sep 2016
Guillaume Massé
@MasseGuillaume
Sep 20 2016 01:17
Would it be possible to remove compilerReporter private modifier ?
Redrield
@Redrield
Sep 20 2016 01:18
Hold on... I don't know why I was this dumb
That's the build fie
file*
Doesn't work, error above
Guillaume Massé
@MasseGuillaume
Sep 20 2016 01:30
it look like your maven resolver is not configured corretly
Perry
@pfn
Sep 20 2016 01:30
@MasseGuillaume, you can just declare the key again
Guillaume Massé
@MasseGuillaume
Sep 20 2016 01:30
I know
but it's a hack :P
Perry
@pfn
Sep 20 2016 01:30
it's an internal non public api key
use at your own risk
Guillaume Massé
@MasseGuillaume
Sep 20 2016 01:30
yeah
why it's private ?
I saw ppl asking this question in 2015 with no awnser
Redrield
@Redrield
Sep 20 2016 01:31
@MasseGuillaume That same maven repo works fine for anything that isn't sbt
< Why: Why are you looking at this?
lol
strange I dont know
let's see without coursier
you are missing the stamp
Redrield
@Redrield
Sep 20 2016 01:37
I need to provide the exact name of the nightly build?
Guillaume Massé
@MasseGuillaume
Sep 20 2016 01:37
libraryDependencies += "org.spongepowered" %"spongeapi" % "5.0.0-20160918.175729-123"
or latest
let's see if it works: http://scastie.org/22510
oh it's latest.integration
@Redrield nope http://scastie.org/22511
Perry
@pfn
Sep 20 2016 02:00
snapshot should work fine if you publish the snapshot. correctly
the maven-metadata file determines what timestamp corresponds to a snapshot
Jakub Dziworski
@JakubDziworski
Sep 20 2016 07:02
Hello. I love continuos feature in sbt. I use ~testQuick all the time for rapid tdd development. At my work however I have a project in Java with maven and Junit. It is painful to run tests all the time manually - Is there any way to achieve something similar?
Dale Wijnand
@dwijnand
Sep 20 2016 08:13
@JakubDziworski that's not really an sbt question, but anyways try https://github.com/sjl/peat :)
Jakub Dziworski
@JakubDziworski
Sep 20 2016 09:19
@dwijnand thanks. I also found https://infinitest.github.io/ for intellij
Justin Kaeser
@jastice
Sep 20 2016 10:31
is there a nice way to add an sbt plugin from the launcher or via command?
Justin Kaeser
@jastice
Sep 20 2016 11:03
That still needs that code to be in the global plugins, doesn't it?
Dale Wijnand
@dwijnand
Sep 20 2016 11:03
Yeah, thus the "kind of"
Justin Kaeser
@jastice
Sep 20 2016 11:16
guess I'll make do with apply then
copying the global plugin dir and adding files to a custom dir could work...
nguruwe55
@nguruwe55
Sep 20 2016 12:13
If I wanted to add a "developer profile" for sbt, so that I could set additional settings when running in developer mode (e.g. javaOptions), what's a good approach for that? Can I create a "runDev" task? Or a special "dev" configuration?
Dale Wijnand
@dwijnand
Sep 20 2016 12:17
@nguruwe55 add a developerMode setting
and then define things in terms of that being true or false
nguruwe55
@nguruwe55
Sep 20 2016 12:19
I guess that could work -- ideally, I was hoping for something that could be easily called from the command line, sbt runDev, or whatever
Dale Wijnand
@dwijnand
Sep 20 2016 12:20
you can always then define developerMode with a system property
developerMode := sys.props.get("developerMode").exists(_ == "true")
sbt -DdeveloperMode=true
or even sbt -DdevMode
nguruwe55
@nguruwe55
Sep 20 2016 12:21
OK, thanks, that looks good
Guillaume Massé
@MasseGuillaume
Sep 20 2016 15:49
Hey is there a way to make compilerReporter work with scalaCompilerBridgeSource ?
when I turn on sbt-dotty the compilerReporter is not used
I guess the compileInputsSettings just clear the reporter
Derek Wickern
@dwickern
Sep 20 2016 18:38

i have some integration test (it) code in project B which fails to compile. it can't find a trait from the integration test in project A

lazy val a = project
lazy val b = project.dependsOn(a % "compile->compile;test->test;it->test,it")

any ideas? there are no problems referencing code from the test configuration

a/it:test runs fine
it is defined as
lazy val IntegrationTest = config("it") extend Test
But I can't figure out how to run it.
Justin Reeves
@nonconvergent
Sep 20 2016 21:53
I followed the tutorial mostly and made this project, starting with the activator minimal-scala seed:
$ tree
.
├── LICENSE
├── bin
│   └── activator
├── build.sbt
├── libexec
│   └── activator-launch-1.3.10.jar
├── project
│   ├── boot
│   │   ├── sbt.boot.lock
│   │   └── update.log
│   └── build.properties
└── src
    ├── main
    │   └── scala
    │       └── org
    │           └── project
    │               └── my
    │                   └── Main.scala
    └── test
        └── scala
            └── HelloSpec.scala

I had to change one thing up in Main.scala to get it to compile:

  def initialGlobalLogging: GlobalLogging = {
    GlobalLogging.initial(MainLogging.globalDefault(ConsoleOut.systemOut), File.createTempFile("hello", "log"), ConsoleOut.systemOut)
  }

But I'm not sure what it means when it says

  • "Run sbt publishLocal in that directory"
  • "Run sbt @path/to/hello.build.properties to run the application."
I tried sbt publishLocal which appeared to work okay then sbt @./project/build.properties grinds to a screeching halt because module not found: org.project.my#new-relic-scala-cli_2.11.7;0.1-SNAPSHOT
Derek Wickern
@dwickern
Sep 20 2016 22:08
try sbt run or sbt run-main
Justin Reeves
@nonconvergent
Sep 20 2016 22:10
@dwickern java.lang.RuntimeException: No main class detected. Where does that get defined?
Derek Wickern
@dwickern
Sep 20 2016 22:10
in build.sbt, add mainClass in Compile := Some("org.project.my.Main")
i think run-main will look for a main and prompt you
Justin Reeves
@nonconvergent
Sep 20 2016 22:11
Not a valid command: run-main
Derek Wickern
@dwickern
Sep 20 2016 22:11
runMain maybe
Justin Reeves
@nonconvergent
Sep 20 2016 22:12
NOpe
OlegYch
@OlegYch
Sep 20 2016 22:12
run will prompt if it doesn't see a single main class
runMain just expects an argument
Justin Reeves
@nonconvergent
Sep 20 2016 22:14
I get the feeling this documentation is wildly out of date.
It's not prompting, unless by prompt your mean falling flat on its face.
Derek Wickern
@dwickern
Sep 20 2016 22:15
you might be running an old sbt. check build.properties
OlegYch
@OlegYch
Sep 20 2016 22:15
mm perhaps i'm wrong
Justin Reeves
@nonconvergent
Sep 20 2016 22:16
I made a new project. I get the feeling the http://www.scala-sbt.org/0.13/docs/Command-Line-Applications.html isn't even what I want.
I'm gonna go with a minimal Hello World, add scopt, and go from there.
OlegYch
@OlegYch
Sep 20 2016 22:17
run fails if it detects no main classes, prompts for a class name if it detects multiple, runs the single one otherwise
Justin Reeves
@nonconvergent
Sep 20 2016 22:18
@OlegYch it started looking for a main method after I specified it in the build.sbt
but like I said, I was trying this thing: http://www.scala-sbt.org/0.13/docs/Command-Line-Applications.html
OlegYch
@OlegYch
Sep 20 2016 22:19
might as well be..
Derek Wickern
@dwickern
Sep 20 2016 22:19
i'm not familiar with that way of running an application
Justin Reeves
@nonconvergent
Sep 20 2016 22:20
Yeah, me neither.
OlegYch
@OlegYch
Sep 20 2016 22:20
yeah i've not seen launcher being used in the wild
perhaps conscript uses it?
Justin Reeves
@nonconvergent
Sep 20 2016 22:21
I just want to make a little cli thing that I can run in jenkins builds to send commands to new relic
OlegYch
@OlegYch
Sep 20 2016 22:21
otherwise people just use plain jvm apps
Justin Reeves
@nonconvergent
Sep 20 2016 22:21
And I'm doing it in scala b/c learning
OlegYch
@OlegYch
Sep 20 2016 22:21
i'd suggest to start with sbt-native-packager
Derek Wickern
@dwickern
Sep 20 2016 22:24
yes. it will generate a startup script for you to set up your classpath based on your sbt dependencies