Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created May 2, 2014 13:31
Show Gist options
  • Select an option

  • Save pedrofurla/8213d4242f9d1c0d387c to your computer and use it in GitHub Desktop.

Select an option

Save pedrofurla/8213d4242f9d1c0d387c to your computer and use it in GitHub Desktop.
My SBT last night struggle
// The problem, I believe, was doing `inConfig(hconfig)(Defaults.defaultSettings + other settings) `, therefore kill the project
// setup in the hconfig. Btw, h stands for hibernate (ergh) config. I wanted a shell where it'd be easy to play with hibernate
project.in(file(".")).
configs(hconfig).
settings(inConfig(hconfig)(Defaults.configTasks) : _*)
.settings(
fork.in(hconfig,console) := true,
initialCommands in hconfig :=
"""
|import exec._
|import exec.TestHelper._
|import support.JpaInstances.HibernateJpa
|import scalaz._
|import Scalaz._
|
|import collection.JavaConversions._
|
|import jpaperf._
|import jpaperf.Entities._
|
|val slick = support.SlickInstances.SlickMySql
|slick.createSchema
|
|val jpa = HibernateJpa
|val em = jpa.defaultEm
|val ic = new JpaInsertCompany(jpa)
|ic.run(Nel(10))
""".stripMargin,
cleanupCommands in hconfig :=
"""
|jpa.emFactory.close()
|slick.destroySchema
""".stripMargin
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment