Skip to content

Commit

Permalink
Fix versionCheck gradle task to compare against version of resolved g…
Browse files Browse the repository at this point in the history
…em instead of project version
  • Loading branch information
robertpanzer committed Apr 9, 2022
1 parent b82344f commit cb8659a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gradle/versioncheck.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ task checkVersion() {

String gem_latest_version = getLatestGemVersion(gem_name)
String javaVersion = latestGemVersionAsJavaVersion(gem_latest_version)

try {

Version projectVersion = Version.valueOf(version as String)
String resolvedVersion = project.configurations.gems.resolvedConfiguration.resolvedArtifacts.find { it.name == gem_name }.moduleVersion.id.version
Version projectVersion = Version.valueOf(resolvedVersion as String)
Version gemJavaVersion = Version.valueOf(javaVersion)

if (projectVersion.lessThan(gemJavaVersion)) {
logger.warn "\nWARNING\nVersion mismatch: Current Version: {}, Gem Version: {}\n",version , gem_latest_version
logger.warn "\nWARNING\nVersion mismatch: Current Version: {}, Gem Version: {}\n", resolvedVersion , gem_latest_version
} else {
println "up-to-date"
}
Expand Down

0 comments on commit cb8659a

Please sign in to comment.