Skip to content

Commit

Permalink
update groovy-all file check string
Browse files Browse the repository at this point in the history
  • Loading branch information
etatara committed Oct 23, 2017
1 parent 52cf1bd commit 8045864
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,20 @@ protected File findGroovyJar(String bundleDir) {
if (!candidateGroovyAllJars.isEmpty()) {
Version latest = new Version("0.0.0");
for (File gJar : candidateGroovyAllJars) {
String name = gJar.getName().substring("groovy-all-".length());
Version current = new Version(name);

// Groovy all jar format is usually: groovy-all-x.x.x-suffix.jar so need
// to extract the number version x.x.x

// remove the prefix
String ver = gJar.getName().substring("groovy-all-".length());

// remove the suffix
int suffixIndex = ver.indexOf('-');

if (suffixIndex > 0)
ver = ver.substring(0, suffixIndex);

Version current = new Version(ver);
if (latest.lessEqual(current)) {
latest = current;
latestGJar = gJar;
Expand Down

0 comments on commit 8045864

Please sign in to comment.