Compile without re-processing assets?

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.

Thanks! :slight_smile:

1 Like

Here’s the default behavior:

  1. Assets will be copied if the modified time is newer than the output folder (or it does not exist in the output folder)
  2. 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).

Any idea what could be causing this?

Is it possible you have overlapping <assets /> tags?

For example the following will pull in assets twice:

<assets path="Assets" />
<assets path="Assets/bitmaps" type="image" />

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"/>

I’m on Mac OS Catalina
actuate: [1.8.9]
away3d: [5.0.9]
box2d: [1.2.3]
haxe-gif: [0.3.3]
hxcpp: [4.0.64]
layout: [1.2.1]
lime-samples: [7.0.0]
lime: 7.6.3 [7.7.0]
npm: [0.4.0]
openfl-samples: [8.7.0]
openfl: 8.9.1 8.9.2 8.9.3 8.9.5 [8.9.6]
uglifyjs: [1.0.0]

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.

Thanks for participating in my goose hunt. :slight_smile: