From d516824936032ddf7b5f7ac8832af7e7a21500de Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 24 Aug 2005 05:19:23 +0000 Subject: [PATCH] Add copy exclusion filters Repaired windows builder Fixed /build to be /rebuild --- installer/AMXXRelease/ABuilder.cs | 6 ++++-- installer/AMXXRelease/AMXXRelease.csproj | 18 ++++++++++++++---- installer/AMXXRelease/AMod.cs | 10 ++++++++-- installer/AMXXRelease/CoreMod.cs | 21 +++++++++++++++++++++ installer/AMXXRelease/Main.cs | 3 +++ installer/AMXXRelease/Win32Builder.cs | 2 +- installer/AMXXRelease/win32.info | 6 ++++++ 7 files changed, 57 insertions(+), 9 deletions(-) create mode 100755 installer/AMXXRelease/win32.info diff --git a/installer/AMXXRelease/ABuilder.cs b/installer/AMXXRelease/ABuilder.cs index 5cf155dc..b04d0345 100755 --- a/installer/AMXXRelease/ABuilder.cs +++ b/installer/AMXXRelease/ABuilder.cs @@ -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=0; i--) { diff --git a/installer/AMXXRelease/AMXXRelease.csproj b/installer/AMXXRelease/AMXXRelease.csproj index 65006922..0d4888f4 100755 --- a/installer/AMXXRelease/AMXXRelease.csproj +++ b/installer/AMXXRelease/AMXXRelease.csproj @@ -76,7 +76,7 @@ /> @@ -84,7 +84,7 @@ @@ -103,7 +103,7 @@ BuildAction = "Compile" /> @@ -117,6 +117,16 @@ SubType = "Code" BuildAction = "Compile" /> + + diff --git a/installer/AMXXRelease/AMod.cs b/installer/AMXXRelease/AMod.cs index 62abaa5a..14fd6fe0 100755 --- a/installer/AMXXRelease/AMod.cs +++ b/installer/AMXXRelease/AMod.cs @@ -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; } } - - } diff --git a/installer/AMXXRelease/CoreMod.cs b/installer/AMXXRelease/CoreMod.cs index f88f7670..b7689a66 100755 --- a/installer/AMXXRelease/CoreMod.cs +++ b/installer/AMXXRelease/CoreMod.cs @@ -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 diff --git a/installer/AMXXRelease/Main.cs b/installer/AMXXRelease/Main.cs index 01300022..4846aaf6 100755 --- a/installer/AMXXRelease/Main.cs +++ b/installer/AMXXRelease/Main.cs @@ -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(); diff --git a/installer/AMXXRelease/Win32Builder.cs b/installer/AMXXRelease/Win32Builder.cs index 4b3d4a06..56e120ea 100755 --- a/installer/AMXXRelease/Win32Builder.cs +++ b/installer/AMXXRelease/Win32Builder.cs @@ -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); diff --git a/installer/AMXXRelease/win32.info b/installer/AMXXRelease/win32.info new file mode 100755 index 00000000..c412dcb2 --- /dev/null +++ b/installer/AMXXRelease/win32.info @@ -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