예제 #1
0
 //==============================================================================
 // 関数
 //==============================================================================
 /// <summary>
 /// ビルドコマンドを追加します
 /// </summary>
 public BuildProcess Add(IBuildCommand command)
 {
     if (command == null)
     {
         return(this);
     }
     m_commands.Add(command);
     return(this);
 }
예제 #2
0
        public void Build(string buildFile)
        {
            // Debugger.Launch();
            this.Output("{0} START BUILD {1}", new string('#', 6), new string('#', 25));

            // read build file
            IDictionary <string, string> variables;
            XElement root;

            if (!this.TryReadBuildFile(buildFile, out variables, out root))
            {
                this.Output("{0} END BUILD {1}", new string('#', 6), new string('#', 23));
                Environment.ExitCode = 1;
                return;
            }

            this.Output("Performing " + variables["BuildEvent"] + " build event ...");

            // load commands
            var commands = new IBuildCommand[]
            {
                new DeployCommand(this),
                new CopyDirCommand(this),
                new ExcludeReferenceCommand(this),
                new RestoreReferencesCommand(this),
            };

            // process elements
            foreach (var element in root.Elements())
            {
                var com = commands.FirstOrDefault(c => c.Name.Equals(element.Name.LocalName, StringComparison.OrdinalIgnoreCase));
                if (com == null)
                {
                    continue;
                }

                com.Execute(variables, element);
            }

            this.Output("{0} END BUILD {1}", new string('#', 6), new string('#', 23));
        }
예제 #3
0
 public RunCommand(IBuildCommand build)
 {
     this.build = build;
 }
예제 #4
0
 public void ExecuteCommand(IBuildCommand buildCommand)
 {
     buildCommand.Execute();
 }