feat(fls): read and write a project's own applications as their beans
A project's own applications (classes under projekt/anwendungen, installed on a host) are no longer left out. The decoder now keeps the Java type of every primitive — at setters, constructor and call arguments, also through shared ids like Integer0 — and which properties an object's own getter made. beanCapture.ts turns a decoded bean back into what the writer writes, with the node's system software as a mark the writer replaces by the system software it writes; what the format cannot say is refused, not guessed (an unresolved value, a Field, a factory-made object, an object a getter reaches elsewhere in the file). The reader keeps own applications as captured beans; the corpus no longer warns. The capture first took a setter with another object's getter result for an own getter; the round-trip test found it. The Java oracle did not show whether an application runs on its node's system software, so a mutation writing the mark instead survived; it now reports onItsSystem (true for all 192 applications of the corpus). Checked by Java: from the files written again, FILIUS loads Accumulator and Broadcast installed, switched on and on their node's system software, as in the original. The round-trip test covers every primitive, null, a class, an array, shared objects, getter chains, constructed elements, map reads and static constants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,8 @@
|
||||
// the web server, the peer-to-peer application and the e-mail server make
|
||||
// their directories only where the files lack them, and the DNS server reads
|
||||
// /dns/hosts when it is installed. Each is put under its key and given the
|
||||
// system software, as installApp does.
|
||||
// system software, as installApp does. A project's own application is
|
||||
// written as the file had it (beanCapture.ts).
|
||||
//
|
||||
// E-mail: the server's domain and bean accounts with their mailboxes, the
|
||||
// client's three folders and address book. The client's account is no bean
|
||||
@@ -33,6 +34,7 @@
|
||||
// FILIUS to the same topology and system software (topologyWriter.test.ts,
|
||||
// tools/java-oracle).
|
||||
|
||||
import { withSystemSoftware } from './beanCapture.js';
|
||||
import {
|
||||
encodeJavaBeans,
|
||||
int,
|
||||
@@ -165,7 +167,8 @@ function device(node: NodeToWrite, ports: BeanValue[]): BeanObject {
|
||||
);
|
||||
}
|
||||
// Named for the applications, which are given it.
|
||||
const system = (node.system.applications?.length ?? 0) > 0 ? reference('SystemSoftware') : undefined;
|
||||
const applicationCount = (node.system.applications?.length ?? 0) + (node.system.ownApplications?.length ?? 0);
|
||||
const system = applicationCount > 0 ? reference('SystemSoftware') : undefined;
|
||||
const systemStatementList = systemStatements(node.system, node.javaClass, system);
|
||||
statements.push(
|
||||
system === undefined
|
||||
@@ -198,13 +201,20 @@ function systemStatements(system: SystemToWrite, javaClass: FlsNodeClass, self:
|
||||
});
|
||||
}
|
||||
if (system.fileSystem !== undefined) statements.push(fileSystemStatement(system.fileSystem, system.templateFiles !== false));
|
||||
if (self !== undefined && system.applications !== undefined) {
|
||||
if (self !== undefined) {
|
||||
statements.push({
|
||||
get: 'installierteAnwendungen',
|
||||
statements: system.applications.map((application) => ({
|
||||
call: 'put',
|
||||
args: [application.key, object(application.javaClass, applicationStatements(application, self))],
|
||||
})),
|
||||
statements: [
|
||||
...(system.applications ?? []).map((application): BeanStatement => ({
|
||||
call: 'put',
|
||||
args: [application.key, object(application.javaClass, applicationStatements(application, self))],
|
||||
})),
|
||||
// A project's own: its bean as the file had it, on this node's system software.
|
||||
...(system.ownApplications ?? []).map((application): BeanStatement => ({
|
||||
call: 'put',
|
||||
args: [application.key, withSystemSoftware(application.bean, self)],
|
||||
})),
|
||||
],
|
||||
});
|
||||
}
|
||||
if (system.dhcpServer !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user