Add Custom sbt Task (0.10+)

Simple Call Shell command in build.sbt:

TaskKey[Unit]("echo-simple") := {
List("sh", "-c", "(cd src/main/; echo \"YOUPI\")") ! ;
}

Without Name in build.scala, can be use as dependency:

import sbt.Project.Initialize    
val shEchoTask :  Initialize[Task[Unit]] = (streams) map {
        s => {
          List("sh", "-c", "(echo \"YOUPI\"") ! ;
          s.log.info("Echo")
        }
    }

use it in Build.sbt:

compile.in(Compile) <<= compile.in(Compile) dependsOn(shEchoTask)

With Name in Build.scala, can be use as dependency:

  val shEchoTask = TaskKey[Unit]("echo-simple-task")

  val shEchoAction = (streams) map {
    s => {
     List("sh", "-c", "(echo \"YOUPI\"") ! ;
      s.log.info("Echo")
    }
  }

  lazy val root = Project("root", file("."),
    settings = Defaults.defaultSettings ++ Seq(
    // Link task with action
      shEchoTask in Compile <<= shEchoAction,
    // add dependency
      compile in Compile <<= compile in Compile dependsOn (shEchoTask in Compile)
    ))

partial source: http://comments.gmane.org/gmane.comp.lang.scala.simple-build-tool/1768

Implémentation de Crudify pour Lift MongoDB

Besoins d’une partie administration rapide pour votre application web Lift avec MongoDB?
Je peux au moins vous simplifier la vie avec une génération automatique des commandes CRUD List / Edit / Delete de votre modèle.

Ci-dessous en lien, une classe pour mongoDB de Crudify, elle gère que le premier niveau et les types simple, après, à vous de l’étendre.
Cette implémentation utilise la bibliothèque Rogue de FourSquare.

Classe

https://github.com/heralight/Lift-MongoDb-Crudify/blob/master/src/main/scala/code/lib/MongoCrudify.scala

Projet de test

https://github.com/heralight/Lift-MongoDb-Crudify

D’autres liens utiles sur Crudify et lift

https://github.com/timperrett/lift-in-action // Chapitre 5 pour Crudify
http://neuralmonkey.blogspot.fr/search/label/lift // crudify + lift
http://neuralmonkey.blogspot.fr/2009/08/lift-listing-entities-without-crudify.html
https://github.com/tromberg/Winglet/blob/master/src/main/scala/be/romberg/liftweb/util/MBindHelper.scala // Crudify like
http://www.assembla.com/spaces/liftweb/wiki/MapperBinder
https://github.com/oliverdaff/Lift-Shopping
http://www.assembla.com/wiki/show/liftweb/Creating_the_UI_for_Mapper_entities
https://groups.google.com/forum/?fromgroups#!topic/liftweb/r52KTSwpv2s // How to customize CRUDify HTML
https://groups.google.com/forum/?fromgroups#!searchin/liftweb/admin/liftweb/yzyMn0IKJ4Y/ViXKgFWzJ0QJ // CRUDify with SquerylRecord & one-to-many relationship

Si vous avez des suggestions…

Activer RabbitMQ sur cloud foundry standalone

But:

Activer RabbitMQ sur une installation fraiche de cloud foundry standalone

Référence:

http://financecoding.wordpress.com/2011/08/13/installing-rabbitmq-on-a-local-vcap-2/

voici une méthode simplifier.
cd ~/cloudfoundry/vcap/services/rabbit/ && bundle install && cd ~/cloudfoundry/vcap/bin && vi vcap

dans vi, rechercher en tapant /self\.serv puis entrée.

Comme dans le post joint, ajouter « rabbit » à la liste des services disponible.
ensuite
~/cloudfoundry/vcap/bin/vcap restart
ou
~/cloudfoundry/vcap/bin/vcap start rabbit

Bon tests!