| using System; |
| using System.Collections.Generic; |
| using System.Text; |
| using System.Xml; |
| using System.IO; |
| |
| using NPanday.ProjectImporter.Digest; |
| using NPanday.ProjectImporter.Digest.Model; |
| using NPanday.Utils; |
| using NPanday.Model.Pom; |
| |
| using NPanday.Artifact; |
| |
| using System.Reflection; |
| |
| using NPanday.ProjectImporter.Converter; |
| |
| using NPanday.ProjectImporter.Validator; |
| |
| |
| /// Author: Leopoldo Lee Agdeppa III |
| |
| namespace NPanday.ProjectImporter.Converter.Algorithms |
| { |
| public class WebWithVbOrCsProjectFilePomConverter : NormalPomConverter |
| { |
| public WebWithVbOrCsProjectFilePomConverter(ProjectDigest projectDigest, string mainPomFile, NPanday.Model.Pom.Model parent, string groupId) |
| : base(projectDigest,mainPomFile,parent, groupId) |
| { |
| } |
| |
| public override void ConvertProjectToPomModel(bool writePom, string scmTag) |
| { |
| // just call the base, but dont write it we still need some minor adjustments for it |
| base.ConvertProjectToPomModel(false,scmTag); |
| Model.packaging = "asp"; |
| |
| // Write SCMTag |
| if (scmTag != null && scmTag != string.Empty && Model.parent == null) |
| { |
| Scm scmHolder = new Scm(); |
| scmHolder.connection = string.Format("scm:svn:{0}", scmTag); |
| scmHolder.developerConnection = string.Format("scm:svn:{0}", scmTag); |
| scmHolder.url = scmTag; |
| |
| Model.scm = scmHolder; |
| } |
| |
| |
| Model.build.sourceDirectory = "."; |
| |
| // change the outputDirectory of the plugin |
| Plugin compilePlugin = FindPlugin("npanday.plugin", "maven-compile-plugin"); |
| AddPluginConfiguration(compilePlugin, "outputDirectory", "bin"); |
| |
| // Add NPanday compile plugin |
| Plugin aspxPlugin = AddPlugin("npanday.plugin", "maven-aspx-plugin"); |
| if (!string.IsNullOrEmpty(projectDigest.TargetFramework)) |
| AddPluginConfiguration(aspxPlugin, "frameworkVersion", projectDigest.TargetFramework); |
| |
| // add msbuild plugin config in pom if there's a maven-resgen-plugin but no msbuild config |
| // generates resources in target/bin folder |
| |
| if ((FindPlugin("npanday.plugin", "maven-resgen-plugin")) != null && (FindPlugin("npanday.plugin", "NPanday.Plugin.Msbuild.JavaBinding")) == null) |
| { |
| Plugin msbuildPlugin = AddPlugin("npanday.plugin", "NPanday.Plugin.Msbuild.JavaBinding"); |
| AddPluginExecution(msbuildPlugin, "compile", "validate"); |
| } |
| |
| |
| if (writePom) |
| { |
| PomHelperUtility.WriteModelToPom(new FileInfo(Path.GetDirectoryName(projectDigest.FullFileName) + @"\pom.xml"), Model); |
| } |
| |
| |
| } |
| |
| |
| } |
| } |