Debian Codegraph @

extra/haxelib_src/www/documentation-files/haxelibs-in-projects.md

raw
1 # Adding libraries to Haxe projects
2
3 When the haxelib is installed, it is ready to be used it code. This is a matter of adding `--library libraryname` (or `-L libraryname`) to the [compiler arguments](https://haxe.org/manual/compiler-usage.html).
4
5 ```
6 haxe --main Main --library libraryname --js bin/main.js
7 ```
8
9 The same parameters you pass to the compiler can be stored in a [hxml file](https://haxe.org/manual/compiler-usage-hxml.html):
10
11 ```
12 --main Main
13 --library libraryname
14 --js bin/main.js
15 ```
16 <hr/>
17
18 ## Using Haxelib in OpenFL
19
20 When using OpenFL, add `<haxelib />` tags in the project.xml to include Haxe libraries:
21
22 ```xml
23 <haxelib name="actuate" />
24 ```
25
26 To specify a version:
27
28 ```xml
29 <haxelib name="actuate" version="1.0.0" />
30 ```