Skip to content

Commit

Permalink
Add gradle tasks for updating version in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KCeh committed Sep 6, 2024
1 parent 346483e commit 86672f5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sentinel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,8 @@ project.gradle.taskGraph.whenReady {
connectedDebugAndroidTest {
ignoreFailures = true
}
}
}

apply from: '../tasks.gradle'
preBuild.dependsOn ':sentinel:generateReadme'

13 changes: 13 additions & 0 deletions tasks.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apply from: '../config.gradle'

private void replaceVersionsInFile(File file) {
def content = file.text
content = content.replaceAll(~/sentinelVersion\s*=\s*".*"/, "sentinelVersion = \"${releaseConfig.version}\"")
file.setText(content)
}

tasks.register('generateReadme') {
doFirst {
replaceVersionsInFile(new File("${rootDir}/README.md"))
}
}

0 comments on commit 86672f5

Please sign in to comment.