Skip to content

Commit

Permalink
Bump the buck version
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Dec 27, 2016
1 parent 03253f9 commit 48c746d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .buckhash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d03e405da061819c5b0647b1ea3b26ff
94c5faec28e2b558e093eefe172b241e
2 changes: 1 addition & 1 deletion .buckversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
35906a88243594636b9c4f68cf0423dd9aa0808b
37eee6cd1a13292b45e2e682b32afae1efb9526b
22 changes: 16 additions & 6 deletions java/client/src/org/openqa/selenium/internal/BuildInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Map.Entry;
Expand All @@ -27,6 +28,7 @@
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;

/**
* Reads information about how the current application was built from the Build-Info section of the
Expand All @@ -45,11 +47,19 @@ private static Properties loadBuildProperties() {
URL url = BuildInfo.class.getProtectionDomain().getCodeSource().getLocation();
File file = new File(url.toURI());
jar = new JarFile(file);
ZipEntry entry = jar.getEntry("META-INF/build-stamp.properties");
if (entry != null) {
try (InputStream stream = jar.getInputStream(entry)) {
properties.load(stream);
}
}

manifest = jar.getManifest();
} catch (NullPointerException ignored) {
} catch (URISyntaxException ignored) {
} catch (IOException ignored) {
} catch (IllegalArgumentException ignored) {
} catch (
IllegalArgumentException |
IOException |
NullPointerException |
URISyntaxException ignored) {
} finally {
if (jar != null) {
try {
Expand Down Expand Up @@ -84,12 +94,12 @@ public String getReleaseLabel() {

/** @return The embedded build revision or "unknown". */
public String getBuildRevision() {
return BUILD_PROPERTIES.getProperty("Build-Revision", "unknown");
return BUILD_PROPERTIES.getProperty("build-revision", "unknown");
}

/** @return The embedded build time or "unknown". */
public String getBuildTime() {
return BUILD_PROPERTIES.getProperty("Build-Time", "unknown");
return BUILD_PROPERTIES.getProperty("build-timestamp", "unknown");
}

@Override
Expand Down

0 comments on commit 48c746d

Please sign in to comment.