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

View File

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

View File

@ -68,11 +68,19 @@ public AMod()
m_Plugins = new ArrayList(); 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) public virtual bool CopyExtraFiles(string basedir, string sourcedir)
{ {
return true; return true;
} }
//defines a copy prevention filter
public virtual bool ExcludeCopy(string file)
{
return false;
}
public virtual string GetPluginDir() public virtual string GetPluginDir()
{ {
return GetName(); return GetName();
@ -110,6 +118,4 @@ public virtual Plugin AddPlugin(string name)
return pl; return pl;
} }
} }
} }

View File

@ -27,6 +27,27 @@ public override sealed string GetBaseName()
return null; 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) public override sealed bool CopyExtraFiles(string basedir, string source)
{ {
//Create directory structures //Create directory structures

View File

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

View File

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