git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274816 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -139,8 +139,7 @@ public class VAJAntTool { | |||||
| String data = info.asDataString(); | String data = info.asDataString(); | ||||
| try { | try { | ||||
| ToolData td = new ToolData(TOOL_DATA_KEY, data); | ToolData td = new ToolData(TOOL_DATA_KEY, data); | ||||
| VAJLocalUtil.getWorkspace().loadedProjectNamed( | |||||
| info.getVAJProjectName()).setToolRepositoryData(td); | |||||
| VAJLocalUtil.getWorkspace().loadedProjectNamed(info.getVAJProjectName()).setToolRepositoryData(td); | |||||
| } catch (Throwable t) { | } catch (Throwable t) { | ||||
| throw new BuildException("BuildInfo for Project " | throw new BuildException("BuildInfo for Project " | ||||
| + info.getVAJProjectName() + " could not be saved", t); | + info.getVAJProjectName() + " could not be saved", t); | ||||
| @@ -302,7 +302,9 @@ public class VAJAntToolGUI extends Frame { | |||||
| /** | /** | ||||
| * Eventhandler to handle all AWT-events | * Eventhandler to handle all AWT-events | ||||
| */ | */ | ||||
| private class PrivateEventHandler implements ActionListener, ItemListener, TextListener, WindowListener, PropertyChangeListener { | |||||
| private class PrivateEventHandler | |||||
| implements ActionListener, ItemListener, TextListener, | |||||
| WindowListener, PropertyChangeListener { | |||||
| /** | /** | ||||
| * ActionListener method | * ActionListener method | ||||
| */ | */ | ||||
| @@ -428,12 +430,18 @@ public class VAJAntToolGUI extends Frame { | |||||
| handleException(exc); | handleException(exc); | ||||
| } | } | ||||
| } | } | ||||
| public void windowActivated(WindowEvent e) {} | |||||
| public void windowClosed(WindowEvent e) {} | |||||
| public void windowDeactivated(WindowEvent e) {} | |||||
| public void windowDeiconified(WindowEvent e) {} | |||||
| public void windowIconified(WindowEvent e) {} | |||||
| public void windowOpened(WindowEvent e) {} | |||||
| public void windowActivated(WindowEvent e) { | |||||
| } | |||||
| public void windowClosed(WindowEvent e) { | |||||
| } | |||||
| public void windowDeactivated(WindowEvent e) { | |||||
| } | |||||
| public void windowDeiconified(WindowEvent e) { | |||||
| } | |||||
| public void windowIconified(WindowEvent e) { | |||||
| } | |||||
| public void windowOpened(WindowEvent e) { | |||||
| } | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -850,7 +858,7 @@ public class VAJAntToolGUI extends Frame { | |||||
| iCommandButtonPanelFlowLayout.setAlignment(FlowLayout.RIGHT); | iCommandButtonPanelFlowLayout.setAlignment(FlowLayout.RIGHT); | ||||
| } catch (Throwable iExc) { | } catch (Throwable iExc) { | ||||
| handleException(iExc); | handleException(iExc); | ||||
| }; | |||||
| } | |||||
| return iCommandButtonPanelFlowLayout; | return iCommandButtonPanelFlowLayout; | ||||
| } | } | ||||
| /** | /** | ||||
| @@ -192,7 +192,7 @@ class VAJBuildInfo implements Runnable { | |||||
| private Vector projectTargets = new Vector(); | private Vector projectTargets = new Vector(); | ||||
| // target selected for execution | // target selected for execution | ||||
| private java.lang.String target = ""; | |||||
| private String target = ""; | |||||
| // log level | // log level | ||||
| private int outputMessageLevel = Project.MSG_INFO; | private int outputMessageLevel = Project.MSG_INFO; | ||||
| @@ -224,7 +224,7 @@ class VAJBuildInfo implements Runnable { | |||||
| /** | /** | ||||
| * Returns the BuildInfo information as String. The BuildInfo can | * Returns the BuildInfo information as String. The BuildInfo can | ||||
| * be rebuilt from that String by calling parse(). | * be rebuilt from that String by calling parse(). | ||||
| * @return java.lang.String | |||||
| * @return String | |||||
| */ | */ | ||||
| public String asDataString() { | public String asDataString() { | ||||
| String result = getOutputMessageLevel() + "|" + getBuildFileName() | String result = getOutputMessageLevel() + "|" + getBuildFileName() | ||||
| @@ -254,7 +254,7 @@ class VAJBuildInfo implements Runnable { | |||||
| /** | /** | ||||
| * The firePropertyChange method was generated to support the propertyChange field. | * The firePropertyChange method was generated to support the propertyChange field. | ||||
| */ | */ | ||||
| public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue) { | |||||
| public void firePropertyChange(String propertyName, Object oldValue, Object newValue) { | |||||
| getPropertyChange().firePropertyChange(propertyName, oldValue, newValue); | getPropertyChange().firePropertyChange(propertyName, oldValue, newValue); | ||||
| } | } | ||||
| @@ -305,7 +305,7 @@ class VAJBuildInfo implements Runnable { | |||||
| /** | /** | ||||
| * returns the selected target. | * returns the selected target. | ||||
| */ | */ | ||||
| public java.lang.String getTarget() { | |||||
| public String getTarget() { | |||||
| return target; | return target; | ||||
| } | } | ||||
| @@ -350,7 +350,7 @@ class VAJBuildInfo implements Runnable { | |||||
| * outputMessageLevel'|'buildFileName'|'defaultTarget'|'(project target'|')* | * outputMessageLevel'|'buildFileName'|'defaultTarget'|'(project target'|')* | ||||
| * | * | ||||
| * @return org.apache.tools.ant.taskdefs.optional.vaj.BuildInfo | * @return org.apache.tools.ant.taskdefs.optional.vaj.BuildInfo | ||||
| * @param data java.lang.String | |||||
| * @param data String | |||||
| */ | */ | ||||
| public static VAJBuildInfo parse(String data) { | public static VAJBuildInfo parse(String data) { | ||||
| VAJBuildInfo result = new VAJBuildInfo(); | VAJBuildInfo result = new VAJBuildInfo(); | ||||
| @@ -71,24 +71,24 @@ import java.io.File; | |||||
| * <tr> | * <tr> | ||||
| * <td>dir</td> | * <td>dir</td> | ||||
| * <td>Any valid directory name on the server.</td> | * <td>Any valid directory name on the server.</td> | ||||
| * <td>The directory to export the files to on the machine | |||||
| * where the servlet is being run. If the directory | |||||
| * <td>The directory to export the files to on the machine | |||||
| * where the servlet is being run. If the directory | |||||
| * doesn't exist, it will be created.<p> | * doesn't exist, it will be created.<p> | ||||
| * Relative paths are relative to | |||||
| * IBMVJava/ide/tools/com-ibm-ivj-toolserver, | |||||
| * where IBMVJava is the VisualAge for Java installation | |||||
| * Relative paths are relative to | |||||
| * IBMVJava/ide/tools/com-ibm-ivj-toolserver, | |||||
| * where IBMVJava is the VisualAge for Java installation | |||||
| * directory.</td> | * directory.</td> | ||||
| * </tr> | * </tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>include</td> | * <td>include</td> | ||||
| * <td>See below.</td> | * <td>See below.</td> | ||||
| * <td>The pattern used to indicate which projects and | |||||
| * <td>The pattern used to indicate which projects and | |||||
| * packages to export.</td> | * packages to export.</td> | ||||
| * </tr> | * </tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>exclude</td> | * <td>exclude</td> | ||||
| * <td>See below</td> | * <td>See below</td> | ||||
| * <td>The pattern used to indicate which projects and | |||||
| * <td>The pattern used to indicate which projects and | |||||
| * packages <em>not</em> to export.</td> | * packages <em>not</em> to export.</td> | ||||
| * </tr> | * </tr> | ||||
| * <tr> | * <tr> | ||||
| @@ -110,7 +110,7 @@ import java.io.File; | |||||
| * <tr> | * <tr> | ||||
| * <td>dex</td> | * <td>dex</td> | ||||
| * <td>"yes" or "no" (without the quotes)</td> | * <td>"yes" or "no" (without the quotes)</td> | ||||
| * <td>Use the default exclusion patterns. Defaults to "yes". | |||||
| * <td>Use the default exclusion patterns. Defaults to "yes". | |||||
| * See below for an explanation of default excludes.</td> | * See below for an explanation of default excludes.</td> | ||||
| * </tr> | * </tr> | ||||
| * <tr> | * <tr> | ||||
| @@ -120,11 +120,11 @@ import java.io.File; | |||||
| * </tr> | * </tr> | ||||
| * </table> | * </table> | ||||
| * | * | ||||
| * <p>The vajexport servlet uses include and exclude parameters to form | |||||
| * the criteria for selecting packages to export. The parameter is | |||||
| * broken up into ProjectName/packageNameSegments, where ProjectName | |||||
| * is what you expect, and packageNameSegments is a partial (or complete) | |||||
| * package name, separated by forward slashes, rather than periods. | |||||
| * <p>The vajexport servlet uses include and exclude parameters to form | |||||
| * the criteria for selecting packages to export. The parameter is | |||||
| * broken up into ProjectName/packageNameSegments, where ProjectName | |||||
| * is what you expect, and packageNameSegments is a partial (or complete) | |||||
| * package name, separated by forward slashes, rather than periods. | |||||
| * Each packageNameSegment can have wildcard characters.</p> | * Each packageNameSegment can have wildcard characters.</p> | ||||
| * | * | ||||
| * <table border="1"> | * <table border="1"> | ||||
| @@ -94,10 +94,10 @@ public class VAJImportServlet extends VAJToolsServlet { | |||||
| getBooleanParam(CLASSES_PARAM, false), | getBooleanParam(CLASSES_PARAM, false), | ||||
| getBooleanParam(RESOURCES_PARAM, true), | getBooleanParam(RESOURCES_PARAM, true), | ||||
| getBooleanParam(SOURCES_PARAM, true), | getBooleanParam(SOURCES_PARAM, true), | ||||
| false); | |||||
| false); | |||||
| // no default excludes, because they | // no default excludes, because they | ||||
| // are already added on client side | // are already added on client side | ||||
| // getBooleanParam(DEFAULT_EXCLUDES_PARAM, true) | // getBooleanParam(DEFAULT_EXCLUDES_PARAM, true) | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
| * | * | ||||
| * Copyright (c) 2001-2003 The Apache Software Foundation. All rights | |||||
| * Copyright (c) 2001-2003 The Apache Software Foundation. All rights | |||||
| * reserved. | * reserved. | ||||
| * | * | ||||
| * Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
| @@ -66,7 +66,7 @@ import org.apache.tools.ant.BuildException; | |||||
| * <li>* (loads the latest <b>versioned</b> edition)</li> | * <li>* (loads the latest <b>versioned</b> edition)</li> | ||||
| * <li>** (loads the latest edition, including open editions)</li> | * <li>** (loads the latest edition, including open editions)</li> | ||||
| * </ul> | * </ul> | ||||
| * Example: | |||||
| * Example: | |||||
| * <blockquote> | * <blockquote> | ||||
| * <vajload> | * <vajload> | ||||
| * <project name="MyVAProject" version="*"/> | * <project name="MyVAProject" version="*"/> | ||||
| @@ -1,7 +1,7 @@ | |||||
| /* | /* | ||||
| * The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
| * | * | ||||
| * Copyright (c) 2001-2002 The Apache Software Foundation. All rights | |||||
| * Copyright (c) 2001-2002 The Apache Software Foundation. All rights | |||||
| * reserved. | * reserved. | ||||
| * | * | ||||
| * Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
| @@ -75,7 +75,7 @@ public class VAJLoadProjects extends VAJLoad { | |||||
| @@ -58,7 +58,7 @@ import java.util.Vector; | |||||
| /** | /** | ||||
| * A Remote Access to Tools Servlet to load a Project | * A Remote Access to Tools Servlet to load a Project | ||||
| * from the Repository into the Workbench. The following | |||||
| * from the Repository into the Workbench. The following | |||||
| * table describes the servlet parameters. | * table describes the servlet parameters. | ||||
| * | * | ||||
| * <table> | * <table> | ||||
| @@ -77,7 +77,7 @@ import java.util.Vector; | |||||
| * the Workbench.</td> | * the Workbench.</td> | ||||
| * </tr> | * </tr> | ||||
| * </table> | * </table> | ||||
| * | |||||
| * | |||||
| * @author Wolf Siberski, based on servlets written by Glenn McAllister | * @author Wolf Siberski, based on servlets written by Glenn McAllister | ||||
| */ | */ | ||||
| public class VAJLoadServlet extends VAJToolsServlet { | public class VAJLoadServlet extends VAJToolsServlet { | ||||
| @@ -78,7 +78,7 @@ import org.apache.tools.ant.DirectoryScanner; | |||||
| * @author Wolf Siberski, TUI Infotec GmbH | * @author Wolf Siberski, TUI Infotec GmbH | ||||
| * @author Martin Landers, Beck et al. projects | * @author Martin Landers, Beck et al. projects | ||||
| */ | */ | ||||
| abstract class VAJLocalUtil implements VAJUtil{ | |||||
| abstract class VAJLocalUtil implements VAJUtil { | |||||
| // singleton containing the VAJ workspace | // singleton containing the VAJ workspace | ||||
| private static Workspace workspace; | private static Workspace workspace; | ||||
| @@ -126,12 +126,11 @@ abstract class VAJLocalUtil implements VAJUtil{ | |||||
| /** | /** | ||||
| * export packages | * export packages | ||||
| */ | */ | ||||
| public void exportPackages( | |||||
| File dest, | |||||
| public void exportPackages(File dest, | |||||
| String[] includePatterns, String[] excludePatterns, | String[] includePatterns, String[] excludePatterns, | ||||
| boolean exportClasses, boolean exportDebugInfo, | boolean exportClasses, boolean exportDebugInfo, | ||||
| boolean exportResources, boolean exportSources, | boolean exportResources, boolean exportSources, | ||||
| boolean useDefaultExcludes, boolean overwrite) { | |||||
| boolean useDefaultExcludes, boolean overwrite) { | |||||
| if (includePatterns == null || includePatterns.length == 0) { | if (includePatterns == null || includePatterns.length == 0) { | ||||
| log("You must specify at least one include attribute. " | log("You must specify at least one include attribute. " | ||||
| + "Not exporting", MSG_ERR); | + "Not exporting", MSG_ERR); | ||||
| @@ -197,16 +196,18 @@ abstract class VAJLocalUtil implements VAJUtil{ | |||||
| VAJProjectDescription d = (VAJProjectDescription) e.nextElement(); | VAJProjectDescription d = (VAJProjectDescription) e.nextElement(); | ||||
| ProjectEdition pe; | ProjectEdition pe; | ||||
| if (d.getVersion().equals("*")) | |||||
| if (d.getVersion().equals("*")) { | |||||
| pe = findLatestProjectEdition(d.getName(), false); | pe = findLatestProjectEdition(d.getName(), false); | ||||
| else if (d.getVersion().equals("**")) | |||||
| } else if (d.getVersion().equals("**")) { | |||||
| pe = findLatestProjectEdition(d.getName(), true); | pe = findLatestProjectEdition(d.getName(), true); | ||||
| else | |||||
| } else { | |||||
| pe = findProjectEdition(d.getName(), d.getVersion()); | pe = findProjectEdition(d.getName(), d.getVersion()); | ||||
| } | |||||
| try { | try { | ||||
| log("Loading '" + pe.getName() + "', Version '" + | |||||
| ((pe.getVersionName() != null)?pe.getVersionName():"("+pe.getVersionStamp()+ ")")+ | |||||
| "' into Workspace", MSG_VERBOSE); | |||||
| log("Loading '" + pe.getName() + "', Version '" | |||||
| + ((pe.getVersionName() != null) ? pe.getVersionName() | |||||
| : "("+pe.getVersionStamp()+ ")") | |||||
| + "' into Workspace", MSG_VERBOSE); | |||||
| pe.loadIntoWorkspace(); | pe.loadIntoWorkspace(); | ||||
| } catch (IvjException ex) { | } catch (IvjException ex) { | ||||
| throw createBuildException("Project '" + d.getName() | throw createBuildException("Project '" + d.getName() | ||||
| @@ -231,8 +232,8 @@ abstract class VAJLocalUtil implements VAJUtil{ | |||||
| String pattern = d.getName(); | String pattern = d.getName(); | ||||
| if (VAJWorkspaceScanner.match(pattern, projectNames[i])) { | if (VAJWorkspaceScanner.match(pattern, projectNames[i])) { | ||||
| d.setProjectFound(); | d.setProjectFound(); | ||||
| expandedDescs.addElement(new VAJProjectDescription( | |||||
| projectNames[i], d.getVersion())); | |||||
| expandedDescs.addElement(new VAJProjectDescription(projectNames[i], | |||||
| d.getVersion())); | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -298,10 +299,12 @@ abstract class VAJLocalUtil implements VAJUtil{ | |||||
| // find latest (versioned) project edition by date | // find latest (versioned) project edition by date | ||||
| ProjectEdition pe = null; | ProjectEdition pe = null; | ||||
| Date latestStamp = new Date(0); // Let's hope there are no projects older than the epoch ;-) | |||||
| // Let's hope there are no projects older than the epoch ;-) | |||||
| Date latestStamp = new Date(0); | |||||
| for (int i = 0; i < editions.length; i++) { | for (int i = 0; i < editions.length; i++) { | ||||
| if (!includeOpenEditions && !editions[i].isVersion()) | |||||
| if (!includeOpenEditions && !editions[i].isVersion()) { | |||||
| continue; | continue; | ||||
| } | |||||
| if (latestStamp.before(editions[i].getVersionStamp())) { | if (latestStamp.before(editions[i].getVersionStamp())) { | ||||
| latestStamp = editions[i].getVersionStamp(); | latestStamp = editions[i].getVersionStamp(); | ||||
| pe = editions[i]; | pe = editions[i]; | ||||
| @@ -311,8 +314,9 @@ abstract class VAJLocalUtil implements VAJUtil{ | |||||
| if (pe == null) { | if (pe == null) { | ||||
| throw new BuildException("Can't determine latest edition for project " + name); | throw new BuildException("Can't determine latest edition for project " + name); | ||||
| } | } | ||||
| log("Using version " + ((pe.getVersionName() != null)?pe.getVersionName():"("+pe.getVersionStamp()+ ")") + | |||||
| " of " + pe.getName(), MSG_INFO); | |||||
| log("Using version " + ((pe.getVersionName() != null) ? pe.getVersionName() | |||||
| : "("+pe.getVersionStamp()+ ")") | |||||
| + " of " + pe.getName(), MSG_INFO); | |||||
| return pe; | return pe; | ||||
| } catch (IvjException e) { | } catch (IvjException e) { | ||||
| throw createBuildException("VA Exception occured: ", e); | throw createBuildException("VA Exception occured: ", e); | ||||
| @@ -108,7 +108,7 @@ public class VAJProjectDescription { | |||||
| /** | /** | ||||
| * this may be a helper method, and is being ignored for now | * this may be a helper method, and is being ignored for now | ||||
| * @ant.attribute ignore="true" | * @ant.attribute ignore="true" | ||||
| */ | */ | ||||
| public void setProjectFound() { | public void setProjectFound() { | ||||
| @@ -74,7 +74,7 @@ import org.apache.tools.ant.Task; | |||||
| * @author Wolf Siberski, TUI Infotec GmbH | * @author Wolf Siberski, TUI Infotec GmbH | ||||
| * @author Martin Landers, Beck et al. projects | * @author Martin Landers, Beck et al. projects | ||||
| */ | */ | ||||
| class VAJRemoteUtil implements VAJUtil{ | |||||
| class VAJRemoteUtil implements VAJUtil { | |||||
| // calling task | // calling task | ||||
| Task caller; | Task caller; | ||||
| @@ -91,8 +91,9 @@ class VAJRemoteUtil implements VAJUtil{ | |||||
| */ | */ | ||||
| public void exportPackages(File destDir, | public void exportPackages(File destDir, | ||||
| String[] includePatterns, String[] excludePatterns, | String[] includePatterns, String[] excludePatterns, | ||||
| boolean exportClasses, boolean exportDebugInfo, boolean exportResources, | |||||
| boolean exportSources, boolean useDefaultExcludes, boolean overwrite) { | |||||
| boolean exportClasses, boolean exportDebugInfo, | |||||
| boolean exportResources, boolean exportSources, | |||||
| boolean useDefaultExcludes, boolean overwrite) { | |||||
| try { | try { | ||||
| String request = "http://" + remoteServer + "/servlet/vajexport?" | String request = "http://" + remoteServer + "/servlet/vajexport?" | ||||
| + VAJExportServlet.WITH_DEBUG_INFO + "=" + exportDebugInfo + "&" | + VAJExportServlet.WITH_DEBUG_INFO + "=" + exportDebugInfo + "&" | ||||
| @@ -148,13 +149,13 @@ class VAJRemoteUtil implements VAJUtil{ | |||||
| + VAJToolsServlet.DEFAULT_EXCLUDES_PARAM + "=" + useDefaultExcludes; | + VAJToolsServlet.DEFAULT_EXCLUDES_PARAM + "=" + useDefaultExcludes; | ||||
| if (includePatterns != null) { | if (includePatterns != null) { | ||||
| for (int i = 0; i < includePatterns.length; i++){ | |||||
| for (int i = 0; i < includePatterns.length; i++) { | |||||
| result = result + "&" + VAJExportServlet.INCLUDE_PARAM + "=" | result = result + "&" + VAJExportServlet.INCLUDE_PARAM + "=" | ||||
| + URLEncoder.encode(includePatterns[i]); | + URLEncoder.encode(includePatterns[i]); | ||||
| } | } | ||||
| } | } | ||||
| if (excludePatterns != null) { | if (excludePatterns != null) { | ||||
| for (int i = 0; i < excludePatterns.length; i++){ | |||||
| for (int i = 0; i < excludePatterns.length; i++) { | |||||
| result = result + "&" + VAJExportServlet.EXCLUDE_PARAM + "=" | result = result + "&" + VAJExportServlet.EXCLUDE_PARAM + "=" | ||||
| + URLEncoder.encode(excludePatterns[i]); | + URLEncoder.encode(excludePatterns[i]); | ||||
| } | } | ||||
| @@ -213,6 +214,7 @@ class VAJRemoteUtil implements VAJUtil{ | |||||
| is = connection.getInputStream(); | is = connection.getInputStream(); | ||||
| break; | break; | ||||
| } catch (IOException ex) { | } catch (IOException ex) { | ||||
| // ignore | |||||
| } | } | ||||
| } | } | ||||
| if (is == null) { | if (is == null) { | ||||
| @@ -65,11 +65,11 @@ import java.util.Vector; | |||||
| */ | */ | ||||
| interface VAJUtil { | interface VAJUtil { | ||||
| // log levels | // log levels | ||||
| public static final int MSG_DEBUG = 4; | |||||
| public static final int MSG_ERR = 0; | |||||
| public static final int MSG_INFO = 2; | |||||
| public static final int MSG_VERBOSE = 3; | |||||
| public static final int MSG_WARN = 1; | |||||
| static final int MSG_DEBUG = 4; | |||||
| static final int MSG_ERR = 0; | |||||
| static final int MSG_INFO = 2; | |||||
| static final int MSG_VERBOSE = 3; | |||||
| static final int MSG_WARN = 1; | |||||
| /** | /** | ||||
| * export the array of Packages | * export the array of Packages | ||||