Add copy exclusion filters

Repaired windows builder
Fixed /build to be /rebuild
This commit is contained in:
David Anderson 2005-08-24 05:19:23 +00:00
parent 10328f5f81
commit d516824936
7 changed files with 57 additions and 9 deletions

View File

@ -5,7 +5,7 @@
namespace AMXXRelease
{
//This class specifies the process that builds a release.
//It also implements the functions that are unlikely to change.
//It also implements the functions that are unlikely to change from mod to mod.
public abstract class ABuilder
{
protected Config m_Cfg;
@ -138,6 +138,8 @@ public virtual bool BuildModPlugins(AMod mod)
for (int i=0; i<files.Length; i++)
{
dest = PropSlashes(basedir + "\\scripting\\" + GetFileName(files[i]));
if (mod.ExcludeCopy(files[i]))
continue;
File.Copy(files[i], dest, true);
}
}
@ -145,7 +147,7 @@ public virtual bool BuildModPlugins(AMod mod)
return true;
}
private static string GetFileName(string input)
public static string GetFileName(string input)
{
for (int i=input.Length-1; i>=0; i--)
{

View File

@ -76,7 +76,7 @@
/>
<Reference
Name = "System.XML"
AssemblyName = "System.XML"
AssemblyName = "System.Xml"
HintPath = "..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
</References>
@ -84,7 +84,7 @@
<Files>
<Include>
<File
RelPath = "ABuild.cs"
RelPath = "ABuilder.cs"
SubType = "Code"
BuildAction = "Compile"
/>
@ -103,7 +103,7 @@
BuildAction = "Compile"
/>
<File
RelPath = "Builder.cs"
RelPath = "Build.cs"
SubType = "Code"
BuildAction = "Compile"
/>
@ -117,6 +117,16 @@
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "LinuxBuilder.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Main.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ModCstrike.cs"
SubType = "Code"
@ -148,7 +158,7 @@
BuildAction = "Compile"
/>
<File
RelPath = "Release15.cs"
RelPath = "Win32Builder.cs"
SubType = "Code"
BuildAction = "Compile"
/>

View File

@ -68,11 +68,19 @@ public AMod()
m_Plugins = new ArrayList();
}
//called when it's okay to build an extra dir structure
// and copy files to it
public virtual bool CopyExtraFiles(string basedir, string sourcedir)
{
return true;
}
//defines a copy prevention filter
public virtual bool ExcludeCopy(string file)
{
return false;
}
public virtual string GetPluginDir()
{
return GetName();
@ -110,6 +118,4 @@ public virtual Plugin AddPlugin(string name)
return pl;
}
}
}

View File

@ -27,6 +27,27 @@ public override sealed string GetBaseName()
return null;
}
//annoyingly complicated file exclusion filter
public override sealed bool ExcludeCopy(string file)
{
if ( ((file.IndexOf(".so")!=-1) || (ABuilder.GetFileName(file).CompareTo("amxxpc")==0))
&& (Releaser.IsWindows) )
return true;
if ( (file.IndexOf(".sh")!=-1) && Releaser.IsWindows )
return true;
if ( ((file.IndexOf(".exe")!=-1) || (file.IndexOf(".dll")!=-1))
&& (!Releaser.IsWindows) )
return true;
if ( (file.IndexOf("dlsym")!=-1) && Releaser.IsWindows )
return true;
if ( ((ABuilder.GetFileName(file).CompareTo("sasm")) == 0)
&& Releaser.IsWindows )
return true;
return base.ExcludeCopy(file);
}
public override sealed bool CopyExtraFiles(string basedir, string source)
{
//Create directory structures

View File

@ -12,6 +12,7 @@ namespace AMXXRelease
public class Releaser
{
private Config m_Cfg;
public static bool IsWindows;
[STAThread]
static void Main(string[] args)
@ -42,8 +43,10 @@ public void Release(string file)
if ((int)System.Environment.OSVersion.Platform == 128)
{
builder = new LinuxBuilder();
Releaser.IsWindows = false;
} else {
builder = new Win32Builder();
Releaser.IsWindows = true;
}
Build build = new Build();

View File

@ -65,7 +65,7 @@ public override string BuildModule(Module module)
info.WorkingDirectory = PropSlashes(dir);
info.FileName = m_Cfg.DevenvPath();
info.Arguments = "/build " + module.build + " " + module.vcproj + ".vcproj";
info.Arguments = "/rebuild " + module.build + " " + module.vcproj + ".vcproj";
info.UseShellExecute = false;
Process p = Process.Start(info);

View File

@ -0,0 +1,6 @@
compress = C:\WINDOWS\zip.exe
source = c:\real\code\amxmodx
makeopts =
output = c:\real\done
devenv = C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.com
release = amxmodx-1.55