Skip to content

Commit

Permalink
feat: fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinstardust committed Mar 2, 2024
1 parent 2e856b4 commit 287e536
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
[
"@semantic-release/exec",
{
"prepareCmd": "./gradlew --stacktrace -PversionParam=${nextRelease.version} clean :library:assemble",
"prepareCmd": "./gradlew --stacktrace -PversionParam=${nextRelease.version} changeReleaseVersion clean :library:assemble",
"successCmd": "echo"
}
],
Expand Down
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,14 @@ nexusPublishing {
subprojects {
group = "com.paypal.messages"
}

//./gradlew -PversionParam=0.0.1 changeReleaseVersion
tasks.register('changeReleaseVersion') {
doLast {
def topLevelGradleFile = file('./build.gradle')
def topLevelGradleFileText = topLevelGradleFile.getText('UTF-8')
def updatedScript =
topLevelGradleFileText.replaceFirst(/("sdkVersionName"\s*: )".*",/, '$1"' + versionParam + '",')
topLevelGradleFile.write(updatedScript, 'UTF-8')
}
}

0 comments on commit 287e536

Please sign in to comment.