Radzislaw Galler | 21 May 2013 09:23
Picon
Gravatar

Is it possible to re-launch and test xsbti.AppMain derived application from sbt?

Hi,

I've posted this question originally to StackOverflow, but this group seems to be better suited for that.

I'm developing an sbt launched application with custom command line interface. The problem is that every time I want to test it I have to remove the previously published boot directory and then recompile and publish locally the artefacts, and then finally run the app and test it manually. Part of this is accomplished by running external shell scripts.

How could I make sbt doing the job for me? I've already made the skeleton command for it:

lazy val root = Project( id = "app", base = file("."), settings = buildSettings ++ Seq( resolvers := rtResolvers, libraryDependencies ++= libs, scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked"), commands ++= Seq(launchApp)) ) val launchApp = Command.command("launch") { state => state.log.info("Re-launching app") state }

Is it possible to test it with, say specs2 from sbt? How would I accomplish that?

-- 

Radek

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
eugene yokota | 19 May 2013 19:30
Picon
Gravatar

sbt-pgp should be part of sbt 0.13

Hi guys,


I'm seeing some AttributeKey ID collisions for pgp-signer etc since sbt-pgp 0.8 came out.
What do you guys think about incorporating it as part of sbt 0.13?

sbt-pgp is now an essential part of ecosystem, since many OSS projects who
don't have their own repo publish to Sonatype as signed jar, which is overall a good thing.
sbt-pgp 0.8 came out a few months ago, adding publish-signed instead of just signing everything,
which also was smooth, in the parlance of our times.

But now we have half the OSS projects depending on sbt-pgp, and some plugin or build may even make
explicit reference to a particular version of it to customize the release behavior,
resulting to diamond inheritance problem.

[error] AttributeKey ID collisions detected for: 'pgp-signer' (sbt.Task[com.typesafe.sbt.pgp.PgpSigner], sbt.Task[com.jsuereth.pgp.sbtplugin.PgpSigner]), 'pgp-verifier' (sbt.Task[com.typesafe.sbt.pgp.PgpVerifier], sbt.Task[com.jsuereth.pgp.sbtplugin.PgpVerifier]), 'check-pgp-signatures' (sbt.Task[com.typesafe.sbt.pgp.SignatureCheckReport], sbt.Task[com.jsuereth.pgp.sbtplugin.SignatureCheckReport]), 'signatures-module' (sbt.Task[com.typesafe.sbt.pgp.GetSignaturesModule], sbt.Task[com.jsuereth.pgp.sbtplugin.GetSignaturesModule])
[error] Use 'last' for the full log.

It's not like a project or a plugin needs more feature than the other, they just need to agree on a version.
One solution is to say "only use sbt-pgp from global" but if someone needs to tweak releasing, that's probably not reasonable.
Another solution is to say "then at least use the latest version." That also won't work since binary versioning of sbt,
a build or a plugin can now live a long life, and some build may be using older plugins that references sbt-pgp.
The real solution, I think is that sbt-pgp becomes part of the sbt 0.13. This way, I can do my things in global,
and other projects can do their things in build.sbt, and it'll always be the same version since globals will be version-segregated.

-eugene

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Matthieu Taggiasco | 19 May 2013 16:14
Picon
Favicon
Gravatar

package task with arguments to create a file

Hi all,


I'm trying to use the package task in order to package my application. However some properties are specific, and I would like to put them as arguments of the package task (or another one maybe?) in order to add a new resource file according to their values.

I read the documentation of SBT, but I'm a bit lost with all the possibilities it offers. Should I implement a new task on which the package task would depend on ? Or should I do something else ?

A simple example would be : 
package "first parameter for filename" "second parameter as file content"

Or if needed : 
my-package "first parameter for filename" "second parameter as file content"

I put the quotes just as examples, I don't if I have to put them somewhere else (I think so, as I read the doc). 

May anyone help ?

Thanks,
Matt

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Tsume | 18 May 2013 23:41
Picon

Setting JVM Boot paramaters for scala

Hi everyone.


I'm trying to use SPDY in Socko as directed here. I believe my set up is correct but I'm unable to to make contact with the web server, I believe this is due to me not setting up the NPN boot file correctly. I'm not sure if I've done it correctly. In my build.sbt file I put the following:

javaOptions += "-Xbootclasspath/home/tsume/Documents/npn-boot-1.1.1.v20121030.jar"

Is this correct?

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Tsume | 18 May 2013 23:51
Picon

Setting up JVM boot parameters

Hi everyone.


I'm trying to use SPDY in Socko webserver, as directed here, but I'm failing to connect. I believe this might be due to me not loading up the NPN jar file correctly for the JVM. In my build.sbt file I put the following:

javaOptions += "-Xbootclasspath/home/bongani/Documents/npn-boot-1.1.1.v20121030.jar"

Is this correct?

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Russ P. | 18 May 2013 02:33
Picon

problem upgrading to scala 2.10

I am trying to upgrade from Scala 2.9.1 to 2.10. Here is part of my build.sbt file:

scalaVersion := "2.10.1"

crossPaths := false

scalacOptions += "-deprecation"

scalacOptions += "-Xcheckinit"

scalacOptions += "-Ywarn-dead-code"

libraryDependencies += "org.scala-lang" % "scala-swing" % "2.10.1"


When I use it, I get this:


[info] 'compiler-interface' not yet compiled for Scala 2.10.1. Compiling...
/tmp/sbt_b1faf6cb/API.scala:263: error: type mismatch;
 found   : String
 required: ?{def endsWith(x$1: ? >: API.this.global.tpnme.NameType): Boolean}
Note that implicit conversions are not applicable because they are ambiguous:
 both method stringToTermName in trait Names of type (s: String)API.this.global.TermName
 and method stringToTypeName in trait Names of type (s: String)API.this.global.TypeName
 are possible conversion functions from String to ?{def endsWith(x$1: ? >: API.this.global.tpnme.NameType): Boolean}
                sym.isLocalClass || sym.isAnonymousClass || sym.fullName.endsWith(LocalChild)
                                                                ^
/tmp/sbt_b1faf6cb/API.scala:263: error: type mismatch;
 found   : API.this.global.tpnme.NameType
    (which expands to)  API.this.global.TypeName
 required: String
                sym.isLocalClass || sym.isAnonymousClass || sym.fullName.endsWith(LocalChild)
                                                                                  ^
two errors found
[error] {file:/home/rpaielli/TSAFE/code/}default-8c445d/compile:compile: Error compi
ling sbt component 'compiler-interface'
[error] Total time: 5 s, completed May 17, 2013 5:29:47 PM


Any idea what the problem is? Thanks.

--Russ P.

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Heiko Seeberger | 17 May 2013 22:26
Picon
Gravatar

Input task question

Hi,

I'd like to implement an input task, but not directly "assign" it the input key.

Example

val key = inputKey[Unit]("Some key")
...
key := SomeObject.task()

SomeObject {
  def task() = ...
}

Now I get 
`parsed` can only be used within an input task macro, such as := or Def.inputTask.

As I don't want to directly assign, I tried Def.inputTask, but that didn't work.

SomeObject {
  def task() = Def.inputTask { ... }
}

Any hints?

Thanks
Heiko

--

Heiko Seeberger
Twitter: <at> hseeberger
Blog: heikoseeberger.name
Company: Typesafe - The software stack for applications that scale
Author of "Durchstarten mit Scala, a tutorial-style Scala book"

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
amertum | 16 May 2013 22:50
Picon

[sbt-aspectj] How configure aspectj compilation using spring-aspects dependency

I would like to enable aspectj compilation of my project classes using the already compiled spring-aspects


I am integrating the sbt-aspectj plugin within a playframework 2.1 java project

    val main = play.Project(appName, appVersion, appDependencies)
           
.settings(aspectjSettings: _*)
           
.settings(
                    verbose
in Aspectj := true,
                    showWeaveInfo
in Aspectj := true,
                    inputs
in Aspectj <+= compiledClasses,
                    binaries
in Aspectj += file("/home/user/.m2/repository/org/springframework/spring-aspects/3.1.4.RELEASE/spring-aspects-3.1.4.RELEASE.jar")
           
)

but the weaving don't appear to append and I would like to use another way to define the spring-aspects jar using dependencies such as :

    libraryDependencies += "org.springframework" % "spring-aspects" % "3.1.4.RELEASE",

I looked at this example https://github.com/sbt/sbt-aspectj/tree/v0.9.0/src/sbt-test/weave/external but it is for weaving of external module, not dependencies.

Help would be really appreciated as I am a newbie with sbt and very confused by its logic (come from maven world...).

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Sébastien Doeraene | 16 May 2013 17:44
Picon
Picon
Favicon

Making sbt compatible with Scala.js

Hello everyone,

As some of you may know, I develop Scala.js, a JavaScript backend for Scala. I would like to make sbt compatible with Scala.js so that it can be used as build tool for Scala.js projects.
I'd like to discuss here how that can be implemented.

I'm already saying that I do have a working prototype, but it seems to me to be more of a hack than a proper implementation. I've had an initial exploration with Jason last week, which eventually lead me to this prototype.

I would greatly appreciate any feedback on my approach.

The issue

The design of Scala.js is not to be a fork of scala/scala. Instead, it is a "regular" Scala program that uses scala-compiler.jar as a library. If it were, I would only have to specify a scalaHome, or a different published compiler version, but it's not.
That makes for a first issue: I have two jars for the compiler (scala-compiler.jar and scalajs-compiler.jar).

Moreover, Scala.js uses special Global instance, which is a subclass of scala.tools.nsc.Global. More precisely, Scala.js defines a trait scala.tools.nsc.scalajs.JSGlobal that is mixed in Global to create the Scala.js compiler instance.
That makes for the second issue: the compiler used by sbt to compile Scala.js programs must mix in the JSGlobal trait too.

I believe that a good, general solution to the support of Scala.js would provide the sbt user with:
1. A way to extend the classpath of the compiler with additional jars.
2. A way to specify the name of a top-level trait to be mixed in the Compiler instance used.
Ideally, these options should be editable as settings.

I will now describe the "solution" I implemented commit by commit (there are 5 of them), because they show the reasoning.
The solution provides the two features above, without breaking the rest of sbt. But I'm not sure it is the right, or nicest, way of providing these two features.

If you do not want to read it all, you can jump to "End result and conclusion".

A first hack that made it "work" and that shows what I need

As a first proof of concept, I hacked a fork of sbt 0.13 to change the Compiler Interface so that it mixes in JSGlobal. Of course I had to patch some other places of the code to get the right classpath, and to disable precompiled versions of the compiler interface with Scala < 2.10.
https://github.com/sjrd/sbt/commit/cd019d4a38bd4c878c4ab57f0e28badb3d43f690

Really, the useful part of that commit is to mixin JSGlobal with Compiler. All the other changes are hacks so that it compiles again (on my system, with hard-coded paths).

Mixin of JSGlobal at "runtime" with Scala reflection and its ToolBox

As suggested by Jason, I modified the previous hack to perform the mixin at "runtime" (whatever that means in sbt), using the ToolBox API of Scala 2.10.
https://github.com/sjrd/sbt/commit/fa9658f43efca2ee2120b2ebd8246f197250aedd

This removes the need to have scalajs-compiler.jar on the classpath while compiling the compiler interface (both precompiled and compiled on the fly). It is now only necessary to have it on the classpath when running the compiler.

It also takes a step towards configuring the name of the trait to be mixed in.

Set up the classpath in the compiler interface itself

is to have the compiler interface set up the appropriate classpath itself when creating its toolbox.

The main advantage here is to restore AnalyzingCompiler to its initial code.

Configure the trait name and jar path from build.sbt

With the previous commit, there were 2 vals, dynamicCompilerTrait and dynamicCompilerJar, which represent the two configuration options I would like to have. The following commit reads these from the command line of scalac, i.e., the scalacOptions setting.
https://github.com/sjrd/sbt/commit/22798a354844c1cb96a10c49538edf5a3ffc8d04

With this, the code is now independent of my particular machine (at last). Moreover, the same codebase can be used not only for Scala.js, but for any other tool with the same design!
So now my 2 features are implemented.

Restore the good property of compiler interface to be compilable with 2.8 and 2.9

From commit 1, I have broken compilation of the compiler interface with Scala < 2.10, which is very unfortunate. The last commit of my solution makes it compilable again with Scala 2.8 and 2.9.
https://github.com/sjrd/sbt/commit/cd84e9953e752b9c1c72d14aaab2db89ce05290a

It does not make it work with Scala < 2.10; it just makes it compile. So a requirement to use the two big features is to use Scala 2.10+.

The main trick is to provide a dummy replacement for the Scala reflection API within the file. Careful abuse of import resolution order and precedence is used to have Scala 2.10 use the genuine reflection API, and Scala < 2.10 to refer to the dummies.

End result and conclusion

So, I end up with this diff from sbt 0.13, which only modifies the compiler interface, in the end.
https://github.com/sjrd/sbt/compare/0.13...private;0.13-scalajs-hack

With that fork, I can use the following build.sbt file to build a Scala.js project:

name := "test-sbt-scalajs"

version := "0.1-SNAPSHOT"

scalaVersion := "2.10.1"

scalacOptions ++= Seq(
    "-Dsbt.compile.interface.dynamiccompilertrait=scala.tools.nsc.scalajs.JSGlobal",
    "-Dsbt.compile.interface.dynamiccompilerjar=/home/doeraene/.ivy2/local/ch.epfl.lamp/scala.js-compiler_2.10/0.1-SNAPSHOT/jars/scala.js-compiler_2.10.jar"
)

unmanagedJars in Compile += file("/home/doeraene/scalajs-library.jar")


There are still hard-coded paths in here, but that's another story, which I believe can be fixed just by tweaking the build.sbt file.

Asking for feedback

What are your feelings about this?
Do you agree with me that the 2 features are indeed the best "high-level requirement" to support Scala.js (and other tools with a similar architecture)?
What do you think about the way I implemented these two features? Would there be a better solution?

Thank you for reading until here!

Cheers,
Sébastien

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Bruno Bieth | 16 May 2013 11:02
Picon
Gravatar

Semantic of "libraryDependencies in Test"

I'm a bit puzzled by the way dependencies are scoped in SBT. 

It seems that the dependency configuration/scope is a Maven/Ivy artefact which has been imported in SBT as it was. Unfortunately the concept of "dependency configuration" interfere (badly) with SBT concept of "configuration scope axis".

Why don't we declare dependencies in SBT through scopes?

val libTest = "x" % "y" % "z"
libraryDependencies in Test += libTest

instead of the contrived

val libTest = "x" % "y" % "z" % "test"
libraryDependencies := Seq( libTest1 )  


Worse, if i have 2 modules with one needing a lib with configuration compile and the other with configuration test I end up doing:

val libA        = "x" % "y" % "z"
val libATest = "x" % "y" % "z" % "test"

or

val libATest = libA.copy(configurations = Some("test"))


Bruno

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
eugene yokota | 16 May 2013 09:26
Picon
Gravatar

sbt-unidoc

Hi guys,


I wrote a new plugin called sbt-unidoc.

The original implementation of `unidoc` command was written by [ <at> pvlugter](https://github.com/pvlugter) for Akka's build definition.
I turned it into a plugin, and refactored it some more.

The basic use case of sbt-unidoc is to unify Scaladoc generation across all projects in a build. This is useful for builds that modularizes its parts into subprojects like Akka. After setting it up, you just run `unidoc` task from the root project.

Another interesting use case is to unify Javadoc generation, except plain Javadoc won't know your Scala code. So they wrote [a compiler plugin](https://github.com/typesafehub/genjavadoc) that generates Scala-equivalent Java code, so you can generate Javadoc. See [sbt-unidoc](https://github.com/sbt/sbt-unidoc) for the details.

-eugene

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gmane