void processModelCombined(string _modelName, string _layer = "usr", bool _dontDrop = false) { log(String.Format("======= processing model {0} =======", _modelName)); string buildconf = "build"; if (rootPath.Contains("buildagent2")) { buildconf = "build2"; } client.AXConfigurationFile = rootPath + "config\\" + buildconf + "_" + _layer + ".axc"; client.ModelManifest = rootPath + branch + "\\" + _modelName + "\\Model.xml"; XPOCombiner combiner = new XPOCombiner(); combiner.XPOFolder = rootPath + branch + "\\" + _modelName + "\\"; // client.ModelManifest; combiner.CombinedXPOFilename = binPath + _modelName + "_combined.xpo"; combiner.SystemClassesXPOFilename = binPath + _modelName + "_combinedsystem.xpo"; log("Combining xpo"); combiner.Combine(); log("Combined"); Autorun autorun = new Autorun(); log("Creating autorun XMLs"); // int tableblocks; //autorun.CreateXPOImportXML(binPath, true, binPath + _modelName + "_CombinedXPOImport.xml", false, ""); autorun.CreateVSProjectImportXML(combiner.XPOFolder + "Visual Studio Projects\\", true, binPath + _modelName + "_VSProjectAutoRun.xml", false, ""); autorun.CreateLabelFlushXML(combiner.XPOFolder + "label files\\", true, binPath + _modelName + "_LabelsFlush.xml", false, ""); log("XMLs created"); if (!_dontDrop) { log("Dropping model (to be sure)"); model.UninstallModel(combiner.XPOFolder + "Model.xml"); log("Dropped"); if (_modelName != "USRModel") { log("Creating empty model"); model.CreateModel(combiner.XPOFolder + "Model.xml"); log("Created"); } log("Setting no install mode"); model.SetNoInstallMode(); log("No install mode has been set"); } // this.restartAOS(); log("Importing xpo"); client.Command = ClientCommand.IMPORTXPO; client.NoCompileOnImport = true; client.CommandArgument = binPath + _modelName + "_combined.xpo"; client.Execute(); // client.CommandArgument = binPath + _modelName + "_combinedsystem.xpo"; // client.Execute(); log("Xpo imported"); this.restartAOS(); log("Importing xpo"); client.Command = ClientCommand.IMPORTXPO; client.CommandArgument = binPath + _modelName + "_combined.xpo"; client.Execute(); // client.CommandArgument = binPath + _modelName + "_combinedsystem.xpo"; // client.Execute(); log("Xpo imported"); this.restartAOS(); //log("Importing xpo second time"); // client.Command = ClientCommand.IMPORTXPO; //client.NoCompileOnImport = false; //client.TimeOutMinutes = 180; //client.CommandArgument = binPath + _modelName + "_combined.xpo"; // client.Execute(); //// client.CommandArgument = binPath + _modelName + "_combinedsystem.xpo"; //// client.Execute(); //log("Xpo imported"); // this.restartAOS(); client.Command = ClientCommand.AUTORUN; client.CommandArgument = binPath + _modelName + "_VSProjectAutoRun.xml"; client.Execute(); // this.restartAOS(); log(String.Format("exporting model {0} {1}", combiner.XPOFolder + "Model.xml", binPath + _modelName + ".axmodel")); model.ExportModel(combiner.XPOFolder + "Model.xml", binPath + _modelName + ".axmodel"); log(String.Format("======= model {0} processed =======", _modelName)); }
void importXpo(string _modelName, string _layer = "usr") { log(String.Format("======= processing model {0} =======", _modelName)); client.AXConfigurationFile = rootPath + "config\\" + branch + "_" + _layer + ".axc"; client.ModelManifest = rootPath + branch + "\\" + _modelName + "\\Model.xml"; XPOCombiner combiner = new XPOCombiner(); combiner.XPOFolder = rootPath + branch + "\\" + _modelName + "\\"; // client.ModelManifest; combiner.CombinedXPOFilename = binPath + _modelName + "_combined.xpo"; combiner.SystemClassesXPOFilename = binPath + _modelName + "_combinedsystem.xpo"; log("Combining xpo"); combiner.Combine(); log("Combined"); Autorun autorun = new Autorun(); log("Creating autorun XMLs"); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Macros", true, binPath + _modelName + "_macros.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Data Dictionary\\Extended Data Types", true, binPath + _modelName + "_edt.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Data Dictionary\\Base Enums", true, binPath + _modelName + "_enums.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Data Dictionary\\Views", true, binPath + _modelName + "_views.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Data Dictionary\\Maps", true, binPath + _modelName + "_maps.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Data Dictionary\\Tables", true, binPath + _modelName + "_tables.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Data Dictionary\\Table Collections", true, binPath + _modelName + "_tablecollections.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Queries", true, binPath + _modelName + "_queries.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Classes", true, binPath + _modelName + "_classes.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Parts", true, binPath + _modelName + "_parts.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Resources", true, binPath + _modelName + "_resources.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Forms", true, binPath + _modelName + "_forms.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\SSRS Reports", true, binPath + _modelName + "_ssrsreports.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Web", true, binPath + _modelName + "_web.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Menu Items", true, binPath + _modelName + "_menuitems.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Menus", true, binPath + _modelName + "_menus.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Security", true, binPath + _modelName + "_security.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Jobs", true, binPath + _modelName + "_jobs.xml" ); autorun.CreateXPOImportXML( rootPath + branch + "\\" + _modelName + "\\Projects", true, binPath + _modelName + "_projects.xml" ); autorun.CreateXPOImportXML(binPath, true, binPath + _modelName + "_CombinedXPOImport.xml", false, ""); autorun.CreateVSProjectImportXML(combiner.XPOFolder + "Visual Studio Projects\\", true, binPath + _modelName + "_VSProjectAutoRun.xml", false, ""); autorun.CreateLabelFlushXML(combiner.XPOFolder + "label files\\", true, binPath + _modelName + "_LabelsFlush.xml", false, ""); log("XMLs created"); log("Setting no install mode"); model.SetNoInstallMode(); log("No install mode has been set"); for (int i = 0; i < 2; i++) { this.autorunXML(binPath + _modelName + "_macros.xml", 5); this.autorunXML(binPath + _modelName + "_edt.xml", 5); this.autorunXML(binPath + _modelName + "_enums.xml", 5); this.autorunXML(binPath + _modelName + "_tables.xml", 60); this.autorunXML(binPath + _modelName + "_views.xml", 60); this.autorunXML(binPath + _modelName + "_maps.xml", 15); this.autorunXML(binPath + _modelName + "_tablecollections.xml", 15); this.autorunXML(binPath + _modelName + "_queries.xml", 15); this.autorunXML(binPath + _modelName + "_classes.xml", 20); this.autorunXML(binPath + _modelName + "_parts.xml", 15); this.autorunXML(binPath + _modelName + "_resources.xml", 15); this.autorunXML(binPath + _modelName + "_forms.xml", 15); this.autorunXML(binPath + _modelName + "_ssrsreports.xml", 15); this.autorunXML(binPath + _modelName + "_web.xml", 15); this.autorunXML(binPath + _modelName + "_menuitems.xml", 15); this.autorunXML(binPath + _modelName + "_menus.xml", 15); this.autorunXML(binPath + _modelName + "_jobs.xml", 15); this.autorunXML(binPath + _modelName + "_security.xml", 15); this.autorunXML(binPath + _modelName + "_projects.xml", 15); this.autorunXML(binPath + _modelName + "_VSProjectAutoRun.xml", 15); } model.ExportModel(combiner.XPOFolder + "Model.xml", binPath + _modelName + ".axmodel"); log(String.Format("======= model {0} processed =======", _modelName)); }