-
Notifications
You must be signed in to change notification settings - Fork 6
/
getting_started.txt
64 lines (46 loc) · 2.45 KB
/
getting_started.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Java-Converter
--------------
The java converter consists of a single .jar file that contains everything needed
for converting java sources to all conversion targets and also includes the necessary core
library files.
It can be started to convert multiple java sources at once that may have dependencies to
other classes which need not be converted. When external dependencies exist, the .class files
need to be provided to allow resolving the types.
The converter can be used as a command-line tool (starting the executable .jar) or with Ant,
using the provided AntTask classes (com.greentube.javaconverter.ConverterAntTask,
com.greentube.javaconverter.JavaScriptLinkerAntTask).
Also see the provided examples for explicit use of the command line tools.
Workflow Javascript
-------------------
1 Convert all necessary .java files to .js.
1.1 using command line
java -jar converter.jar -classpath <dependencies> -js <outputdir> file ...
1.2 using ant
<taskdef name="convertJava" classname="com.greentube.javaconverter.ConverterAntTask"/>
<convertJava js="${basedir}/build/javascript" classpath="${basedir}/../bin">
<fileset dir="${basedir}/src">
<include name="**/*.java"/>
</fileset>
</convertJava>
2. Link all .js to a single .js program together with the included runtime libraries.
2.1 using command line
java -jar converter.jar link -output <output file> -searchpath <path> -root <rootclass1,..> [-startup javascriptcode]
2.2 using ant
<taskdef name="linkJavaScript" classname="com.greentube.javaconverter.JavaScriptLinkerAntTask"/>
<linkJavaScript
output="${basedir}/build/javascript/main.js"
searchpath="${basedir}/build/javascript"
root="com/greentube/test/Launcher"
startup="com_greentube_test_Launcher_main_1([]);"
>
</linkJavaScript>
Workflow C#
-----------
Converting the file to C# is basically identical as for javascript, but use
the -cs instead of -js to generate .js files. It is even possible to generate
both type of files in one go.
java -jar converter.jar -classpath <dependencies> -cs <outputdir> [-csruntime true] file ...
The optional -csruntime parameter will cause the compiler to copy the C# runtime libraries
into the destination directory along with the generated C# code.
The generated .cs - files then need to be compiled into a .net assembly with
some compiler of your choice.