These are chat archives for sbt/sbt

30th
Jul 2016
Alexey Alekhin
@laughedelic
Jul 30 2016 02:11
Anyone familiar with parsers for custom commands? If I define my parser as failure("message"), I never see this message. If I try to enter some rubbish, it tells me [error] No valid parser available., but not the message I specified.
Perry
@pfn
Jul 30 2016 05:05
@jastice reflect was not separate in Scala 2.9
Justin Kaeser
@jastice
Jul 30 2016 06:26
@pfn yeah, seems to be a bug in 0.13.12 (this happened on an empty project with just the scalaVersion setting)
Miles Sabin
@milessabin
Jul 30 2016 10:18
@jastice I think that's probably my fault. I'll investigate.
Are you really still using 2.9.3?
2.9.x I can just about understand, but why not the most recent 2.9.x?
Hmm ... OK, 2.9.3 is the most recent 2.9.x :-D
@jastice would you mind opening a ticket for this and assigning it to me?
Miles Sabin
@milessabin
Jul 30 2016 10:23
Could you also try ivyScala := { ivyScala.value map {_.copy(overrideScalaVersion = false)} } as a workaround?
Dale Wijnand
@dwijnand
Jul 30 2016 10:25
@milessabin here's the ticket sbt/sbt#2686
Justin Kaeser
@jastice
Jul 30 2016 11:47
@milessabin not using it per say, but discovered the issue in our tests (sbt importing for intellij)
Miles Sabin
@milessabin
Jul 30 2016 11:49
Gotcha.
Edmondo Porcu
@edmondo1984
Jul 30 2016 12:46
Hello ,I have been trying to put anywhere a file in managed_sources and I was not able to compile, I am in a multi-module project. Show managedSources doesn't show my file...how can I investigate further? in principle I should be able to place a Scala file under target/scala_2.11/managed_src/main and get it compile right?
Dale Wijnand
@dwijnand
Jul 30 2016 12:51
@edmondo1984 Just for clarity, managed means managed by sbt, as opposed to unmanaged which means managed by the user. Are you sure you mean managed?
Edmondo Porcu
@edmondo1984
Jul 30 2016 12:54
@dwijnand so I am using slick.codeGen to autogenerate classes from a database, the tutorial on Slick documentation suggested to place them in sbt-managed. I am doing this with a task like so
    lazy val slickCodeGenTask = (sourceManaged, dependencyClasspath in Compile, runner in Compile, streams) map { (dir, cp, r, s) =>
        val outputDir = (dir / "main").getPath // place generated files in sbt's managed sources folder
        val url = localDbUrl // connection info for a pre-populated throw-away, in-memory db for this demo, which is freshly initialized on every run
        val pkg = "com.mycompany.mypackage"
        toError(r.run("slick.codegen.SourceCodeGenerator", cp.files, Array(mysqlSlickDriver, localDbDriver, url, outputDir, pkg,localDbUser,localDbPassword), s.log))
        val fname = outputDir + "/Tables.scala"
        Seq(file(fname))
    }
this is the example I am talking about https://github.com/slick/slick-codegen-example
Dale Wijnand
@dwijnand
Jul 30 2016 13:01
Oh, yeah then managed is correct.
Are you then hooking that slickCodeGenTask up?
Otherwise it's just a floating task implementation definition
Edmondo Porcu
@edmondo1984
Jul 30 2016 13:04
I am running that manually, then I am running a compile. If I place a dummy scala class inside src_managed/main, it should be compiled when I run compile is that right?
Edmondo Porcu
@edmondo1984
Jul 30 2016 13:47
all explained @dwijnand , in reality managedSources doesn't take the content in managedSourceDirectories at all. The two things are not dependend, managedSources just takes the output of the source code genrator. We had to do the following :
(managedSources in Compile)<++=  (managedSourceDirectories in Compile).map{
      sourceDirectories =>
        sourceDirectories flatMap {
          sourceDirectory =>
            val finder: PathFinder = sourceDirectory ** "*.scala"
            finder.get
        }
    }
Dale Wijnand
@dwijnand
Jul 30 2016 14:45
hmm ok
Perry
@pfn
Jul 30 2016 15:25
managedSourceDirectories is just a suggestion for sourceGenerators to use
also automatically cleaned
that is all
@edmondo1984,
managedSources come from sourceGenerators