Compile to a library

Is it possible to compile several classes down to an .ndll file or something that I can use in multiple projects. and for several targets?

I want a single, portable file that can essentially be used as a haxelib.

Similar to how I can produce a .swc file and use it in several AIR projects, I would like the same for OpenFL.

Ideally I can just include the library in a project and extend classes that are compiled into the library.

Help is appreciated… thanks!

The problem is that ndll files only work on specific targets. If you compiled the ndll for Windows, you could only use it in projects that target Windows.

Alternate solution: put your library in a zip file, copy it to each computer you want to try, and then run haxelib local mylibrary.zip to install it as a haxelib. Don’t worry, this doesn’t upload the library for the public to see.

Note that this requires a basic haxelib.json file:

{
    "name":"my-library",
    "description":"Inverse's library.",
    "version":"0.0.1",
    "contributors":["inverse"]
}

Why the need to be compiled?

Because what you describe are source files, they can be included in a project, can be extended and be used for any project and targets.

If you don’t need all targets, the java and c# targets are capable of using jar/dll for this purpose, and should be able to make the jar/dll.

If you just want to share files between projects then the solution of @player_03 is good,
if you use git you can also use submodules for this.

I have an internal SDK (that we plan on releasing in the future) for JavaScript and ActionScript, where I can either: combine all the JS into one lib file, or compile all the AS into one lib file. I am merely trying to keep the Haxe/OpenFL framework similar to the other two.

I understand that it’s not completely necessary. Eventually, uploading it as a public facing haxelib and running the install command will be fine.

@player_03 that sounds like a very good solution. I will go with that for the time being if there isn’t another way. Thank you so much! I’ll be back when I’m deeper in it.

Also, are you the same player_03 from the albinoblacksheep forums way back when? I remember you (if it’s you) made the game “Run” for a game contest I was participating in on those forums.