Skip to content

Commit

Permalink
Stop Prebuild from generating <copy> statements which unnecessarily c…
Browse files Browse the repository at this point in the history
…opy files into bin/Debug or bin/Release

nant_0.91~alpha2+dfsg-3_all.deb in Ubuntu 12.04 and earlier actually ignored these due to a bug
However, nant 0.92~rc1+dfsg-2 in Ubuntu 12.10 fixes this bug (possibly nant/nant#39).
Which makes nant time-consumingly copy these files when the aren't actually used.
Tested removal of <copy> on both nant 0.91 and nant 0.92
Will be submitting this patch to prebuild project for comment though I suspect there's nobody there to pay attention.
  • Loading branch information
Justin Clark-Casey (justincc) committed Nov 15, 2012
1 parent 8638766 commit cce6e6c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
Binary file removed Prebuild/Prebuild.exe
Binary file not shown.
43 changes: 0 additions & 43 deletions Prebuild/src/Core/Targets/NAntTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,49 +209,6 @@ private void WriteProject(SolutionNode solution, ProjectNode project)
ss.WriteLine(" <target name=\"{0}\">", "build");
ss.WriteLine(" <echo message=\"Build Directory is ${project::get-base-directory()}/${build.dir}\" />");
ss.WriteLine(" <mkdir dir=\"${project::get-base-directory()}/${build.dir}\" />");
ss.WriteLine(" <copy todir=\"${project::get-base-directory()}/${build.dir}\" flatten=\"true\">");
ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}\">");
foreach (ReferenceNode refr in project.References)
{
if (refr.LocalCopy)
{
ss.WriteLine(" <include name=\"{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)) + "\" />", '/'));
}
}

ss.WriteLine(" </fileset>");
ss.WriteLine(" </copy>");
if (project.ConfigFile != null && project.ConfigFile.Length!=0)
{
ss.Write(" <copy file=\"" + project.ConfigFile + "\" tofile=\"${project::get-base-directory()}/${build.dir}/${project::get-name()}");

if (project.Type == ProjectType.Library)
{
ss.Write(".dll.config\"");
}
else
{
ss.Write(".exe.config\"");
}
ss.WriteLine(" />");
}

// Add the content files to just be copied
ss.WriteLine(" {0}", "<copy todir=\"${project::get-base-directory()}/${build.dir}\">");
ss.WriteLine(" {0}", "<fileset basedir=\".\">");

foreach (string file in project.Files)
{
// Ignore if we aren't content
if (project.Files.GetBuildAction(file) != BuildAction.Content)
continue;

// Create a include tag
ss.WriteLine(" {0}", "<include name=\"" + Helper.NormalizePath(PrependPath(file), '/') + "\" />");
}

ss.WriteLine(" {0}", "</fileset>");
ss.WriteLine(" {0}", "</copy>");

ss.Write(" <csc ");
ss.Write(" target=\"{0}\"", project.Type.ToString().ToLower());
Expand Down
Binary file modified bin/Prebuild.exe
Binary file not shown.

0 comments on commit cce6e6c

Please sign in to comment.