* Added resolving explicit .exe project names. This fixes mantis #2967
parent
db88c7c3ee
commit
87eff82b28
|
@ -92,27 +92,62 @@ namespace Prebuild.Core.Targets
|
||||||
private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr)
|
private static string BuildReference(SolutionNode solution, ProjectNode currentProject, ReferenceNode refr)
|
||||||
{
|
{
|
||||||
string ret = "";
|
string ret = "";
|
||||||
|
string referencePath = ((ReferencePathNode)currentProject.ReferencePaths[0]).Path;
|
||||||
|
|
||||||
if (solution.ProjectsTable.ContainsKey(refr.Name))
|
if (solution.ProjectsTable.ContainsKey(refr.Name))
|
||||||
{
|
{
|
||||||
ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name];
|
ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name];
|
||||||
string finalPath = Helper.NormalizePath(((ReferencePathNode)currentProject.ReferencePaths[0]).Path + refr.Name + GetProjectExtension(project), '/');
|
string finalPath = Helper.NormalizePath(referencePath + refr.Name + GetProjectExtension(project), '/');
|
||||||
return finalPath;
|
return finalPath;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ProjectNode project = (ProjectNode)refr.Parent;
|
if (refr.Name == "Pootface.exe")
|
||||||
string fileRef = FindFileReference(refr.Name, project);
|
|
||||||
|
|
||||||
if (refr.Path != null || fileRef != null)
|
|
||||||
{
|
{
|
||||||
string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path + "/" + refr.Name + GetProjectExtension(project), '/') : fileRef;
|
Console.WriteLine("Poot!");
|
||||||
ret += finalPath;
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret += (refr.Name + ".dll");
|
ProjectNode project = (ProjectNode) refr.Parent;
|
||||||
|
|
||||||
|
// Do we have an explicit file reference?
|
||||||
|
string fileRef = FindFileReference(refr.Name, project);
|
||||||
|
if( fileRef != null )
|
||||||
|
{
|
||||||
|
return fileRef;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is there an explicit path in the project ref?
|
||||||
|
if (refr.Path != null)
|
||||||
|
{
|
||||||
|
return Helper.NormalizePath( refr.Path + "/" + refr.Name + GetProjectExtension(project), '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is it a specified extension (dll or exe?)
|
||||||
|
if (ExtensionSpecified(refr.Name))
|
||||||
|
{
|
||||||
|
return Helper.NormalizePath( referencePath + GetRefFileName(refr.Name), '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
// No, it's an extensionless GAC ref, but nant needs the .dll extension anyway
|
||||||
|
return refr.Name + ".dll";
|
||||||
}
|
}
|
||||||
return ret;
|
}
|
||||||
|
|
||||||
|
public static string GetRefFileName(string refName)
|
||||||
|
{
|
||||||
|
if (ExtensionSpecified(refName))
|
||||||
|
{
|
||||||
|
return refName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return refName + ".dll";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool ExtensionSpecified(string refName)
|
||||||
|
{
|
||||||
|
return refName.EndsWith(".dll") || refName.EndsWith(".exe");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetProjectExtension(ProjectNode project)
|
private static string GetProjectExtension(ProjectNode project)
|
||||||
|
@ -177,6 +212,13 @@ namespace Prebuild.Core.Targets
|
||||||
{
|
{
|
||||||
return fullPath;
|
return fullPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fullPath = Helper.MakeFilePath(refPath.Path, refName, "exe");
|
||||||
|
|
||||||
|
if (File.Exists(fullPath))
|
||||||
|
{
|
||||||
|
return fullPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
BIN
bin/Prebuild.exe
BIN
bin/Prebuild.exe
Binary file not shown.
Loading…
Reference in New Issue