Start adding zip target to prebuild for nant

afrisby
Sean Dague 2007-09-15 10:17:24 +00:00
parent f8ddf7429e
commit 5a94814bbe
1 changed files with 520 additions and 506 deletions

View File

@ -1,25 +1,25 @@
#region BSD License #region BSD License
/* /*
Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) Copyright (c) 2004 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
Redistribution and use in source and binary forms, with or without modification, are permitted Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met: provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions * Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer. and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the and the following disclaimer in the documentation and/or other materials provided with the
distribution. distribution.
* The name of the author may not be used to endorse or promote products derived from this software * The name of the author may not be used to endorse or promote products derived from this software
without specific prior written permission. without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#endregion #endregion
@ -47,18 +47,18 @@ using Prebuild.Core.Utilities;
namespace Prebuild.Core.Targets namespace Prebuild.Core.Targets
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[Target("nant")] [Target("nant")]
public class NAntTarget : ITarget public class NAntTarget : ITarget
{ {
#region Fields #region Fields
private Kernel m_Kernel; private Kernel m_Kernel;
#endregion #endregion
#region Private Methods #region Private Methods
private static string PrependPath(string path) private static string PrependPath(string path)
{ {
@ -69,10 +69,10 @@ namespace Prebuild.Core.Targets
//{ //{
tmpPath = Helper.NormalizePath(tmpPath); tmpPath = Helper.NormalizePath(tmpPath);
//} //}
// else // else
// { // {
// tmpPath = Helper.NormalizePath("./" + tmpPath); // tmpPath = Helper.NormalizePath("./" + tmpPath);
// } // }
return tmpPath; return tmpPath;
} }
@ -490,6 +490,20 @@ namespace Prebuild.Core.Targets
ss.WriteLine(" </target>"); ss.WriteLine(" </target>");
ss.WriteLine(); ss.WriteLine();
// sdague - make a zip target
ss.WriteLine(" <target name=\"zip\" description=\"\">");
ss.WriteLine(" <zip zipfile=\"{0}.zip\">", solution.Name);
ss.WriteLine(" <fileset basedir=\"${project::get-base-directory()}\">");
ss.WriteLine(" <include name=\"${project::get-base-directory()}/**/*.cs\" />");
// ss.WriteLine(" <include name=\"${project.main.dir}/**/*\" />");
ss.WriteLine(" </fileset>");
ss.WriteLine(" </zip>");
ss.WriteLine(" <echo message=\"Building zip target\" />");
ss.WriteLine(" </target>");
ss.WriteLine();
ss.WriteLine(" <target name=\"clean\" description=\"\">"); ss.WriteLine(" <target name=\"clean\" description=\"\">");
ss.WriteLine(" <echo message=\"Deleting all builds from all configurations\" />"); ss.WriteLine(" <echo message=\"Deleting all builds from all configurations\" />");
//ss.WriteLine(" <delete dir=\"${dist.dir}\" failonerror=\"false\" />"); //ss.WriteLine(" <delete dir=\"${dist.dir}\" failonerror=\"false\" />");
@ -564,9 +578,9 @@ namespace Prebuild.Core.Targets
m_Kernel.Log.Write(""); m_Kernel.Log.Write("");
} }
#endregion #endregion
#region ITarget Members #region ITarget Members
/// <summary> /// <summary>
/// Writes the specified kern. /// Writes the specified kern.
@ -616,6 +630,6 @@ namespace Prebuild.Core.Targets
} }
} }
#endregion #endregion
} }
} }