Skip to content

Commit

Permalink
Merge branch 'master' into incorporate-open-source-templated-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
KCeh authored Sep 9, 2024
2 parents 142d951 + bafb681 commit e7f113f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ Then add the following dependencies in your app `build.gradle` or `build.gradle.

**Groovy**

<!--
If format of version definition is changed, make sure to update `generateReadme` task
-->
```groovy
def sentinelVersion = "1.4.1"
debugImplementation "com.infinum.sentinel:sentinel:$sentinelVersion"
Expand Down
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 e7f113f

Please sign in to comment.