by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 22 2015 11:10
    japgolly commented #2066
  • Jun 22 2015 08:25
    keepscoding commented #2044
  • Jun 21 2015 03:24
    xerial commented #157
  • Jun 21 2015 00:10
    eed3si9n unlabeled #2057
  • Jun 21 2015 00:10

    eed3si9n on 0.13

    Adds bundledLauncherProj to all… Remove launcher tests Add unit tests to Travis and 3 more (compare)

  • Jun 21 2015 00:10
    eed3si9n closed #2057
  • Jun 21 2015 00:10

    eed3si9n on fixbuild

    (compare)

  • Jun 20 2015 18:42
    eed3si9n synchronize #2057
  • Jun 20 2015 18:42

    eed3si9n on fixbuild

    Fix typo (compare)

  • Jun 20 2015 18:23

    eed3si9n on fixbuild

    Adds bundledLauncherProj to all… Remove launcher tests Add unit tests to Travis and 1 more (compare)

  • Jun 20 2015 18:23
    eed3si9n synchronize #2057
  • Jun 20 2015 14:59

    eed3si9n on scalaversionbump

    (compare)

  • Jun 20 2015 14:59

    eed3si9n on 0.13

    Bumping up Scala version to 2.1… Try to keep bincompat Fixes #1666 and 1 more (compare)

  • Jun 20 2015 14:59
    eed3si9n unlabeled #2068
  • Jun 20 2015 14:59
    eed3si9n closed #2068
  • Jun 20 2015 14:59
    eed3si9n closed #1666
  • Jun 20 2015 14:57
    eed3si9n commented #2068
  • Jun 20 2015 12:55
    dwijnand commented #2068
  • Jun 20 2015 04:51
    eed3si9n synchronize #2068
  • Jun 20 2015 04:51

    eed3si9n on scalaversionbump

    Fixes #1666 (compare)

Brian Topping
@briantopping
Hi all, does this look like anything that ought to work? this is my first time with these features:
    unmanagedResources in Compile += Def.task {
      val temp = IO.createTemporaryDirectory
      "curl --silent https://example.com/main-module/-/main-module-0.0.2.tgz" #| s"tar -xf -C$temp" !
        (unmanagedResourceDirectories in Compile) += temp
    }.taskValue
Palmer Lao
@palmerlao
I want to write a custom command that's similar to console but sets up spark. I know about initialCommands and cleanupCommands for console itself, but I was hoping for this to be separate. Could someone point me in the right direction?
scalasolist
@scalasolist
@fommil I ended with the following config
  val zeroCrossSettingsTemplate = Seq(
    unmanagedSourceDirectories := unmanagedSourceDirectories.value.filter(f => ! f.getName.startsWith("scala-")),
    managedSourceDirectories := Seq()
  )
  val zeroCrossSettings = inConfig(Compile)(zeroCrossSettingsTemplate) ++ inConfig(Test)(zeroCrossSettingsTemplate)
Brian Topping
@briantopping
Ah, it seems to look like this:
    unmanagedResources in Compile += Def.task {
      val temp = IO.createTemporaryDirectory
      val result = "curl --silent https://example.com/main-module/-/main-module-0.0.2.tgz" #| s"tar -xf -C$temp" !;
      temp
    }.value
scalasolist
@scalasolist
that looks more like managedResources
Brian Topping
@briantopping
hmm, I suppose I should explore, thanks
scalasolist
@scalasolist
unmanaged* - is what you fill with your file manager. And managed* is what you generate with a code
Brian Topping
@briantopping
gotcha ok
Ghost
@ghost~540393fe163965c9bc2018ce
@scalasolist I bet you're using a hand rolled sbt script instead of the official one, aren't you?
That doc page with the 2 line sbt launcher should be taken out the back and put out of its misery.
scalasolist
@scalasolist
I use official one. But hadn't updated it since 2013. Now as you pointed, I believe it is too old
but nevertheless -J-X works fine
ykycxzsv
@ykycxzsv
at the sbt prompt, i can type "project/task" to run a task in a specific project. "project/command" doesn't work however. how can i run a command in a specific project?
Ghost
@ghost~540393fe163965c9bc2018ce
project <name>
then the command
Commands suck
ykycxzsv
@ykycxzsv
there's no way to do it without changing the current project?
Dale Wijnand
@dwijnand
no, but here's the feature request for it sbt/sbt#2900
ykycxzsv
@ykycxzsv
ok. i think i'll try to convert it to a task, but problem is the implementation has to call other existing commands. i understand that i can read state.value and pass to the command's state parameter, but i should also update state based on result of the command. i tried state := command(state.value), but now the task doesn't do anything!
Dale Wijnand
@dwijnand
yeah you can't call commands from tasks
as a workaround to that feature missing you could take the project name as a first argument
ykycxzsv
@ykycxzsv
i don't need the project name, i need to fit in a framework which attempts to do "sbt project/mycommand". since commands don't support that syntax, i have to use a task, but since tasks can't call commands, i'm screwed. guess it's time for some ugly kludge
Ghost
@ghost~540393fe163965c9bc2018ce
if it's your command, you could take the project name as an input
but then you'd want to rewrite your Command as a Task anyway...
ykycxzsv
@ykycxzsv
like i said, i DON'T need the project name. and i can't rewrite my command to a task if a task can't call other commands
Dale Wijnand
@dwijnand
You need to run the command in a specific project, though, right?
Michael Pollmeier
@mpollmeier

