Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 97 lines (60 sloc) 2.871 kb
ddf0504b »
2012-02-06 Initial commit of binary build for haxe-cs. Missing WIN binaries (sor…
1 Haxe with C# target - Binary Release
2
3 ---------------------
4
5 This is a binary repo of the Haxe C# target for both OSX and Windows.
6
7 The haxe install:
8
9 cslibs - A set of CS libs exported with the "cslibgen.exe" tool.
10 haxe-osx - Haxe install dir for OSX.
11 haxe-win - Haxe install dir for Windows.
12
13 Run "haxe --help" to see a description of the additional C# target
14 command line options.
15
16 NOTE: This is "ALPHA" software, meaning that it still contains many bugs
17 and will probably not work correctly for you.
18
19 To report bugs, please post them to benjcooley.github.com on for the
20 appropriate project.
21
22 Ben Cooley
23
24 ---------------------
25
26 Haxe C# library bindings generator:
27
28 The haxe binary release comes with a utility for generating Haxe class libraries
29 from C# assemblies.
30
31 OSX/Linux:
32
33 mono cslibgen.exe <paramters>
34
35 Windows:
36
37 cslibgen.exe <parameters>
38
39 Description:
40
41 Generates Haxe bindings for C# assemblies
42 Usage: cslibgen -o <outputdir> -i <inputdir> <assembly> [<assembly> ..]
43
44 Options:
45
46 -o The output folder into which the bindings will be placed.
47 -i An input directory from which to load assemblies.
48
49 The -i option can be specified multiple times to provide multiple input
50 search directories to check for each assembly dll in your assembly list.
51
52 It is important to include all assembly dependencies for a given platform
53 when running the "cslibgen" tool, as the class name resolver must have access to all
54 class definitions in a given set of assemblies to correctly create unique
55 "haxe" class names for generic types. Typically you will list every assembly
56 you will need (and all of their dependencies) for a given project or platform
57 when running this utility.
58
59 After generating your haxe class files, you must add the output directory
60 to the HAXE_LIBRARY_PATH environment variable.
61
62 For example, to add "monotouch" to your libs path, add this:
63
64 HAXE_LIBRARY_PATH=/usr/libs/haxe/std:/haxemono/monotouch:./
65
66 At this point, you should be able to just reference the C# classes as you
67 would any other haxe external class:
68
69 For example:
70
71 import system.Console;
72
73 class Main {
74
75 public function main() : Void {
76 Console.WriteLine("Hello World!");
77 }
78 }
79
80 Some conversion details:
81
82 Overloaded methods are exported using haxe's @:overload() keyword.
83
84 C# gives unique names to generic and non generic types with the same name,
85 the converter will detect non-unique type names and assign these types a suffix
86 number for haxe to make them unique (some examples: Tuple1<> Tuple2<>, or
87 IComparable, IComparable1<>, etc.)
88
89 C# native arrays are specified as NativeArray<T>.
90
91 C# native events are specified as NativeEvent<T>.
92
93 C# 32 bit floats are specified as "Single" (handled as a 32 bit float in
94 the C# haxe target the same way that UInt is handled in the flash9 target).
95
96 Parameterized methods are presently converted to use "Dynamic" parameters.
Something went wrong with that request. Please try again.