- introduced adjuncts from stapler

- fixed the feature envy problem in the version computation

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14052 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-12-31 19:46:02 +00:00
1 parent f16c11f071
commit a06e8a05c1
2 files changed
+48 -29

No files matched your search

-28
View File
@@ -33,11 +33,9 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Locale;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -158,8 +156,6 @@ public final class WebAppMain implements ServletContextListener {
new Thread("hudson initialization thread") {
public void run() {
try {
computeVersion(context);
try {
context.setAttribute(APP,new Hudson(home,context));
} catch( IOException e ) {
@@ -200,30 +196,6 @@ public final class WebAppMain implements ServletContextListener {
Stapler.setExpressionFactory(event, new ExpressionFactory2());
}
protected void computeVersion(ServletContext context) {
// set the version
Properties props = new Properties();
try {
InputStream is = getClass().getResourceAsStream("hudson-version.properties");
if(is!=null)
props.load(is);
} catch (IOException e) {
e.printStackTrace(); // if the version properties is missing, that's OK.
}
String ver = props.getProperty("version");
if(ver==null) ver="?";
Hudson.VERSION = ver;
context.setAttribute("version",ver);
String verHash = Util.getDigestOf(ver).substring(0, 8);
if(ver.equals("?"))
Hudson.RESOURCE_PATH = "";
else
Hudson.RESOURCE_PATH = "/static/"+verHash;
Hudson.VIEW_RESOURCE_PATH = "/resources/"+ verHash;
}
/**
* Installs log handler to monitor all Hudson logs.
*/