From 86672f5bc8a00e14b67e3950c0266db82d0f7536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karlo=20=C4=8Ceh?= Date: Fri, 6 Sep 2024 10:01:48 +0200 Subject: [PATCH 1/2] Add gradle tasks for updating version in readme --- sentinel/build.gradle | 6 +++++- tasks.gradle | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tasks.gradle diff --git a/sentinel/build.gradle b/sentinel/build.gradle index e1b405f..66e3807 100644 --- a/sentinel/build.gradle +++ b/sentinel/build.gradle @@ -125,4 +125,8 @@ project.gradle.taskGraph.whenReady { connectedDebugAndroidTest { ignoreFailures = true } -} \ No newline at end of file +} + +apply from: '../tasks.gradle' +preBuild.dependsOn ':sentinel:generateReadme' + diff --git a/tasks.gradle b/tasks.gradle new file mode 100644 index 0000000..70c23a8 --- /dev/null +++ b/tasks.gradle @@ -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")) + } +} \ No newline at end of file From 19f5f8715f625d3da53aaa276ae211fc6f48c08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karlo=20=C4=8Ceh?= Date: Fri, 6 Sep 2024 10:38:04 +0200 Subject: [PATCH 2/2] Add comment for version definition and related gradle task --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f39b60b..4595805 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,9 @@ Then add the following dependencies in your app `build.gradle` or `build.gradle. **Groovy** + ```groovy def sentinelVersion = "1.4.1" debugImplementation "com.infinum.sentinel:sentinel:$sentinelVersion"