feat(fls): keep a .fls's own applications through the editor model
The archive's entries besides the configuration — the project's own Java applications under projekt/anwendungen (.java, .class, EigeneAnwendungen.txt) — now go through the editor model: openProjectArchive reads a whole .fls into the model and keeps them in its archiveEntries, saveProjectArchive writes a whole .fls from the model with them unchanged. They cannot run here, but must not be lost. Checked on every corpus file: each entry comes back byte for byte (7 files carry applications of their own); a probe that drops them is caught. Installing such applications on a host is the next step; Java loads those only through its full loading path, which the oracle is to use first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,9 @@ import {
|
||||
exportProject,
|
||||
importProject,
|
||||
javaBase64,
|
||||
openProjectArchive,
|
||||
readFlsArchive,
|
||||
saveProjectArchive,
|
||||
readTopology,
|
||||
writeFlsArchive,
|
||||
type FlsFileTree,
|
||||
@@ -324,10 +326,13 @@ describe('the editor model exported, as Java loads it', () => {
|
||||
for (const file of flsFiles(corpusRoot)) {
|
||||
const name = relative(corpusRoot, file);
|
||||
it(name, () => {
|
||||
const topology = readTopology(decodeJavaBeans(readFlsArchive(new Uint8Array(readFileSync(file))).configurationXml));
|
||||
const project = importProject(topology, counter());
|
||||
const bytes = new Uint8Array(readFileSync(file));
|
||||
const topology = readTopology(decodeJavaBeans(readFlsArchive(bytes).configurationXml));
|
||||
const project = openProjectArchive(bytes, counter());
|
||||
const { topology: toWrite } = exportProject(project);
|
||||
const archive = writeFlsArchive(new TextEncoder().encode(writeTopologyXml(toWrite)));
|
||||
const { archive } = saveProjectArchive(project);
|
||||
// The project's own applications, and every other entry, byte for byte.
|
||||
expect(readFlsArchive(archive).supplementalEntries).toEqual(readFlsArchive(bytes).supplementalEntries);
|
||||
if (process.env.UPDATE_EXPORTED === '1') {
|
||||
mkdirSync(dirname(join(exportedRoot, name)), { recursive: true });
|
||||
writeFileSync(join(exportedRoot, name), archive);
|
||||
|
||||
Reference in New Issue
Block a user