public virtual void WriteSteps(CustomFileWriter writer) { using (writer.WriteBlock("steps")) { var arguments = $"{InvokedTargets.JoinSpace()} --skip"; if (Partition != null) { arguments += $" --{ParameterService.GetParameterDashedName(PartitionName)} {Partition.Part}"; } using (writer.WriteBlock("exec")) { writer.WriteLine($"path = {BuildCmdPath.DoubleQuote()}"); writer.WriteLine($"arguments = {arguments.DoubleQuote()}"); } } }
public virtual void WriteSteps(CustomFileWriter writer) { using (writer.WriteBlock("steps")) { var arguments = $"{InvokedTargets.JoinSpace()} --skip"; if (Partition != null) { arguments += $" --{ParameterService.GetParameterDashedName(PartitionName)} {Partition.Part}"; } using (writer.WriteBlock("exec")) { var path = Platform == TeamCityAgentPlatform.Windows ? BuildCmdPath : BuildCmdPath.Replace(".cmd", ".sh"); writer.WriteLine($"path = {path.DoubleQuote()}"); writer.WriteLine($"arguments = {arguments.DoubleQuote()}"); } } }
public virtual void WriteSteps(CustomFileWriter writer) { using (writer.WriteBlock("steps")) { var arguments = $"{InvokedTargets.JoinSpace()} --skip"; if (Partition != null) { arguments += $" --{ParameterService.GetParameterDashedName(PartitionName)} {Partition.Part}"; } void WriteConditionalExec(string path, string condition, string platform) { using (writer.WriteBlock("exec")) { writer.WriteLine($"path = {path.DoubleQuote()}"); writer.WriteLine($"arguments = {arguments.DoubleQuote()}"); writer.WriteLine($"conditions {{ {condition}(\"teamcity.agent.jvm.os.name\", {platform.DoubleQuote()}) }}"); } } WriteConditionalExec(BuildCmdPath, "contains", "Windows"); WriteConditionalExec(BuildCmdPath.Replace(".cmd", ".sh"), "doesNotContain", "Windows"); } }