How can I refer to a scoped key programmatically? I.e. what is the programmatic equivalent of e.g. scalafmt::test?

Context: neo-sbt-scalafmt defines a TaskKey scalafmt that formats your sources, but it also defines a scope called test (https://github.com/lucidsoftware/neo-sbt-scalafmt/blob/master/sbt-scalafmt/src/main/scala/com/lucidchart/sbt/scalafmt/ScalafmtCorePlugin.scala#L143) that only checks if the sources are in line with the expected format. Depending on a SettingKey the TaskKey scalaFmt is invoked before compile. I want to introduce a new SettingKey that invokes scalafmt::test instead. The below compiles, but always runs scalafmt, not scalafmt::test.

    if (scalafmtOnCompile.value) scalafmt in resolvedScoped.value.scope
    else if (scalafmtTestOnCompile.value) (test in scalafmt) in resolvedScoped.value.scope

https://github.com/lucidsoftware/neo-sbt-scalafmt/blob/master/sbt-scalafmt/src/main/scala/com/lucidchart/sbt/scalafmt/ScalafmtCorePlugin.scala#L170

Dale Wijnand
@dwijnand
Try test in (resolvedScoped.value.scope in scalafmt)
which basically means: "take the existing scope, but make it in scalafmt task scope, that's the scope of test that I want to use"
Michael Pollmeier
@mpollmeier
hmm, that doesn't compile, because scalafmt is a TaskKey, and in takes one of AttributeKey, ConfigKey or Reference. Not sure what those are, will have a look if it's possible to convert a TaskKey into one of them..
Dale Wijnand
@dwijnand
test in (resolvedScoped.value.scope in scalafmt.key) should compile
Michael Pollmeier
@mpollmeier
yes, just found that as well. it compiles, but it still acts like scalafmt, not scalafmt::test. Can you have a quick look at this line and tell me if my understanding is correct, that it's a scoped key? This is what I want to refer to:
https://github.com/lucidsoftware/neo-sbt-scalafmt/blob/master/sbt-scalafmt/src/main/scala/com/lucidchart/sbt/scalafmt/ScalafmtCorePlugin.scala#L143
Dale Wijnand
@dwijnand
so it's defined unscoped, then it passed through inTask, which scopes it
Michael Pollmeier
@mpollmeier
so, it should work right? for context, here's my commit: mpollmeier/neo-sbt-scalafmt@4a113d7
I'm using that in a project where inspect scalafmtTestOnCompile tells me [info] Setting: Boolean = true
but when I run compile it runs scalafmt, not scalafmt::test
should I open a stackoverflow question instead?
Dale Wijnand
@dwijnand
just to sanity check: scalafmtOnCompile is false, right?
Michael Pollmeier
@mpollmeier
Correct
Michael Pollmeier
@mpollmeier
actually, no! I just inspected the value of scalafmtOnCompile and it was set to true in a different file. sorry!
so, yes, your suggested test in (resolvedScoped.value.scope in scalafmt.key) does the job. thank you!
would you like me to add this to the docs, or create a stackoverflow question with answer?
I'll wrap up a PR for neo-sbt-scalafmt shortly
Dale Wijnand
@dwijnand
resolvedScoped is a pretty advanced topic. But a stackoverflow question and answer can't hurt, can it.
s3ni0r
@s3ni0r

Hi everyone, i have a custom resolver in my build.sbt file that's not challenged when resolving dependencies, these are my revolvers

resolvers ++= Seq(
      Resolver.sonatypeRepo("snapshots")
      ,Resolver.sonatypeRepo("releases")
      ,Resolver.typesafeRepo("releases")
      ,"spray repo" at "http://repo.spray.io"
      ,"SpinGo OSS" at "http://spingo-oss.s3.amazonaws.com/repositories/releases"
    )

and this is the warning i get :

[info] Resolving com.spingo#op-rabbit-core_2.11;1.2.1 ...
[warn]     module not found: com.spingo#op-rabbit-core_2.11;1.2.1
[warn] ==== local: tried
[warn]   /root/.ivy2/local/com.spingo/op-rabbit-core_2.11/1.2.1/ivys/ivy.xml
[warn] ==== local-preloaded-ivy: tried
[warn]   /root/.sbt/preloaded/com.spingo/op-rabbit-core_2.11/1.2.1/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////root/.sbt/preloaded/com/spingo/op-rabbit-core_2.11/1.2.1/op-rabbit-core_2.11-1.2.1.pom
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/spingo/op-rabbit-core_2.11/1.2.1/op-rabbit-core_2.11-1.2.1.pom

i tried both sbt 13.8 and 13.15 and got the same result, do you guys have any idea about this? thanks for your help

OlegYch
@OlegYch
that probably means your config is not actually applied
eg the resolvers are applied to different project
s3ni0r
@s3ni0r
yeah i have 3 modules
and the resolvers above are included in the modules that uses the needed dependency
it suddenly stopped working
s3ni0r
@s3ni0r
Problem solved it was a module dependency issue, thanks everyone :)