Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 62 lines (35 sloc) 1.807 kb
3f63392 @timowest Update README.md
timowest authored
1 ## Scalagen
2
3 **Java to Scala conversion**
33f083c @timowest Update README.md
timowest authored
4
67432d3 @timowest Update README.md
timowest authored
5 Scalagen is a Java to Scala conversion tool. It uses a Java based parser for Java sources and provides modular
a1a8e38 @timowest Update README.md
timowest authored
6 transformation of the AST to match Scala idioms. The resulting transformed AST is serialized into Scala format.
7
8 Here is a list of example Java sources which have been successfully converted by Scalagen:
9 https://github.com/mysema/scalagen/tree/master/scalagen/src/test/scala/com/mysema/examples
10
11 Scalagen has also been tested on our own projects such as Querydsl, RDFBean, Codegen and some customer projects.
6d48a07 @timowest Update README.md
timowest authored
12
3f63392 @timowest Update README.md
timowest authored
13 ### Usage
e61b97c @timowest Update README.md
timowest authored
14
67432d3 @timowest Update README.md
timowest authored
15 Scalagen provides direct Maven support via a plugin. You can use it directly via the command line like this
6d48a07 @timowest Update README.md
timowest authored
16
aba9981 @timowest Bump version
timowest authored
17 mvn com.mysema.scalagen:scalagen-maven-plugin:0.2.2:main -DtargetFolder=target/scala
6d48a07 @timowest Update README.md
timowest authored
18
19 and for test sources
20
aba9981 @timowest Bump version
timowest authored
21 mvn com.mysema.scalagen:scalagen-maven-plugin:0.2.2:test -DtargetFolder=target/scala
6d48a07 @timowest Update README.md
timowest authored
22
23 Here is the snippet for an explicit configuration in a POM:
33f083c @timowest Update README.md
timowest authored
24
25 <plugin>
26 <groupId>com.mysema.scalagen</groupId>
27 <artifactId>scalagen-maven-plugin</artifactId>
aba9981 @timowest Bump version
timowest authored
28 <version>0.2.2</version>
33f083c @timowest Update README.md
timowest authored
29 </plugin>
30
31 To convert main sources run
32
3b4d430 @timowest updated notes for release 0.1.1
timowest authored
33 mvn scalagen:main
33f083c @timowest Update README.md
timowest authored
34
35 and to convert test sources run
36
3b4d430 @timowest updated notes for release 0.1.1
timowest authored
37 mvn scalagen:test
fe2d25d @timowest Update README.md
timowest authored
38
39 The conversion results are to be seen as a starting point for the Java to Scala conversion.
40 Some elements are not transformed correctly for various reasons and will need manual intervention.
c8cf134 @timowest Add development instructions
timowest authored
41
42 ### Development
43
44 Scalagen development instructions are here https://github.com/mysema/scalagen/wiki/Scalagen-development
640d431 @dnadolny Scala 2.11 support
dnadolny authored
45
46 #### Building
47
48 To create the jar run
49
50 mvn -Pscala-2.11.x clean package
51
52 To import the project in to eclipse run
53
54 mvn -Pscala-2.11.x eclipse:eclipse
55
56 The maven profiles (the part after the `-P`) can be:
57
58 * `scala-2.11.x`
59 * `scala-2.10.x`
60 * `scala-2.9.x`
61
Something went wrong with that request. Please try again.