Is there a flag for the Lime command to just compile code without updating assets first?
We’ve been working on a large project and our build times have been creeping up and up to productivity killing levels - particularly on Flash builds. This seems to be down to the number of assets we’ve got (a lot) which are embedded into the assets.swf every time we build.
To test my theory, I copied the Haxe command and arguments executed by the Lime tool (by running Lime with -v) and ran them in isolation which immediately ~halved our build time. So it would be a huge boon for us to be able to do this directly from the command line. For now we’ve just copied the command into a build script, but this is a very fragile solution for obvious reasons.
Alternatively, is there a dry run type flag that from which I could redirect output and process to just grab the compiler command?
Can you tell where the majority of time is spent? Is it in converting SVG assets, is it in embedding assets into the separate “assets.swf”, or somewhere else?
It would be nice if we could cache the asset SWF generation, though we would need to make sure that every asset is included and up-to-date, or it could be more dangerous than helpful. This becomes more complicated when you include things like the SWF library, which spontaneously generates new assets, which are never written to disk, so we can’t check a file date to know if it’s new or not.
In flash builds all our assets are either png, mp3 or json (they’re generated on a per-platform basis by our own asset pipeline beforehand) and are getting embedded into the assets.swf, so looks to me to be that the time is being spent just dealing with the sheer bulk of them. As things stand this step of the process is taking about 8-9 seconds (of a ~20 second build time) and that’s just going to get worse as we fill out content.
Having written some file system monitoring stuff for the aforementioned asset pipeline, I agree that it might be asking for trouble to try and cache the assets.swf hence my thinking that the ideal solution would be to just be able to optionally just compile via the lime command and skip the other steps.
Another option might be to support preloading from disk on the Flash target. Currently, when you use
<assets path="" embed="false" /> it will copy the file instead of embedding, but you need to
Assets.loadBitmapData (etc) instead of “get” in order to access them. Perhaps we should have an option that does not embed the files into the SWF, but does preload, either when you use -debug or as some optional flag, hmm