Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorggayed2001-05-30 03:37:28 +0000
committerggayed2001-05-30 03:37:28 +0000
commit0ff670dbf8704c30a2676f05a575caf05467feed (patch)
treeb011210c6673b1c8e1d68329d318799bb9b715ff
parent850a525c13a9fd9eb68d53200fcf71624cc8fba4 (diff)
downloadeclipse.pde.build-0ff670dbf8704c30a2676f05a575caf05467feed.tar.gz
eclipse.pde.build-0ff670dbf8704c30a2676f05a575caf05467feed.tar.xz
eclipse.pde.build-0ff670dbf8704c30a2676f05a575caf05467feed.zip
System.out's to statusesv115
-rw-r--r--org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ComponentBuildScriptGenerator.java2
-rw-r--r--org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ConfigurationBuildScriptGenerator.java2
-rw-r--r--org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelBuildScriptGenerator.java8
-rw-r--r--org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelRegistry.java16
-rw-r--r--org.eclipse.pde.build/src/org/eclipse/pde/internal/build/PluginTool.java19
-rw-r--r--org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ScriptGeneratorConstants.java11
6 files changed, 39 insertions, 19 deletions
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ComponentBuildScriptGenerator.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ComponentBuildScriptGenerator.java
index 4da65ef8..1d550337 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ComponentBuildScriptGenerator.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ComponentBuildScriptGenerator.java
@@ -96,7 +96,7 @@ public IStatus execute() {
output.close();
}
} catch (IOException e) {
- e.printStackTrace(System.out);
+ getPluginLog().log(new Status(IStatus.ERROR,PI_PDECORE,EXCEPTION_OUTPUT,"Output exception",e));
}
return getProblems();
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ConfigurationBuildScriptGenerator.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ConfigurationBuildScriptGenerator.java
index f6481466..38fff72c 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ConfigurationBuildScriptGenerator.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ConfigurationBuildScriptGenerator.java
@@ -67,7 +67,7 @@ public IStatus execute() {
output.close();
}
} catch (IOException e) {
- e.printStackTrace(System.out);
+ getPluginLog().log(new Status(IStatus.ERROR,PI_PDECORE,EXCEPTION_OUTPUT,"Output exception",e));
}
return getProblems();
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelBuildScriptGenerator.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelBuildScriptGenerator.java
index b4fc20cd..4b131fe8 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelBuildScriptGenerator.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelBuildScriptGenerator.java
@@ -93,7 +93,7 @@ public IStatus execute() {
output.flush();
}
} catch (IOException e) {
- e.printStackTrace(System.out);
+ getPluginLog().log(new Status(IStatus.ERROR,PI_PDECORE,EXCEPTION_OUTPUT,"Output exception",e));
}
}
@@ -209,7 +209,7 @@ protected void generateJarTarget(PrintWriter output, PluginModel descriptor,Stri
fullJar = new URL(descriptor.getLocation() + relativeJar).getFile();
} catch (MalformedURLException e) {
// should not happen
- e.printStackTrace();
+ getPluginLog().log(new Status(IStatus.ERROR,PI_PDECORE,EXCEPTION_URL,"URL exception",e));
}
String jar = fullJar.substring(fullJar.lastIndexOf('/') + 1);
@@ -342,7 +342,7 @@ protected void generateSrcTarget(PrintWriter output,PluginModel descriptor,Strin
fullJar = new URL(descriptor.getLocation() + relativeJar).getFile();
} catch (MalformedURLException e) {
// should not happen
- e.printStackTrace();
+ getPluginLog().log(new Status(IStatus.ERROR,PI_PDECORE,EXCEPTION_URL,"URL exception",e));
}
// zip name is jar name without the ".jar" but with SOURCE_EXTENSION appended
@@ -483,7 +483,7 @@ protected PrintWriter openOutput(PluginModel descriptor) throws IOException {
String file = location.getFile() + OUTPUT_FILENAME;
return new PrintWriter(new FileOutputStream(new File(file).getAbsoluteFile()));
} catch (MalformedURLException e) {
- e.printStackTrace(); // should never get here
+ getPluginLog().log(new Status(IStatus.ERROR,PI_PDECORE,EXCEPTION_URL,"URL exception",e));
return null;
}
}
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelRegistry.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelRegistry.java
index 37f97dfb..a7616be9 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelRegistry.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ModelRegistry.java
@@ -48,7 +48,13 @@ protected void readComponent(File componentFile) {
} catch (FileNotFoundException e) {
return;
} catch (Exception e) {
- e.printStackTrace();
+ PluginTool.getPluginLog().log(
+ new Status(
+ IStatus.ERROR,
+ PluginTool.PI_PDECORE,
+ ScriptGeneratorConstants.EXCEPTION_COMPONENT_INPUT,
+ "Component input exception",
+ e));
return;
} finally {
if (inStream != null) {
@@ -71,7 +77,13 @@ protected void readConfiguration(File configurationFile) {
} catch (FileNotFoundException e) {
return;
} catch (Exception e) {
- e.printStackTrace();
+ PluginTool.getPluginLog().log(
+ new Status(
+ IStatus.ERROR,
+ PluginTool.PI_PDECORE,
+ ScriptGeneratorConstants.EXCEPTION_CONFIGURATION_INPUT,
+ "Configuration input exception",
+ e));
return;
} finally {
if (inStream != null) {
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/PluginTool.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/PluginTool.java
index e50e0845..9c7cf900 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/PluginTool.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/PluginTool.java
@@ -14,23 +14,23 @@ import java.net.*;
import java.util.*;
public abstract class PluginTool implements IPlatformRunnable, ScriptGeneratorConstants {
- protected boolean usage = false;
+ private boolean usage = false;
private PluginRegistryModel registry = null;
- URL pluginPath = null;
- ArrayList plugins = new ArrayList(3);
- String install = null;
+ private URL pluginPath = null;
+ private ArrayList plugins = new ArrayList(9);
+ private String install = null;
private List devEntries = null;
private Hashtable propertyValues = new Hashtable(9);
private MultiStatus problems = new MultiStatus(PI_PDECORE,IStatus.OK,Policy.bind("label.generationProblems"),null);
-
- public final static String PI_PDECORE = "org.eclipse.pde.core";
- private static final String SEPARATOR_VERSION = "_";
+
+ public final static String PI_PDECORE = "org.eclipse.pde.core";
private static final String USAGE = "-?";
private static final String PLUGINS = "-plugins";
private static final String INSTALL = "-install";
private static final String DEV_ENTRIES = "-dev";
private static final String PROPERTYASSIGNMENT_PREFIX = "${";
private static final String PROPERTYASSIGNMENT_SUFFIX = "}";
+
/**
* Deletes all the files and directories from the given root down (inclusive).
* Returns false if we could not delete some file or an exception occurred
@@ -55,6 +55,9 @@ public static boolean clear(File root) {
}
return result;
}
+public static ILog getPluginLog() {
+ return Platform.getPlugin(PI_PDECORE).getLog();
+}
protected void addProblem(IStatus problem) {
problems.add(problem);
}
@@ -128,7 +131,7 @@ protected List getListFromString(String prop) {
}
return result;
}
-private URL[] getPluginPath() {
+protected URL[] getPluginPath() {
// get the plugin path. If one was spec'd on the command line, use that.
// Otherwise, if the install location was spec'd, compute the default path.
// Finally, if nothing was said, allow the system to figure out the plugin
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ScriptGeneratorConstants.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ScriptGeneratorConstants.java
index cec6c035..db644c85 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ScriptGeneratorConstants.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ScriptGeneratorConstants.java
@@ -7,7 +7,8 @@ package org.eclipse.pde.internal.core;
interface ScriptGeneratorConstants {
// constants
- public final static String FILENAME_PROPERTIES = "build.properties";
+ public static final String FILENAME_PROPERTIES = "build.properties";
+ public static final String SEPARATOR_VERSION = "_";
// targets
public static final String TARGET_ALL = "all";
@@ -38,12 +39,16 @@ interface ScriptGeneratorConstants {
public final static int EXCEPTION_MODEL_PARSE = 0x1;
public final static int EXCEPTION_PLUGIN_MISSING = 0x2;
public final static int EXCEPTION_FRAGMENT_MISSING = 0x4;
- public final static int EXCEPTION_COMPONENT_PARSE = 0x8;
+ public final static int EXCEPTION_COMPONENT_INPUT = 0x1024;
public final static int EXCEPTION_COMPONENT_MISSING = 0x16;
- public final static int EXCEPTION_CONFIGURATION_PARSE = 0x32;
+ public final static int EXCEPTION_COMPONENT_PARSE = 0x8;
+ public final static int EXCEPTION_CONFIGURATION_INPUT = 0x1024;
public final static int EXCEPTION_CONFIGURATION_MISSING = 0x64;
+ public final static int EXCEPTION_CONFIGURATION_PARSE = 0x32;
public final static int WARNING_PLUGIN_INCORRECTVERSION = 0x128;
public final static int WARNING_FRAGMENT_INCORRECTVERSION = 0x256;
public final static int WARNING_COMPONENT_INCORRECTVERSION = 0x512;
public final static int EXCEPTION_FILE_MISSING = 0x1024;
+ public final static int EXCEPTION_OUTPUT = 0x1024;
+ public final static int EXCEPTION_URL = 0x1024;
}

Back to the top