Skip to content

Add Export Lib To Files for library projects#28

Closed
gsokoll wants to merge 2 commits into
backport/ws2-staging-exportfrom
backport/ws4-lib-export
Closed

Add Export Lib To Files for library projects#28
gsokoll wants to merge 2 commits into
backport/ws2-staging-exportfrom
backport/ws4-lib-export

Conversation

@gsokoll

@gsokoll gsokoll commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Part of #24. Reimplemented from ipfedor/codescribe commit a90c84a.

Library projects keep their POUs, DUTs, GVLs and folders directly under the project root rather than under a Device, so the existing Export To Files (which walks device entrypoints) exports nothing for them. This adds a new script command, Export Lib To Files, that walks the project root and writes the same on-disk format without the device and application folder levels. It reuses the staging helpers from #26 and the UNKNOWN-GUID native-export fallback from #25.

Service objects are skipped by name (Library Manager, Project Information, Project Settings, Task Configuration, Symbol Configuration, Visualization Manager, Alarm Configuration, Recipe Manager). The manager objects carry GUIDs that are not in GUID_TYPE_MAPPING, so without the skip list the UNKNOWN fallback would export them as native xml noise. This list matches the fork implementation.

Importing a library export back into a project is out of scope for this PR, as it is in the fork.

Live validation required before merge

  • Open a library project, run Export Lib To Files, confirm the exported tree matches the library structure including nested folders.
  • Confirm normal device projects are unaffected and Export To Files behaves as before.

Stacked on #26, which is stacked on #25. Bases retarget automatically as those merge.

gsokoll added 2 commits June 12, 2026 15:38
Library projects keep POUs, DUTs, GVLs and folders directly under the
project root rather than under a Device, so the existing Export To Files
exports nothing for them. This adds a separate entry script that walks
the project root, skips the service manager objects, and writes the same
on-disk format without the device and application levels. Importing a
library export back is not yet supported.

Credit: reimplemented from ipfedor/codescribe commit a90c84a. Refs #24.
It is auto-created in every project, its GUID is unmapped, and native
export of it fails, so the UNKNOWN fallback printed a warning on every
run. Found during live validation on CODESYS SP11.
@gsokoll

gsokoll commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Live validation on CODESYS V3.5 SP11, automated via --runscript.

Passed

  • Created a library-style project via ScriptEngine (POU, DUT, GVL and folders directly under the project root, nested two levels). Export Lib To Files produced exactly the right tree: LibFB.st, LibStruct.st, LibGVL.gvl.xml/.gvl.st, Utils/UtilFB.st, Utils/Deep/DeepStruct.st. Project Settings correctly skipped.
  • Found during validation: __VisualizationStyle is auto-created in every project, its GUID is unmapped, and native export of it fails, so the UNKNOWN fallback warned on every run. Added to SKIP_NAMES in 080f8e6; re-test clean.

@gsokoll gsokoll deleted the branch backport/ws2-staging-export June 12, 2026 07:33
@gsokoll gsokoll closed this Jun 12, 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