Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ifcx-cli/ifcx-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async function processArgs(args: string[])
new InMemoryLayerProvider().AddAll([userDefinedOrder, ...files]),
...providers
]);
let layerStack = await (new IfcxLayerStackBuilder(provider).FromId(userDefinedOrder.header.id)).Build();
let layerStack = await (new IfcxLayerStackBuilder(provider).FromId(userDefinedOrder.header.id)).Build(validate);
if (layerStack instanceof Error)
{
throw layerStack;
Expand Down
10 changes: 6 additions & 4 deletions src/ifcx-core/layers/layer-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ export class IfcxLayerStack
private tree: PostCompositionNode;
private schemas: {[key:string]:IfcxSchema};
private federated: IfcxFile;
private checkSchemas: boolean;

constructor(layers: IfcxFile[])
constructor(layers: IfcxFile[], checkSchemas: boolean = true)
{
this.layers = layers;
this.checkSchemas = checkSchemas;
this.Compose();
}

Expand All @@ -28,7 +30,7 @@ export class IfcxLayerStack
this.federated = Federate(this.layers);
// TODO: schema files
this.schemas = this.federated.schemas;
this.tree = LoadIfcxFile(this.federated);
this.tree = LoadIfcxFile(this.federated, this.checkSchemas);
}

public GetFullTree()
Expand Down Expand Up @@ -64,7 +66,7 @@ export class IfcxLayerStackBuilder
return this;
}

async Build(): Promise<IfcxLayerStack | Error>
async Build(checkSchemas: boolean = true): Promise<IfcxLayerStack | Error>
{
if (!this.mainLayerId) throw new Error(`no main layer ID specified`);

Expand All @@ -77,7 +79,7 @@ export class IfcxLayerStackBuilder

try
{
return new IfcxLayerStack(layers);
return new IfcxLayerStack(layers, checkSchemas);
}
catch (e)
{
Expand Down