{ vars: { major: 2, minor: 1, patch: 2, build: 20210904, revision: 0, }, calcVars: { nextBuild: "now::year * 10000 + now::month * 100 + now::day", }, operations: { incrMajor: "major += 1; minor = 0; patch = 0; revision = 0; build = nextBuild", incrMinor: "minor += 1; patch = 0; revision = 0; build = nextBuild", incrPatch: "patch += 1; revision = 0; build = nextBuild", incrRevision: "revision += 1; build = nextBuild", }, targets: [ { description: "Cargo Package", files: ["Cargo.toml"], action: { updates: [ { search: '^(?Pversion\\s*=\\s*")\\d+\\.\\d+\\.\\d+(?P"\\s*)$', replace: 'begin + str::from(major) + "." + str::from(minor) + "." + str::from(patch) + end', }, ], }, }, { description: "Rust Clap Version", files: ["src/bin/ender.rs", "src/bin/spacer.rs"], action: { updates: [ { search: '^(?P\\s+\\.version\\(")\\d+\\.\\d+\\.\\d+\\+\\d+\\.\\d+(?P"\\))$', replace: 'begin + str::from(major) + "." + str::from(minor) + "." + str::from(patch) + "+" + str::from(build) + "." + str::from(revision) + end', }, ], }, }, { description: "Git Tag Name", files: ["scratch/version.tag.txt"], action: { write: 'str::from(major) + "." + str::from(minor) + "." + str::from(patch)', }, }, { description: "Git Tag Description", files: ["scratch/version.desc.txt"], action: { write: '"Version " + str::from(major) + "." + str::from(minor) + "." + str::from(patch) + "+" + str::from(build) + "." + str::from(revision)', }, }, ], }