Home

Awesome

ScalaCS

The main goals of ScalaCS are :

Why name it ScalaCS ? ScalaCS is short of scala-compiler-server (but I hope to support other tool in the future (an not only compiler) like code analyzer,...)

Creative Commons License : This software is licensed under the CC-GNU LGPL version 2.1 or later. (usable in open-source and commercial product)

Installation

Copy the latest jar (scalacs-X.Y-withDeps) from :

Server startup

java -jar scalacs-0.2-withDeps_sc2.7.7.jar

Or use scalacs-0.2.jar + dependencies (listed into pom.xml) from the maven central repository.

HTTP Interface

Some basic client samples are provided

But best is to call http directly from the editor/IDE you used.

output format

The output of command that return with HTTP status OK (200) should follow the format readable with regexp :

^-(INFO|WARN|ERROR)\t([^\t]*)\t([^\t]*)\t(.*)$

You could see the method parse of BasicHttpScalacsClient.java as sample.

help, usage

HTTP GET to : http://127.0.0.1:27616/

Note : multi line message use the character § in place of \n so editor could grab the full message in on-line (regexp)

createOrUpdate

Request to createOrUpdate one or more project define in the Yaml syntax, each project definition should be separated by "---" Project definition should by send as content of

HTTP POST to : http://127.0.0.1:27616/createOrUpdate

Fields :

Sample :

<pre><code> name : sample sourceDirs : - "/home/dwayne/work/oss/scalacs/src/main/scala" includes : - "*.scala" excludes : targetDir : "/home/dwayne/work/oss/scalacs/target/classes" classpath : - "/home/dwayne/.m2/repository/org/scala-lang/scala-library/2.7.5/scala-library-2.7.5.jar" - "/home/dwayne/.m2/repository/org/scala-lang/scala-compiler/2.7.5/scala-compiler-2.7.5.jar" - "/home/dwayne/.m2/repository/org/jboss/netty/netty/3.1.0.GA/netty-3.1.0.GA.jar" - "/home/dwayne/.m2/repository/SnakeYAML/SnakeYAML/1.3/SnakeYAML-1.3.jar" exported : "" args : - "-deprecation" </code></pre>

list-names

List names of registered projects

HTTP GET to : http://127.0.0.1:27616/list-names

compile

Request to compile modified projects.

HTTP GET to : http://127.0.0.1:27616/compile

Request to compile a set of modified projects (with name match pattern)

HTTP GET to : http://127.0.0.1:27616/compile?p=pattern

cleanCompiler

Request to clean compiler (cache).

HTTP GET to : http://127.0.0.1:27616/cleanCompiler

remove

De-register a set of project (with name match pattern)

HTTP GET to : http://127.0.0.1:27616/remove?p=pattern

stop

Stop the server

HTTP GET to : http://127.0.0.1:27616/stop

Notes

Use 2 separated projects for 'main' and 'test' part, where test has got main into its classpath.

TODO

Thanks

to read me to end, feedbacks are welcome !

/davidB