Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/294#discussion_r22720543
  
    --- Diff: storm-core/src/jvm/backtype/storm/utils/VersionInfo.java ---
    @@ -0,0 +1,58 @@
    +package backtype.storm.utils;
    +
    +public class VersionInfo {
    +  private static Package myPackage;
    +  private static VersionAnnotation version;
    +
    +  static {
    +    myPackage = VersionAnnotation.class.getPackage();
    +    version = myPackage.getAnnotation(VersionAnnotation.class);
    +  }
    +  
    +  static Package getPackage() {
    +    return myPackage;
    +  }
    +
    +  public static String getVersion() {
    +    return version != null ? version.version() : "Unknown";
    +  }
    +
    +  public static String getRevision() {
    +    return version != null ? version.revision() : "Unknown";
    +  }
    +
    +  public static String getBranch() {
    +    return version != null ? version.branch() : "Unknown";
    +  }
    +
    +  public static String getDate() {
    +    return version != null ? version.date() : "Unknown";
    +  }
    +
    +  public static String getUser() {
    +    return version != null ? version.user() : "Unknown";
    +  }
    +
    +  public static String getUrl() {
    +    return version != null ? version.url() : "Unknown";
    +  }
    +
    +  public static String getSrcChecksum() {
    +    return version != null ? version.srcChecksum() : "Unknown";
    +  }
    +
    +  public static String getBuildVersion() {
    +    return VersionInfo.getVersion() + " from " + VersionInfo.getRevision()
    +        + " by " + VersionInfo.getUser() + " source checksum "
    +        + VersionInfo.getSrcChecksum();
    +  }
    +
    +  public static void main(String[] args) {
    +    System.out.println("Storm " + getVersion());
    +    System.out.println("Subversion " + getUrl() + " -r " + getRevision());
    --- End diff --
    
    We use git by default not Subversion.  I would prefer to see this changed 
to not indicate the SCM used.  Alternatively because we detect it in the script 
we could include it as a separate parameter that is saved too.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to