public AssemblyInfoBuilder(LimnorXmlCompiler projectCompiler, LimnorProject project, string folder) : base(null, project, null, "AssemblyInfo", null, folder, null, null, false) { CodeCompileUnit code = new CodeCompileUnit(); code.ReferencedAssemblies.Add("System.Reflection"); code.ReferencedAssemblies.Add("System.Runtime.CompilerServices"); code.ReferencedAssemblies.Add("System.Runtime.InteropServices"); // if (!string.IsNullOrEmpty(projectCompiler.AssemblyTitle)) { code.AssemblyCustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(AssemblyTitleAttribute)), new CodeAttributeArgument(new CodePrimitiveExpression(projectCompiler.AssemblyTitle)))); } if (!string.IsNullOrEmpty(projectCompiler.AssemblyDescription)) { code.AssemblyCustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(AssemblyDescriptionAttribute)), new CodeAttributeArgument(new CodePrimitiveExpression(projectCompiler.AssemblyDescription)))); } if (!string.IsNullOrEmpty(projectCompiler.AssemblyProduct)) { code.AssemblyCustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(AssemblyProductAttribute)), new CodeAttributeArgument(new CodePrimitiveExpression(projectCompiler.AssemblyProduct)))); } if (!string.IsNullOrEmpty(projectCompiler.AssemblyCompany)) { code.AssemblyCustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(AssemblyCompanyAttribute)), new CodeAttributeArgument(new CodePrimitiveExpression(projectCompiler.AssemblyCompany)))); } if (!string.IsNullOrEmpty(projectCompiler.AssemblyCopyright)) { code.AssemblyCustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(AssemblyCopyrightAttribute)), new CodeAttributeArgument(new CodePrimitiveExpression(projectCompiler.AssemblyCopyright)))); } if (string.IsNullOrEmpty(projectCompiler.AssemblyVersion)) { code.AssemblyCustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(AssemblyVersionAttribute)), new CodeAttributeArgument(new CodePrimitiveExpression("1.0.0.0")))); } else { code.AssemblyCustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(AssemblyVersionAttribute)), new CodeAttributeArgument(new CodePrimitiveExpression(projectCompiler.AssemblyVersion)))); } if (!string.IsNullOrEmpty(projectCompiler.AssemblyFileVersion)) { code.AssemblyCustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(AssemblyFileVersionAttribute)), new CodeAttributeArgument(new CodePrimitiveExpression(projectCompiler.AssemblyFileVersion)))); } generateCode(code); }
private void buildProject(ProjectNode pn, string cfg, BuildSolutionResult sln) { if (_cancel) { return; } LimnorXmlCompiler builder = null; FrmObjectExplorer.RemoveDialogCaches(Guid.Empty, 0); showInfo(pn.Project.ProjectFile); _currentProject = sln.AddProject(pn.Project.ProjectFile); ProjectNodeData pnd = pn.PropertyObject as ProjectNodeData; try { builder = new LimnorXmlCompiler(pnd.ProjectFile, this); } catch (Exception err2) { _currentProject.SetError("Error creating ILimnorBuilder from [LimnorXmlCompiler]. {1} ", err2.Message); builder = null; } if (builder != null) { builder.SetProject(pnd.Project, cfg); if (builder.Execute()) { } else { _currentProject.SetError("Finished building [{0}]. Failed ===============", pnd.Project.ProjectFile); } } _currentProject.End(); Application.DoEvents(); }