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
This change has been used without issue for OpenSimulator since Nov 14 2012 commit 90c6d2e
  • Loading branch information
Justin Clark-Casey committed Jul 24, 2014
1 parent df4dee9 commit dbb69da
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 46 deletions.
Binary file modified Programs/Prebuild/Prebuild.exe
Binary file not shown.
46 changes: 0 additions & 46 deletions Programs/Prebuild/src/Core/Targets/NAntTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,54 +229,8 @@ 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(" <echo message=\"Build Directory is ${build.dir}\" />");
ss.WriteLine(" <mkdir dir=\"${build.dir}\" />");
ss.WriteLine(" <copy todir=\"${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, 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()}");
ss.Write(" <copy file=\"" + project.ConfigFile + "\" tofile=\"${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}", "<copy todir=\"${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 dbb69da

Please sign in to comment.