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

15 views
Skip to first unread message

Josh Suereth

unread,
May 21, 2013, 4:40:53 PM5/21/13
to simple-b...@googlegroups.com
When testing the typesafe-activator project, we actually just fork new applications to test the launcher (using new sbt.boot.directory).   I'd actually recommend going that approach, as it'll be more robust for you in the long term.

If you reboot (via the launcher) into another application, you'd need to have that application reboot back into SBT which means it would have to reload and fill new classloaders with classfiles.  Not really a great user experience.  Forking is probably safer, faster and easier to work with.


On Tue, May 21, 2013 at 3:23 AM, Radzislaw Galler <gradz...@gmail.com> wrote:

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-t...@googlegroups.com.
To post to this group, send email to simple-b...@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.
 
 

Reply all
Reply to author
Forward
0 new messages