Building .bundle at runtime

Sure, this would certainly be possible!

The *.bundle formats includes “library.json” inside, which can be generated outside the OpenFL tools.

If you are using OpenFL for your editor, you can import some of our classes to make this more automatic.

import lime.utils.AssetManifest;
import lime.utils.AssetType;
import sys.io.File;

...

var manifest = new AssetManifest ();
//manifest.libraryType = "your.custom.AssetLibraryClass";
//manifest.libraryArgs = [];

manifest.assets.push ({
   id: "image.png",
   size: 1024,
   type: AssetType.IMAGE,
   path: "path/to/image.png"
});

File.saveContent ("path/to/library.bundle/library.json", manifest.serialize ());