Display git commit id instead of TRUNK. Closes #1305.
This commit is contained in:
parent
d2147ec87c
commit
1d2888ba01
@ -35,6 +35,7 @@ package com.google.refine;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
@ -52,9 +53,12 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.google.refine.commands.Command;
|
||||
import com.google.refine.importing.ImportingManager;
|
||||
import com.google.refine.io.FileProjectManager;
|
||||
import com.google.refine.util.ParsingUtilities;
|
||||
|
||||
import edu.mit.simile.butterfly.Butterfly;
|
||||
import edu.mit.simile.butterfly.ButterflyModule;
|
||||
@ -107,7 +111,15 @@ public class RefineServlet extends Butterfly {
|
||||
VERSION = ASSIGNED_VERSION;
|
||||
}
|
||||
if (REVISION.equals("$REVISION")) {
|
||||
REVISION = "TRUNK";
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
InputStream gitStats = classLoader.getResourceAsStream("git.properties");
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
try {
|
||||
ObjectNode parsedGit = mapper.readValue(gitStats, ObjectNode.class);
|
||||
REVISION = parsedGit.get("git.commit.id.abbrev").asText("TRUNK");
|
||||
} catch (IOException e) {
|
||||
REVISION = "TRUNK";
|
||||
}
|
||||
}
|
||||
|
||||
FULL_VERSION = VERSION + " [" + REVISION + "]";
|
||||
|
@ -39,7 +39,6 @@ import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.BindException;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
@ -50,9 +49,6 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenuItem;
|
||||
|
||||
import org.apache.log4j.Level;
|
||||
import org.mortbay.jetty.Connector;
|
||||
@ -66,7 +62,6 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.codeberry.jdatapath.DataPath;
|
||||
import com.codeberry.jdatapath.JDataPathSystem;
|
||||
|
||||
import com.google.util.threads.ThreadPoolExecutorAdapter;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user