Skip to content

Commit

Permalink
Updated release hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jiakuan committed Oct 25, 2024
1 parent b4fc104 commit 9b507a2
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,39 @@ plugins {
}

scmVersion {
// This will append "-alpha" to your current version

tag {
// Optional, this sets a tag like 'v1.0.0'
prefix = 'v'
}

hooks {
// First hook for updating the "id" version pattern
// Update the "id" version pattern
pre("fileUpdate", [
file : "README.md",
pattern : { v, p -> /id "org\.docstr\.gwt version "([\d.a-zA-Z-]+)"/ },
replacement: { v, p -> "id \"org.docstr.gwt version \"${v}-alpha\"" }
])

// Update the "id" version pattern
pre("fileUpdate", [
file: "README.md",
pattern: { v, p -> /id "org\.docstr\.gwt version "([\d.a-zA-Z-]+)"/ },
replacement: { v, p -> "id \"org.docstr.gwt version \"${v}\"" }
file : "doc/Configuration.md",
pattern : { v, p -> /id "org\.docstr\.gwt version "([\d.a-zA-Z-]+)"/ },
replacement: { v, p -> "id \"org.docstr.gwt version \"${v}-alpha\"" }
])

// Second hook for updating the Maven coordinates version
// Update the Maven coordinates version
pre("fileUpdate", [
file: "README.md",
pattern: { v, p -> /org\.docstr\.gwt:gwt-gradle-plugin:([\d.a-zA-Z-]+)/ },
replacement: { v, p -> "org.docstr.gwt:gwt-gradle-plugin:${v}" }
file : "README.md",
pattern : { v, p -> /org\.docstr\.gwt:gwt-gradle-plugin:([\d.a-zA-Z-]+)/ },
replacement: { v, p -> "org.docstr.gwt:gwt-gradle-plugin:${v}-alpha" }
])

// Pre-hook to create a commit after updating the file
pre("commit") // This ensures the changes are committed after the update
}
}

version = scmVersion.version
version = scmVersion.version + "-alpha"

allprojects {
group = 'org.docstr.gwt'
Expand Down

0 comments on commit 9b507a2

Please sign in to comment.