Amrit Jyoti Baruah | 11 Feb 19:46 2015
Picon

How to create META-INF/services file using sbt

I am trying to use java.util.ServiceLoader in my project and for that I need to create the services file under META-INF. I was following the link below for that-
http://megeveraderesi.com/2014/04/02/serviceloader-a-very-lightweight-di-mechanism/

But somehow I am not able to get the services file created. Can someone please help me out here? What is the baseDirectory.value?

Regards,
Amrit

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-tool+unsubscribe <at> googlegroups.com.
To post to this group, send email to simple-build-tool <at> googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.
Sebastiaan Samyn | 5 Feb 11:00 2015
Picon

Difference between force() and dependencyOverrides

We have a project that is at the same time dependent on akka 2.3.2 and kamon 0.3.5. When we package with sbt-pack (https://github.com/xerial/sbt-pack), we notice that it puts the akka-actor jar twice on the classpath (versions 2.3.2 and 2.3.6).

I was able to fix this using sbt 0.13.7 and the force() keyword, but it only works on that specific version. I was expecting that the dependencyOverrides setting would also work, but that's not the case, it still spits out both libraries. When we print out a dependency tree using sbt-dependency-graph (https://github.com/jrudolph/sbt-dependency-graph), then we also see both versions.

Could you explain what the difference is between between force() and dependencyOverrides?

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-tool+unsubscribe <at> googlegroups.com.
To post to this group, send email to simple-build-tool <at> googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.
Kevin Meredith | 3 Feb 23:37 2015
Picon

Understanding `libraryDependencies` with respect to Scala Version in `build.sbt`

My incomplete understanding is that, differing Scala major versions may not be compatible with each other.

So, a library compiled on Scala 2.9 will likely not work with a Scala 2.10 library.

Given the following `build.sbt`:

    name := "Foobar"
    
    version := "1.0"
    
    scalaVersion := "2.11.4"
    
    libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.4"

Does **sbt** only pull down the `akka-actor` library that's compatible with Scala version: `2.11.4`?

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-tool+unsubscribe <at> googlegroups.com.
To post to this group, send email to simple-build-tool <at> googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.
Mateusz Jaje | 27 Jan 13:43 2015
Picon

SBT Plugin Developing, using value from anither task in parser exampels for tab completion

Hello, I'm developing simple plugin for working with AWS S3,
and I want to pass to tab completion current list of buckets fetched from S3, I've taskKey s3FetchBuckets which does its work in console properly, but i have no idea what to use output from thins task in inputTask for provide tab completion...
my target is to 
s3Upload [tab] bucket1 busket2 itd

i tried so match ways, but i get or compile error (illegal reference to) or no work after press tab....
please help me, in google is so little help in developing sbt plugin... :(

Code is attached as file.

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-tool+unsubscribe <at> googlegroups.com.
To post to this group, send email to simple-build-tool <at> googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.
Attachment (S3AutoPlugin.scala): application/octet-stream, 3183 bytes
Dean Wampler | 18 Jan 16:21 2015
Picon

Setting compile:console::scalacOptions to be a subset of compile:scalacOptions

I'm trying to use the Scala 2.11 -Ywarn-unused-import option while compiling, but not in the console, where it effectively disables the ability to use most imports, especially in initialCommands.

Here's a sample ./project/Build.scala file:

import sbt._
import sbt.Keys._

object MyBuild extends Build {
  import Resolvers._
  import BuildSettings._

  val commonScalacOptions = Vector("-deprecation", "-unchecked", "-feature",
        "-encoding", "utf8",
        "-Yno-adapted-args", "-Ywarn-dead-code",
        "-Ywarn-numeric-widen", "-Ywarn-value-discard")
  val compileScalacOptions = commonScalacOptions ++ Vector("-Ywarn-infer-any", "-Ywarn-unused-import")

  val scalaTest = "org.scalatest" %% "scalatest" % "2.2.1" % "test"

  lazy val myProject = Project(
    id = "SampleProject",
    base = file("."),
    settings = buildSettings ++ Seq(
      version      := "0.1.0",
      scalaVersion := "2.11.4",
      scalacOptions in Compile := compileScalacOptions,
      scalacOptions in console := commonScalacOptions,
      libraryDependencies ++= Seq(scalaTest)))
}

Here's a sample ./build.sbt:

initialCommands += """
  import org.example.foo._
  """


Once I start sbt, I see the following:

> show *:console::scalacOptions
[info] Vector(-deprecation, -unchecked, -feature, -encoding, utf8, -Yno-adapted-args, -Ywarn-dead-code, -Ywarn-numeric-widen, -Ywarn-value-discard)
[success] Total time: 0 s, completed Jan 18, 2015 9:12:22 AM
> show compile:scalacOptions
[info] Vector(-deprecation, -unchecked, -feature, -encoding, utf8, -Yno-adapted-args, -Ywarn-dead-code, -Ywarn-numeric-widen, -Ywarn-value-discard, -Ywarn-infer-any, -Ywarn-unused-import)


But when I start the console, I get this:

> console
[info] Starting scala interpreter...
[info]
<console>:12: warning: Unused import
         import org.example.foo._
                                          ^
import org.example.foo._
Welcome to Scala version 2.11.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0).
...

It appears that the full set of compile options are being used. Using :power and :settings confirms this.

Is it possible to set console to use a subset of flags?

dean

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-tool+unsubscribe <at> googlegroups.com.
To post to this group, send email to simple-build-tool <at> googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.
Andrei Pozolotin | 16 Jan 04:06 2015
Picon

custom name of "project" folder?

is there a way to have custom name for "project" folder?

Matthew Pocock | 13 Jan 21:45 2015
Picon

cpu burn

Hi,

I'm launching a spray.http server using sbt and the re-start command. This is convenient for me, since to update the live (but not production) service, I just do a git pull. However, I'm seeing a java process consistently burning about 10-15% of my CPU, even when no requests are being serviced. If I exit the sbt process, this goes away. 

I did some very basic profiling using javatop, and got this out. It looks like the cause is SourceModificationWatch. I'm not seeing a huge amount of disk IO.

Is this a known issue?

Matthew

 JvmTop 0.8.0 alpha - 20:42:44,  amd64,  3 cpus, Linux 3.16.0-25, load avg 0.44

 Profiling PID 17466:                           sbt-launch.jar 

  24.86% (    25.78s) sbt.ConcurrentRestrictions$$anon$4.submit()
  18.33% (    19.00s) sbt.SourceModificationWatch$$anonfun$1.apply()
  14.16% (    14.68s) sbt.ConcurrentRestrictions$$anon$4.take()
  10.67% (    11.06s) sbt.CompletionService$.submit()
   5.01% (     5.19s) sbt.Execute$$anonfun$ready$1.apply$mcV$sp()
   4.99% (     5.17s) scala.collection.AbstractTraversable.<init>()
   4.62% (     4.79s) sbt.SourceModificationWatch$$anonfun$2.apply()
   4.30% (     4.46s) scala.collection.AbstractSeq.<init>()
   3.60% (     3.73s) ...la.collection.convert.Wrappers$JMapWrapperLike$class.()
   3.56% (     3.69s) scala.collection.TraversableLike$class.to()
   2.52% (     2.62s) sbt.Execute.dependencies()
   1.85% (     1.92s) sbt.DelegatingPMap.get()
   1.53% (     1.59s) scala.Some.equals()
   0.00% (     0.00s) ....BasicIO$$anonfun$processFully$1$$anonfun$apply$8.app()

--
Dr Matthew Pocock
Turing ate my hamster LTD

Integrative Bioinformatics Group, School of Computing Science, Newcastle University

skype: matthew.pocock
tel: (0191) 2566550
mob: +447535664143

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-tool+unsubscribe <at> googlegroups.com.
To post to this group, send email to simple-build-tool <at> googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.
Picon

Why does sbt override scala version in sub project?

Hi! I have failed to find any answers about  how to control scala version in sub project. Below is my case: 

lazy val sevone = Project(id = "sevone",      
    base = file("sevone")) dependsOn nmsCommons
 
  lazy val nmsCommons = Project(id = "nms-commons",
    base = file("nms-commons"))

where sevone project has 2.11.0 scala version and  nmsCommons has 2.10.2


When I'm trying to compile sevone sbt overrides scala version in subproject from 2.10.2 to 2.11.0 and sbt fails with 

Stack trace suppressed: run 'last sevone/*:update' for the full output.
[error] (sevone/*:update) sbt.ResolveException: unresolved dependency: network-monitoring-system-commons#network-monitoring-system-commons_2.11;1.0: not found

How can I tell to sbt not to override version? Maybe crossScalaVersions or something? I've tried but all just the same(

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-tool+unsubscribe <at> googlegroups.com.
To post to this group, send email to simple-build-tool <at> googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.
Pathikrit Bhowmick | 20 Nov 19:26 2014
Picon

Dynamically load user defined code from plugin?

Reposted on SO: http://stackoverflow.com/questions/27024934/sbt-plugin-dynamically-load-user-defined-code

I am working on a sbt plugin that generates Scala models given a database using Slick code generator

I would ofcourse want users to override the code generator so my plugin needs to support this:

  • Anyway I can dynamically load a Scala class given a path to it in the build.sbt plugin keys? For example, in the user's parent build.sbt, she would provide something like codegen.override=com.company.project.CustomCodegenerator which looks like this

  • Related to above; the custom codegen may use some other libraries so a simple dynamic class load may not suffice. Anyway an sbt plugin can inherit the dependencies of the project using that plugin?

Here is the full discussion about this: https://github.com/papauschek/play-slick-evolutions-plugin/issues/1


--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-tool+unsubscribe <at> googlegroups.com.
To post to this group, send email to simple-build-tool <at> googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.
Piyush Mishra | 18 Nov 09:27 2014
Picon

Is there any workaround for generating SWF client files using sbt aspectJ plugin

Hi All,

I am using SWF in sbt project. But i am getting problem in generating swf 
client classes. Is there any workaround for this. 

sbt problem with kafka test jar

Hello,

I am currently trying to get both the Kafka 0.8.1.1 and the Kafka 0.8.1.1-test library to get downloaded and used by sbt.

In my build.sbt I have the followin lines:

  "org.apache.kafka"  %% "kafka" % "0.8.1.1" withSources(),
  "org.apache.kafka"  %% "kafka" % "0.8.1.1-test" withSources(),

and:
scalaVersion := "2.10.4"

The strange thing is that sbt does not seem to download the test jar. when I use 0.8.7.5 (which does not exist!) sbt reports an error but when I use "test-XYZ" no error is reported. The library does exist:


Does sbt somehow ignore the text after the version number, meaning does it turn "0.8.1.1-test" into "0.8.1.1"?

Any idea what I am doing wrong?

Regards,

Markus






--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-tool+unsubscribe <at> googlegroups.com.
To post to this group, send email to simple-build-tool <at> googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool.
For more options, visit https://groups.google.com/d/optout.


Gmane