Skip to content

Using haxe project libraries

devboy edited this page Apr 4, 2012 · 1 revision

To use a haxe project as a library in a another haxe project you can use the :hxlib compiler and packaging format. Which will create a descriptor file containing all the dependencies of the library project.

define "MyLibrary" do
  compile.using :hxlib
  package :hxlib
end

define "MyProject" do
  compile.using :hxswf # Or any other haXe compiler
  compile.with project("MyLibrary")
end

In the example, compile.with project("MyLibrary") will add the source directory of MyLibrary as a dependency to MyProject.

MyLibrary could also have dependencies itself, like a haxelib library or another source-directory. All dependencies will be resolved recursively and added to MyProject.

Clone this wiki locally