Apply phase of the migration entry: rewrites legacy 5.x references in .tres/.tscn files to their canonical 6.x equivalents. Textual, deterministic, fail-closed, idempotent. Contract:
- Refuses to write anything when the discovery report has blocking findings (unsupported/unmapped shapes).
- Backs up every file it modifies (.gp5x-backup) before writing.
- Stamps converted .tres resources with metadata/gp_migrated_to_6x.
- Writes _gp_migration_report.json at the project root (audit trail).
- A second run finds no legacy shapes and changes nothing. v1 scope: script/asset path + UID rewrites, script_class renames, metadata/_custom_type_script UID rewrites, field renames on converted resources, typed-null bool repair, and the structural spend-rule transform (ResourceStack subresources → costs dictionary, with material ids resolved textually per BuildCost._id_for_resource precedence: id → display_name → resource_name → path basename). Unresolvable material ids fail closed per-file.
Source: addons/grid_placement/migration/project_migration_applier.gd
Syntax
class ProjectMigrationApplier extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
BACKUP_SUFFIX | Field | |
REPORT_NAME | Field | |
MIGRATION_MARKER | Field | |
ok | Property | Result of an apply attempt. |
files_changed | Property | |
backups_created | Property | |
report_path | Property | |
message | Property | |
apply | Method |