All projects generated with new_proj come with a script/console under
your project's directory. If you used the archetypes to create your
project, you won't have this. DavidB is making something slicker using
Maven that the archetypes will use.
If you don't have these files, but have lift checked out of SVN, make
a script directory and copy liftweb/script/console and
liftweb/script/liftrepl.scala. Here are pointers to them in googlecode
in case you don't have lift checked out of SVN:
http://liftweb.googlecode.com/svn/trunk/liftweb/script/
Then in your project's base directory, run script/console
One warning: if you are using Derby, only one process can have Derby
running at a time. So either mvn jetty:run or script/console can be
running at one time. It won't harm your database if try to use both at
the same time, it'll simply fail.
Let me know if you have any issues with it.
Best,
Steve
WARNING: the maven-scala-plugin will have some difference with the current scrip (Steve points)
* it only add into classpath jar (and its dependencies) declared into the pom, not the wall local maven repository (include all version of the same artifact - unstable)
* it won't need to install scala (required jar download automaticaly by maven)
Regards
/davidB
Currently console is usefull to explore/try syntax because they is no incremental compilation into IDE/editor.
my 2cents
/davidB
I forgot, IMHO in some/lot of cases, it's better to write test case or main classes (under src/test/scala) than using "console" mode:
* you could keep your dry (but not include them into the running test group, by creating main class, set a member of a package "sandbox" and exclude it when you search/run "official test", only for
manual run from IDE,...), it's a memory of your work without polute the main code
* it's easier to edit the code under ide, click "run" and re-edit/fix than using console.
Currently console is usefull to explore/try syntax because they is no incremental compilation into IDE/editor.
my 2cents
/davidB
Collaborative Task Management http://much4.us
Nice idea, but it'll be not part of the next release (too many things I want to do this week ;) )
But for after 2.2 (may be) I'll add it to my todo list. (add an issue into code.google (liftweb project) to avoid memory failure)
/davidB
> <mailto: dwa...@free.fr>> wrote:Nice idea, but it'll be not part of the next release (too many things I want to do this week ;) )
>
>
> I forgot, IMHO in some/lot of cases, it's better to write test case
> or main classes (under src/test/scala) than using "console" mode:
> * you could keep your dry (but not include them into the running
> test group, by creating main class, set a member of a package
> "sandbox" and exclude it when you search/run "official test", only for
> manual run from IDE,...), it's a memory of your work without polute
> the main code
> * it's easier to edit the code under ide, click "run" and
> re-edit/fix than using console.
>
> Currently console is usefull to explore/try syntax because they is
> no incremental compilation into IDE/editor.
>
>
> It's be interesting to optionally integrate the console with JavaRebel
> so that changes to the projects source would be immediately picked up.
But for after 2.2 (may be) I'll add it to my todo list. (add an issue into code.google (liftweb project) to avoid memory failure)
If using javaRebel is only to modify jvmargs, it should be possible with maven-scala-plugin-2.2 through configuration.
(Somethings that accelerate things: could you send me a sample call to java/scala + javarebel)
I didn't installed JavaRebel, and I wan't to learn/explore other things before.
/davidB
David Pollak wrote:
>
>
> On Dec 10, 2007 5:03 AM, David Bernard <dwa...@free.fr
> <mailto:dwa...@free.fr>> wrote:
>
>
> David Pollak wrote:
> >
> >
> > On Dec 10, 2007 12:30 AM, David Bernard <dwa...@free.fr
> <mailto:dwa...@free.fr>
> > <mailto:oscarp...@gmail.com
Before releasing the maven-scala-plugin with the new "console" goal. could you check if it matches your need ?
mini-guide :
* force the version of the plugin to 2.2-SNAPSHOT into the pom.xml
* from the commande line :
# every thing should be compiled
mvn test
# run the console (it doesn't require compile)
mvn scala:console
...
scala> new bootstrap.liftweb.Boot().boot
... [play/enjoy] ...
Notes :
* I added support for history and line edition and navigation. (I don't understand why scala developper require rlwrap and similar)
* The history is saved across session (file is ~/.m2/scala-console.histo)
* I've got an issue with :quit, if it doesn't work then use Ctrl-C
* If you want to try with javarebel add the option -Djavarebel.jar.path=<path_of_javarebel.jar> (and tell me if it works, not tested)
* If you don't want to wrote the line new bootstrap.liftweb.Boot().boot at the begin of the session, you could
* add into the pom.xml
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scala.version}</version>
<scope>test</scope>
</dependency>
* add the file src/test/scala/LiftConsole.scala (based on liftrepl)
import bootstrap.liftweb.Boot
import scala.tools.nsc.MainGenericRunner
object LiftConsole {
def main(args : Array[String]) {
// Instantiate your project's Boot file
val b = new Boot();
// Boot your project
b.boot;
// Now run the MainGenericRunner to get your repl
MainGenericRunner.main(args)
// After the repl exits, then exit the scala script
exit(0)
}
}
Send me your feedbacks (I'll release after).
Thanks.
That's all.