public void MacTestApp() { var tmpDir = Cache.CreateTemporaryDirectory(); var engine = new MacAppTemplateEngine(ProjectFlavor.FullXM, ProjectLanguage.CSharp); var fileSubstitutions = new FileSubstitutions { TestCode = "System.Console.WriteLine (typeof (int));" }; var projectSubstitutions = new ProjectSubstitutions { References = "<Reference Include=\"System.Net.Http\" />", }; string projectPath = engine.Generate(tmpDir, projectSubstitutions, fileSubstitutions); ProjectBuilder.BuildProject(projectPath, "/"); /* Use system XM instead of _mac-build today */ }
public void GenerateProject(string webAppBaseDirectory, string projectName, string solutionName = null, string distDirectory = null) { BuiltInComponentsInserter.InsertBuiltInComponents(); distDirectory = distDirectory ?? Environment.CurrentDirectory + "\\test"; CreateSolution(projectName); ComponentsContainer container = ComponentsContainer.Instance; ComponentsFactory componentsFactory = new ComponentsFactory(container, container, container, container); WebFolderToCsFilesConverter converter = new WebFolderToCsFilesConverter(componentsFactory, new HtmlFinder()); List <ComponentGeneratorOutput> results = converter.GenerateClasses(webAppBaseDirectory); AddBaseClassesToResults(results); CreateFiles(distDirectory, results); string packageConfigName = CreatePackagesConfig(distDirectory); ProjectBuilder builder = new ProjectBuilder(); builder.BuildProject(projectName, results, distDirectory, packageConfigName); }
/// <summary> /// Any UI to be displayed after the scaffolder has been selected from the Add Scaffold dialog. /// Any validation on the input for values in the UI should be completed before returning from this method. /// </summary> /// <returns></returns> public override bool ShowUIAndValidate() { // Bring up the selection dialog and allow user to select a model type SelectModelWindow window = new SelectModelWindow(_viewModel); bool?showDialog = window.ShowDialog(); TargetProject = Context.ActiveProject; ProjectBuilder projectBuilder = new ProjectBuilder(); projectBuilder.BuildProject(Context.ActiveProject); GetProjectUrl(); _entityModelType = window.EntityType.SelectedItem as ModelType; var entityModel = window.EntityType.SelectedItem as ModelType; var dbContextModel = window.DbContextType.SelectedItem as ModelType; IEntityFrameworkService efService = Context.ServiceProvider.GetService(typeof(IEntityFrameworkService)) as IEntityFrameworkService; ModelMetadata entityMetadata = efService.AddRequiredEntity(this.Context, dbContextModel.CodeType.FullName, entityModel.TypeName); _entityType = _entityModelType.ShortTypeName; _entityProperties = new Dictionary <string, string>(); foreach (var eProperty in entityMetadata.Properties) { if (eProperty.IsAutoGenerated) { continue; } if (eProperty.IsPrimaryKey) { _entityKeyType = eProperty.ShortTypeName; _entityKeyName = eProperty.PropertyName; continue; } _entityProperties.Add(eProperty.PropertyName, eProperty.ShortTypeName); } return(showDialog ?? false); }