AddPostBuildCommands( Bam.Core.StringArray commands, Configuration configuration) { lock (this) { if (null == this.PostBuildBuildPhase) { var postBuildBuildPhase = new ShellScriptBuildPhase(this, "Post Build", (target) => { var content = new System.Text.StringBuilder(); foreach (var config in target.ConfigurationList) { content.AppendFormat("if [ \\\"$CONFIGURATION\\\" = \\\"{0}\\\" ]; then\\n\\n", config.Name); foreach (var line in config.PostBuildCommands) { content.AppendFormat(" {0}\\n", line.Replace("\"", "\\\"")); } content.AppendFormat("fi\\n\\n"); } return(content.ToString()); }); this.Project.ShellScriptsBuildPhases.Add(postBuildBuildPhase); this.PostBuildBuildPhase = postBuildBuildPhase; // do not add PostBuildBuildPhase to this.BuildPhases, so that it can be serialized in the right order } configuration.PostBuildCommands.AddRange(commands); } }
appendShellScriptsBuildPhase( ShellScriptBuildPhase phase) { lock (this.ShellScriptsBuildPhases) { this.ShellScriptsBuildPhases.Add(phase); } }
public void AddPreBuildCommands( Bam.Core.StringArray commands, Configuration configuration) { lock (this) { if (null == this.PreBuildBuildPhase) { var preBuildBuildPhase = new ShellScriptBuildPhase(this, "Pre Build", (target) => { var content = new System.Text.StringBuilder(); foreach (var config in target.ConfigurationList) { content.AppendFormat("if [ \\\"$CONFIGURATION\\\" = \\\"{0}\\\" ]; then\\n\\n", config.Name); foreach (var line in config.PreBuildCommands) { content.AppendFormat(" {0}\\n", line.Replace("\"", "\\\"")); } content.AppendFormat("fi\\n\\n"); } return content.ToString(); }); this.Project.ShellScriptsBuildPhases.Add(preBuildBuildPhase); this.PreBuildBuildPhase = preBuildBuildPhase; // do not add PreBuildBuildPhase to this.BuildPhases, so that it can be serialized in the right order } configuration.PreBuildCommands.AddRange(commands); } }