예제 #1
0
파일: SignTask.cs 프로젝트: UIKit0/wintools
        public override void Execute(XmlElement config)
        {
            string tool_path = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "lib", "mono", "2.0", "sn.exe");
            string mono_path = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "bin", "mono.exe");
            string assembly  = Utilities.ReplaceArgs(config.GetAttribute("assembly"), Revision);
            string keyfile   = Utilities.ReplaceArgs(config.GetAttribute("key"), Revision);
            string args      = string.Format("\"{0}\" -q -R \"{1}\" \"{2}\"", tool_path, assembly, keyfile);

            CommandLineRunner.ExecuteCommand(mono_path, null, args);
        }
예제 #2
0
        public override void Execute(XmlElement config)
        {
            string source      = Utilities.ReplaceArgs(config.GetAttribute("source"), Revision);
            string destination = Utilities.ReplaceArgs(config.GetAttribute("destination"), Revision);
            string tool_path   = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "lib", "mono", "2.0", "culevel.exe");
            string mono_path   = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "bin", "mono.exe");
            string args        = string.Format("\"{0}\" -o \"{1}\" \"{2}\"", tool_path, destination, source);

            CommandLineRunner.ExecuteCommand(mono_path, null, args);
        }
예제 #3
0
        public override void Execute(XmlElement config)
        {
            string tool_path  = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "lib", "mono", "2.0", "resgen.exe");
            string mono_path  = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "bin", "mono.exe");
            string workingdir = Utilities.ReplaceArgs(config.GetAttribute("workingdir"), Revision);
            string file       = Utilities.ReplaceArgs(config.InnerText, Revision);

            string args = string.Format("\"{0}\" \"{1}\"", tool_path, file);

            CommandLineRunner.ExecuteCommand(mono_path, workingdir, args);
        }
예제 #4
0
        public override void Execute(XmlElement config)
        {
            string assembly  = Utilities.ReplaceArgs(config.InnerText, Revision);
            string tool_path = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "lib", "mono", "2.0", "gacutil.exe");
            string mono_path = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "bin", "mono.exe");

            string args = string.Format("\"{0}\" -i \"{1}\"", tool_path, assembly);

            CommandLineResults results = CommandLineRunner.ExecuteCommand(mono_path, null, args);

            if (results.ExitCode == 0)
            {
                File.Delete(assembly + ".mdb");
            }
        }
예제 #5
0
파일: RunTask.cs 프로젝트: UIKit0/wintools
        public override void Execute(XmlElement config)
        {
            string source = Utilities.ReplaceArgs(config.GetAttribute("source"), Revision);

            CommandLineRunner.ExecuteCommand(source, Path.GetDirectoryName(source));
        }
예제 #6
0
        public override void Execute(XmlElement config)
        {
            string tool_path   = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "lib", "mono", "2.0", "gmcs.exe");
            string mono_path   = Utilities.CombinePaths(Environment.CurrentDirectory, "build", "bin", "mono.exe");
            string output_path = Utilities.ReplaceArgs(config.GetAttribute("destination"), Revision);

            if (config.GetAttribute("mono") == "install")
            {
                tool_path = Utilities.CombinePaths(Settings.Default.installedmono, "lib", "mono", "2.0", "gmcs.exe");
                mono_path = Utilities.CombinePaths(Settings.Default.installedmono, "bin", "mono.exe");
            }

            Log.AppendFormat("Building: {0}\n", config.GetAttribute("name"));
            Console.WriteLine("Building: {0}", config.GetAttribute("name"));

            if (!Directory.Exists(Path.GetDirectoryName(output_path)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(output_path));
            }

            string args = string.Empty;

            args  = string.Format("\"{0}\"", tool_path);
            args += " /codepage:65001 -optimize";

            //args += " -d:" + profile_defines;

            if (config["DefineConstants"] != null)
            {
                args += " -d:" + config["DefineConstants"].InnerText;
            }
            if (config["AllowUnsafeBlocks"] != null)
            {
                args += " -unsafe";
            }
            if (config["OutputType"] != null)
            {
                args += " -target:" + config["OutputType"].InnerText;
            }
            if (config["IgnoreWarnings"] != null)
            {
                args += " -nowarn:" + config["IgnoreWarnings"].InnerText;
            }
            if (config["Debug"] == null || config["Debug"].InnerText == "true")
            {
                args += " -debug";
            }
            if (config["NoConfig"] == null || config["NoConfig"].InnerText == "true")
            {
                args += " -noconfig";
            }
            if (config["NoStandardLib"] != null && config["NoStandardLib"].InnerText == "true")
            {
                args += " -nostdlib";
            }
            if (config["KeyFile"] != null)
            {
                args += string.Format(" -keyfile:{0}", Utilities.ReplaceArgs(config["KeyFile"].InnerText, Revision));
            }

            foreach (XmlElement reference in config.SelectNodes("References/Reference"))
            {
                if (!string.IsNullOrEmpty(reference.GetAttribute("alias")))
                {
                    args += string.Format(" -r:{0}={1}", reference.GetAttribute("alias"), reference.InnerText);
                }
                else
                {
                    args += " -r:" + reference.InnerText;
                }
            }

            args += string.Format(" -out:{0}", output_path);

            foreach (XmlElement sourcenode in config.SelectNodes("Sources/Source"))
            {
                if (sourcenode.GetAttribute("type") == "list")
                {
                    args += " @" + sourcenode.InnerText;
                }
                else
                {
                    args += " " + sourcenode.InnerText;
                }
            }

            string working_path = Utilities.ReplaceArgs(config["SourcePath"].InnerText, Revision);

            CommandLineResults results = CommandLineRunner.ExecuteCommand(mono_path, working_path, args);

            Log.AppendLine(results.Output);

            if (results.ExitCode != 0)
            {
                Log.AppendFormat("BuildTask returned: {0}\n\n--- Error Log ---\n", results.ExitCode);
                Log.AppendLine(results.ErrorOutput);
                Console.WriteLine("Build Failed");
                Console.WriteLine(results.ErrorOutput);
                throw new ApplicationException(string.Format("BuildTask returned: {0}", results.ExitCode));
            }
        }