public string IncrementVersion(string content) { dynamic obj = JsonConvert.DeserializeObject(content); var shapes = obj.childShapes; foreach (var shape in shapes) { var properties = shape.properties; if (properties == null) { continue; } var name = (string)properties.name; var id = (string)properties.lcId; if (name == null || id == null) { continue; } if (id.Contains("forcam")) { properties.name = VersionIncrement.IncrementFlowReference((string)properties.name); } } return(PrettyPrinter.FormatJson(JsonConvert.SerializeObject(obj))); }
private void IncrementVersionString(XmlElement version) { var oldVersion = Version.Parse(version.InnerText); var newVersion = VersionIncrement.Increment(oldVersion); version.InnerText = newVersion.ToString(); }
public void IncrementVersion(DirectoryInfo workspace, Project project) { var pom = Path.Combine(workspace.FullName, "pom.xml"); if (File.Exists(pom)) { VersionIncrement.ReplaceFileContent(pom, c => PomReader.IncrementVersion(c)); } }
public string IncrementVersion(XmlDocument xml) { var process = xml["definitions"]["process"]; foreach (XmlNode node in process.ChildNodes) { if (node.Name == "callActivity") { var name = node.Attributes["name"].InnerText; var newName = VersionIncrement.IncrementFlowReference(name); node.Attributes["name"].InnerText = newName; } } return(PomReader.XmlToPrettyString(xml)); }
private static FlowConfiguration ReadBooking(dynamic process, bool incrementVersion) { var bookingGroup = (string)process.bookingGroup ?? ""; var configuration = (string)process.configuration ?? ""; var resource = (string)process.resource ?? ""; var version = (string)process.version ?? "?"; if (incrementVersion && version != "?") { process.version = VersionIncrement.Increment(Version.Parse(version)).ToString(); } var dependency = Dependency.ParsePackage(resource.Replace("/", "."), ""); var flow = new FlowConfiguration("*" + dependency.GroupId, dependency.ArtifactId, version, bookingGroup, configuration); return(flow); }
public void IncrementVersion(DirectoryInfo workspace, Project project) { var projectDir = Path.Combine(workspace.FullName, project.FlatName); if (!Directory.Exists(projectDir)) { return; } var pom = "pom.xml"; var controllerJson = project.ArtifactId + "_controller.json"; if (File.Exists(Path.Combine(projectDir, controllerJson))) { VersionIncrement.ReplaceFileContent(Path.Combine(projectDir, controllerJson), c => ControllerJsonReader.IncrementVersion(c)); } if (File.Exists(Path.Combine(projectDir, pom))) { VersionIncrement.ReplaceFileContent(Path.Combine(projectDir, pom), c => PomReader.IncrementVersion(c)); } }
public void IncrementFlowVersion(DirectoryInfo projectDir, Dependency flow, Project project) { var pom = "pom.xml"; var flowName = flow.ArtifactId.ToLower(); var bpmn = flowName + ".bpmn"; var flowsJson = flowName + ".json"; if (File.Exists(Path.Combine(projectDir.FullName, pom))) { VersionIncrement.ReplaceFileContent(Path.Combine(projectDir.FullName, pom), c => PomReader.IncrementVersion(c)); } if (File.Exists(Path.Combine(projectDir.FullName, bpmn))) { VersionIncrement.ReplaceFileContent(Path.Combine(projectDir.FullName, bpmn), c => BpmnReader.IncrementVersion(c)); } if (File.Exists(Path.Combine(projectDir.FullName, flowsJson))) { VersionIncrement.ReplaceFileContent(Path.Combine(projectDir.FullName, flowsJson), c => ProcessFlowJsonReader.IncrementVersion(c)); } }
private static Version NextVersion(Version version, VersionIncrement increment) => increment switch {