I’m working on a project with a ton of swf assets, and at the moment a fresh compile crunches through re-processing all of these every time, when actually 99% of my compilations are just code changes.
Is there a way to tell the compiler to not do this and just compile the code? I assumed there’d be a flag or command or something but I can’t find much.
Assets will be copied if the modified time is newer than the output folder (or it does not exist in the output folder)
SWF libraries will be processed if there is no cache present (from a previous build) or the modified time of the SWF tools is newer than the cache
What target are you using? You could consider trying openfl test html5 -npm to use the NPM hot-reload functionality to recompile automatically when the code changes (and not perform asset copies/processing at all)
So, on further inspection I think I have something more strange going on. I’ve noticed that during compilation I’m getting tons of duplicate assets in my build. My current project has around 20 images in it, but in the final preload when I test with -verbose I can see it preloading over 300. If I look at the files many of these are duplicates, for example I have a background image that’s instantiated only once in the code, but is included tons of times in the final assets with lots of different names.
Interestingly on my other mac this doesn’t appear to be the case, or on my Windows box, it’s just this machine that’s doing it. I’m using the latest versions of everything (I did an update last night just to make sure).
I’m not seeing the “default behavior” you describe.
Compiling my project for html5 takes anywhere from 10 to 15 minutes. If I do a second compile right after the first, with no changes to source or assets, it still takes the same amount of time, performing a “Processing Library” on all the swf files again.
Is it possible a cache of the swf isn’t being maintained or could my project.xml file be mis-formed?
A sample of a library path line in the project.xml <library path="../src/com/shared/Chat/Chat_artAOS.swf" id="Chat_artAOS.swf"/>
After further research and lots of code reading I’ve come to the conclusion that the swf cache files ARE most probably being used. The issue is that OpenFL Tools.processLibraries() is using the same Log.info() text when processing the original swf as when it’s processing the cache file.
My recommendation is that the Log.info() in the cache processing if/else case report that the cache is being used.
So now I will continue to research why my re-builds take the same time to complete as a clean build.