Skip to content

Add cache support for Flash/AIR SWF library processing - #47

Open
barisyild wants to merge 1 commit into
openfl:masterfrom
barisyild:flash-cache-fix
Open

barisyild wants to merge 1 commit into
openfl:masterfrom
barisyild:flash-cache-fix

Conversation

@barisyild

Copy link
Copy Markdown
Contributor

The Flash/AIR branch in processLibraries was missing the cache mechanism that the Animate branch already had. This caused generateSWFClasses to re-parse the SWF from scratch on every build even when the source file and tool had not changed.

The cache stores generated class names and template asset data in a JSON file at {targetDirectory}/obj/libraries/{name}.cache, using the same mtime-based invalidation strategy as the Animate branch.

The Flash/AIR branch in processLibraries was missing the cache mechanism
that the Animate branch already had. This caused generateSWFClasses to
re-parse the SWF from scratch on every build even when the source file
and tool had not changed.

The cache stores generated class names and template asset data in a JSON
file at {targetDirectory}/obj/libraries/{name}.cache, using the same
mtime-based invalidation strategy as the Animate branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dimensionscape added a commit that referenced this pull request Oct 27, 2026
…nimate classes when generate="true" (closes #47)


Both library branches now share one cache, obj/libraries/<name>.classes.json,
holding the prefix, the classes to compile and the generated templates. The
templates are added again on a cache hit, because Lime deletes generated
files that are no longer project assets.

With generate="true", Animate libraries now compile their generated classes,
so symbols are created as their linkage class even when nothing else
references it. Classes that depend on ActionScript classes from outside the
library, such as fl.controls.* components, are left out, since they would
not compile.
dimensionscape added a commit that referenced this pull request Oct 27, 2026
…nimate classes when generate="true" (closes #47)

Both library branches now share one cache, obj/libraries/<name>.classes.json,
holding the prefix, the classes to compile and the generated templates. The
templates are added again on a cache hit, because Lime deletes generated
files that are no longer project assets.

With generate="true", Animate libraries now compile their generated classes,
so symbols are created as their linkage class even when nothing else
references it. Classes that depend on ActionScript classes from outside the
library, such as fl.controls.* components, are left out, since they would
not compile.
@dimensionscape dimensionscape mentioned this pull request Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant