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.

Prasad Ganta | 15 Oct 15:24 2014
Picon

How to resolve dependencies through proxy repository

Hello guyz,

please answer this question even if it is looking dumb...

I have some dependencies in my Build.scala file and by default all the dependencies are getting resolved from mave/typesafe public repo.
so far I dont have any issues, now I want to resolve all my public or internal dependencies through private repository which is hosted on internal server.

Here what I did so far

- I went through    sbt documentation on  http://www.scala-sbt.org/0.12.2/docs/Detailed-Topics/Proxy-Repositories.html 
- Currently we are using Artifactory as our proxy server, so I prepared artifactory to download required dependencies from various public repos.
- Added resolvers in Build.scala like below

 resolvers := Seq("snapshots" at "http://hostedurl/artifactory/libs-snapshot-local/",
        "typesafe-cache" at "http://hostedurl/artifactory/typesafe",
        "snapshots" at "http://hostedurl/artifactory/ext-release-local",
        " repo1-cache" at "http://hostedurl/artifactory/repo1")

Now the problem

It is not resolving the dependencies through above urls, it is resolving with default repo urls comes with sbt.

as per the document I needs to make some changes to ~/.sbt/repositories I am not able to find the files mentioned in the document(Ia m using windows machine)

Can anyone please help me with the above issue.


Thanks
Prasad 

--
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.
Daniel Sobral | 24 Oct 03:44 2014
Picon

Keys in .sbt files

SBT 0.13.6 now makes keys defined on .sbt files visible from SBT console.

However, it seems, and TODOs on the relevant commit seems to confirm it, that keys defined in this fashion are not visible from _other_ build.sbt files.

We use keys to set libraries present in multiple projects to the same version in all of them, so having a key visible from multiple files is essential for us.

Are there plans to have this implemented? Is there an issue tracking it, or should I open one?

--
Daniel C. Sobral

I travel to the future all the time.

--
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.
Rishi Khandelwal | 10 Oct 06:45 2014

Error during sbt test execution: java.lang.NoClassDefFoundError: scala.Option with ScalaTest

Hello

When I am running my project with "sbt compile" or "sbt run" or scala test from eclipse (via downloading scala test plugin in eclipse), it runs fine. there is no error at all.

But when i do "sbt test" , it throws the error : java.lang.NoClassDefFoundError: scala.Option

I searched on google as well and i found that scala-library.jar is not added to classpath. I am not getting proper solution for this.

sbt version : 0.13.2

Please put your thoughts here.

--
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