3 using System.Diagnostics;
7 public class Win32Builder : ABuilder
9 public Win32Builder(Config _cfg)
14 public override string GetPawnCompilerName()
19 public override string CompressPackage(Package pkg)
21 string lpath = null, ltarget = null;
23 pkg.GetCompressBases(ref lpath, ref ltarget);
25 string local_dir = Config.PathFormat("{0}/{1}",
29 string name = PackageBuildName(pkg) + ".zip";
31 ProcessStartInfo info = new ProcessStartInfo();
32 info.FileName = cfg.Compressor;
33 info.WorkingDirectory = local_dir;
34 info.Arguments = "-r \"" + name + "\" \"" + ltarget + "\"";
35 info.UseShellExecute = false;
37 Process p = Process.Start(info);
40 local_dir = Config.PathFormat("{0}/{1}", local_dir, name);
42 if (!File.Exists(local_dir))
50 public override bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath)
52 ProcessStartInfo info = new ProcessStartInfo();
54 string path = Config.PathFormat("{0}/{1}/msvc8",
58 /* PlatformExt ignored for us */
59 string binName = lib.Name + (lib.IsExecutable ? ".exe" : ".dll");
61 string binpath = Config.PathFormat("{0}/{1}/{2}",
66 if (File.Exists(binpath))
71 string projectFile = null;
72 if (lib.ProjectFile != null)
74 projectFile = lib.ProjectFile + ".vcproj";
78 projectFile = lib.Name + ".vcproj";
81 info.WorkingDirectory = path;
82 info.FileName = cfg.BuilderPath;
83 info.UseShellExecute = false;
84 info.RedirectStandardOutput = true;
85 info.RedirectStandardError = true;
87 if (cfg.BuildOptions != null)
89 info.Arguments = cfg.BuildOptions + " ";
92 info.Arguments += "/rebuild " + lib.ReleaseBuild + " " + projectFile;
94 Process p = Process.Start(info);
95 Console.WriteLine(p.StandardOutput.ReadToEnd());
99 if (!File.Exists(binpath))