Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,20 @@ ext {
dependencies {
implementation 'junit:junit:4.12'
}

// updateVersion: Task to auto increment to the next development iteration
task updateVersion {
onlyIf { System.getProperty('newVersion') }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where this newVersion will be set ? Where and when will this update version task will be executed?

Copy link
Copy Markdown
Member Author

@prudhvigodithi prudhvigodithi Jul 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ylwu-amzn this task updateVersion task will called using a workflow from the build repo example ./gradlew updateVersion -DnewVersion=2.1.0-SNAPSHOT , this newVersion will be compared against core repo and will update the plugin files to increment the version.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doLast {
ext.newVersion = System.getProperty('newVersion')
println "Setting version to ${newVersion}."
// String tokenization to support -SNAPSHOT
ant.replaceregexp(match: opensearch_version.tokenize('-')[0], replace: newVersion.tokenize('-')[0], flags:'g', byline:true) {
fileset(dir: projectDir) {
// Include the required files that needs to be updated with new Version
include(name: "build.gradle")
include(name: ".github/workflows/CI-workflow.yml")
}
}
}
}