| | |
| | | MAJOR_VERSION, |
| | | MINOR_VERSION, |
| | | POINT_VERSION, |
| | | REVISION_NUMBER); |
| | | REVISION); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | |
| | | MAJOR_VERSION, |
| | | MINOR_VERSION, |
| | | POINT_VERSION, |
| | | REVISION_NUMBER); |
| | | REVISION); |
| | | |
| | | return bi; |
| | | } |
| | |
| | | |
| | | // Allow negative revision number for cases where there is no |
| | | // VCS available. |
| | | Pattern p = Pattern.compile("((\\d+)\\.(\\d+)\\.(\\d+)\\.(-?\\d+))"); |
| | | Pattern p = Pattern.compile("((\\d+)\\.(\\d+)\\.(\\d+)\\.(-?.+))"); |
| | | Matcher m = p.matcher(bn); |
| | | if (!m.matches()) { |
| | | throw new IllegalArgumentException("'" + bn + "' is not a build string"); |
| | |
| | | bi.values.put(MAJOR_VERSION, m.group(2)); |
| | | bi.values.put(MINOR_VERSION, m.group(3)); |
| | | bi.values.put(POINT_VERSION, m.group(4)); |
| | | bi.values.put(REVISION_NUMBER, m.group(5)); |
| | | bi.values.put(REVISION, m.group(5)); |
| | | } catch (Exception e) { |
| | | throw new IllegalArgumentException("Error parsing build number " + bn); |
| | | } |
| | |
| | | String.valueOf(DynamicConstants.POINT_VERSION)); |
| | | bi.values.put(VERSION_QUALIFIER, |
| | | String.valueOf(DynamicConstants.VERSION_QUALIFIER)); |
| | | bi.values.put(REVISION_NUMBER, |
| | | String.valueOf(DynamicConstants.REVISION_NUMBER)); |
| | | bi.values.put(REVISION, DynamicConstants.REVISION); |
| | | bi.values.put(URL_REPOSITORY, |
| | | String.valueOf(DynamicConstants.URL_REPOSITORY)); |
| | | bi.values.put(FIX_IDS, DynamicConstants.FIX_IDS); |
| | |
| | | MAJOR_VERSION, |
| | | MINOR_VERSION, |
| | | POINT_VERSION, |
| | | REVISION_NUMBER); |
| | | REVISION); |
| | | |
| | | return bi; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * Gets the SVN revision number. |
| | | * Gets the VCS revision. |
| | | * |
| | | * @return Integer representing the SVN revision number |
| | | * @return String representing the VCS revision |
| | | */ |
| | | public Integer getRevisionNumber() { |
| | | return Integer.valueOf(values.get(REVISION_NUMBER)); |
| | | public String getRevision() { |
| | | return values.get(REVISION); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | if (getMajorVersion().equals(bi.getMajorVersion())) { |
| | | if (getMinorVersion().equals(bi.getMinorVersion())) { |
| | | if (getPointVersion().equals(bi.getPointVersion())) { |
| | | if (getRevisionNumber().equals(bi.getRevisionNumber())) { |
| | | if (getRevision().equals(bi.getRevision())) { |
| | | return 0; |
| | | } else if (getRevisionNumber() < bi.getRevisionNumber()) { |
| | | } else if (getRevision().compareTo(bi.getRevision()) < 0) { |
| | | return -1; |
| | | } |
| | | } else if (getPointVersion() < bi.getPointVersion()) { |
| | |
| | | hc = 31 * hc + getMajorVersion().hashCode(); |
| | | hc = 31 * hc + getMinorVersion().hashCode(); |
| | | hc = 31 * hc + getPointVersion().hashCode(); |
| | | hc = 31 * hc + getRevisionNumber().hashCode(); |
| | | hc = 31 * hc + getRevision().hashCode(); |
| | | return hc; |
| | | } |
| | | |