public void Build(Func <ProjectDOM.Project, PathString, Factory.Collection> evalPlugins, SDK.IMonitorContext monitor, PathString buildTarget) { _CancelRequested = false; var state = new Evaluation.PipelineClientState.Manager(); var prjFilePath = _SrcPrj; prjFilePath = prjFilePath.AsAbsolute(); var dstDirPath = buildTarget.AsAbsolute(); // load project var document = ProjectDOM.LoadProjectFrom(prjFilePath); // load plugins var prjDir = prjFilePath.DirectoryPath; var plugins = evalPlugins(document, prjDir); // create build context var buildSettings = Evaluation.BuildContext.Create(_Configuration, prjDir, dstDirPath, _TargetTask == "SIMULATE"); // do build ProjectDOM.BuildProject(document, buildSettings, plugins.CreateInstance, monitor, state); if (!IsSimulation) { CommitBuildResults(_TmpDir, _OutDir); } }
public void DocumentFileLoadCheck() { Assert.IsNotNull(ProjectDOM.ParseProject(string.Empty), "Empty files must be enterpreted as new documents."); var currentDocumentBody = "<Project xmlns=\"http://www.uberfactory.com\" Version=\"" + ProjectDOM.CurrentVersion + "\" > <Properties /> </Project>"; var futureDocumentBody = "<Project xmlns=\"http://www.uberfactory.com\" Version=\"999.0\"> <Properties /> </Project>"; Assert.IsNotNull(ProjectDOM.ParseProject(currentDocumentBody)); Assert.ThrowsException <System.IO.FileLoadException> (() => ProjectDOM.ParseProject(futureDocumentBody)); }