*** empty log message ***
diff --git a/ant/org.eclipse.ant.ui/.classpath b/ant/org.eclipse.ant.ui/.classpath index b07cb74..f250af5 100644 --- a/ant/org.eclipse.ant.ui/.classpath +++ b/ant/org.eclipse.ant.ui/.classpath
@@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> - <classpathentry kind="src" path="/org.eclipse.core.boot"/> - <classpathentry kind="src" path="/org.eclipse.core.runtime"/> - <classpathentry kind="src" path="/org.eclipse.core.resources"/> - <classpathentry kind="src" path="/org.eclipse.ant.core"/> <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="/org.eclipse.swt"/> - <classpathentry kind="src" path="/org.eclipse.ui"/> + <classpathentry kind="src" path="src_ant"/> <classpathentry kind="src" path="/org.apache.ant"/> + <classpathentry kind="src" path="/org.eclipse.ant.core"/> + <classpathentry kind="src" path="/org.eclipse.core.resources"/> + <classpathentry kind="src" path="/org.eclipse.ui"/> + <classpathentry kind="src" path="/org.eclipse.core.runtime"/> + <classpathentry kind="src" path="/org.eclipse.core.boot"/> + <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/ant/org.eclipse.ant.ui/.project b/ant/org.eclipse.ant.ui/.project index 867b127..a05291f 100644 --- a/ant/org.eclipse.ant.ui/.project +++ b/ant/org.eclipse.ant.ui/.project
@@ -1,25 +1,24 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.ant.ui</name> - <comment></comment> - <projects> - <project>org.apache.ant</project> - <project>org.eclipse.ant.core</project> - <project>org.eclipse.core.boot</project> - <project>org.eclipse.core.resources</project> - <project>org.eclipse.core.runtime</project> - <project>org.eclipse.swt</project> - <project>org.eclipse.ui</project> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.team.cvs.core.cvsnature</nature> - </natures> -</projectDescription> +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.ant.ui</name> + <comment></comment> + <projects> + <project>org.apache.ant</project> + <project>org.eclipse.ant.core</project> + <project>org.eclipse.core.boot</project> + <project>org.eclipse.core.resources</project> + <project>org.eclipse.core.runtime</project> + <project>org.eclipse.ui</project> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.team.cvs.core.cvsnature</nature> + </natures> +</projectDescription>
diff --git a/ant/org.eclipse.ant.ui/build.properties b/ant/org.eclipse.ant.ui/build.properties index 4b8a87b..bbb0319 100644 --- a/ant/org.eclipse.ant.ui/build.properties +++ b/ant/org.eclipse.ant.ui/build.properties
@@ -1,3 +1,6 @@ -source.antui.jar=src/ -bin.includes=icons/,plugin.xml,*.jar,plugin.properties,about.html -javadoc.packages=org.eclipse.* +custom = true + +source.antui.jar=src/ +source.lib/antuilib.jar=src_ant/ +bin.includes=icons/,plugin.xml,*.jar,plugin.properties,about.html,lib/ +javadoc.packages=org.eclipse.* \ No newline at end of file
diff --git a/ant/org.eclipse.ant.ui/build.xml b/ant/org.eclipse.ant.ui/build.xml new file mode 100644 index 0000000..9e33740 --- /dev/null +++ b/ant/org.eclipse.ant.ui/build.xml
@@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="org.eclipse.ant.ui" default="build.jars" basedir="."> + + <target name="initTemplate" unless="template"> + <initTemplate/> + </target> + + <target name="init" depends="initTemplate, properties"> + </target> + + <target name="build.update.jar" depends="init"> + <property name="base" value="${basedir}/bin.zip.pdetemp"/> + <delete dir="${base}"/> + <mkdir dir="${base}"/> + <antcall target="build.jars"/> + <antcall target="gather.bin.parts"> + <param name="destination" value="${base}/"/> + </antcall> + <delete> + <fileset dir="${base}" includes="**/*.bin.log"/> + </delete> + <zip zipfile="${basedir}/${plugin}_${version}.jar" basedir="${base}/plugins/${plugin}"/> + <delete dir="${base}"/> + </target> + + <target name="gather.bin.parts" depends="init" if="destination"> + <ant antfile="${template}" target="includesExcludesCopy"> + <property name="srcdir" value="${basedir}"/> + <property name="dest" value="${destination}/plugins/${plugin}"/> + <property name="excludes" value="${bin.excludes}"/> + <property name="includes" value="${bin.includes}"/> + </ant> + </target> + + <target name="lib/antuilib.jar" depends="init"> + <ant antfile="${template}" target="jar"> + <property name="dest" value="${basedir}/lib/antuilib.jar"/> + <property name="srcdir" value="${basedir}"/> + <property name="includes" value="src_ant/"/> + <property name="excludes" value=""/> + <property name="mapping" value="src_ant/"/> + <property name="compilePath" value="${location.org.eclipse.core.runtime}/bin;${location.org.eclipse.core.runtime}/runtime.jar;${location.org.eclipse.core.boot}/bin;${location.org.eclipse.core.boot}/boot.jar;${location.org.eclipse.ant.ui}/bin;${location.org.eclipse.ant.ui}/antui.jar;${location.org.apache.ant}/bin;${location.org.apache.ant}/ant.jar;${location.org.apache.ant}/jakarta-ant-1.4.1-optional.jar;${location.org.apache.xerces}/bin;${location.org.apache.xerces}/xerces.jar;${location.org.eclipse.ant.core}/bin;${location.org.eclipse.ant.core}/antsupport.jar;${location.org.eclipse.core.resources}/bin;${location.org.eclipse.core.resources}/resources.jar;${location.org.eclipse.ui}/bin;${location.org.eclipse.ui}/workbench.jar;${location.org.eclipse.help}/bin;${location.org.eclipse.help}/help.jar;${location.org.apache.lucene}/bin;${location.org.apache.lucene}/lucene-1.2-rc2.jar;${location.org.apache.lucene}/lucenedemo.zip;${location.org.eclipse.swt}/bin;${location.org.eclipse.swt}/ws/${ws}/swt-pi.jar;${location.org.eclipse.swt}/ws/${ws}/swt.jar"/> + </ant> + </target> + + <target name="antui.jar" depends="init"> + <ant antfile="${template}" target="jar"> + <property name="dest" value="${basedir}/antui.jar"/> + <property name="srcdir" value="${basedir}"/> + <property name="includes" value="src/"/> + <property name="excludes" value=""/> + <property name="mapping" value="src/"/> + <property name="compilePath" value="${location.org.eclipse.core.runtime}/bin;${location.org.eclipse.core.runtime}/runtime.jar;${location.org.eclipse.core.boot}/bin;${location.org.eclipse.core.boot}/boot.jar;${location.org.eclipse.ant.ui}/bin;${location.org.eclipse.ant.ui}/antui.jar;${location.org.apache.ant}/bin;${location.org.apache.ant}/ant.jar;${location.org.apache.ant}/jakarta-ant-1.4.1-optional.jar;${location.org.apache.xerces}/bin;${location.org.apache.xerces}/xerces.jar;${location.org.eclipse.ant.core}/bin;${location.org.eclipse.ant.core}/antsupport.jar;${location.org.eclipse.core.resources}/bin;${location.org.eclipse.core.resources}/resources.jar;${location.org.eclipse.ui}/bin;${location.org.eclipse.ui}/workbench.jar;${location.org.eclipse.help}/bin;${location.org.eclipse.help}/help.jar;${location.org.apache.lucene}/bin;${location.org.apache.lucene}/lucene-1.2-rc2.jar;${location.org.apache.lucene}/lucenedemo.zip;${location.org.eclipse.swt}/bin;${location.org.eclipse.swt}/ws/${ws}/swt-pi.jar;${location.org.eclipse.swt}/ws/${ws}/swt.jar"/> + </ant> + </target> + + <target name="build.jars" depends="init,antui.jar,lib/antuilib.jar"> + </target> + + <target name="build.zips" depends="init"> + </target> + + <target name="gather.sources" depends="init" if="destination"> + <mkdir dir="${destination}/plugins/${plugin}/lib"/> + <copy file="${basedir}/lib/antuilibsrc.zip" todir="${destination}/plugins/${plugin}/lib"/> + <mkdir dir="${destination}/plugins/${plugin}"/> + <copy file="${basedir}/antuisrc.zip" todir="${destination}/plugins/${plugin}"/> + </target> + + <target name="lib/antuilibsrc.zip" depends="init"> + <ant antfile="${template}" target="src"> + <property name="srcdir" value="${basedir}"/> + <property name="mapping" value="src_ant/"/> + <property name="dest" value="${basedir}/lib/antuilibsrc.zip"/> + <property name="excludes" value=""/> + <property name="includes" value="src_ant/**/*.java"/> + </ant> + </target> + + <target name="antuisrc.zip" depends="init"> + <ant antfile="${template}" target="src"> + <property name="srcdir" value="${basedir}"/> + <property name="mapping" value="src/"/> + <property name="dest" value="${basedir}/antuisrc.zip"/> + <property name="excludes" value=""/> + <property name="includes" value="src/**/*.java"/> + </ant> + </target> + + <target name="build.sources" depends="init,lib/antuilibsrc.zip,antuisrc.zip"> + </target> + + <target name="gather.logs" depends="init"> + <mkdir dir="${destination}/plugins/${plugin}/lib"/> + <copy file="${basedir}/lib/antuilib.jar.bin.log" todir="${destination}/plugins/${plugin}/lib"/> + <mkdir dir="${destination}/plugins/${plugin}"/> + <copy file="${basedir}/antui.jar.bin.log" todir="${destination}/plugins/${plugin}"/> + </target> + + <target name="clean" depends="init"> + <delete> + <fileset dir="${basedir}" includes="*.bin"/> + <fileset dir="${basedir}" includes="**/*.log"/> + <fileset dir="${basedir}" includes="lib/antuilib.jar,antui.jar"/> + <fileset dir="${basedir}" includes="lib/antuilibsrc.zip,antuisrc.zip"/> + <fileset dir="${basedir}" includes="**/*.pdetemp"/> + </delete> + <delete file="${plugin}_${version}.jar"/> + <delete file="${plugin}_${version}.src.zip"/> + <delete file="${plugin}_${version}.log.zip"/> + </target> + + <target name="properties"> + <property name="plugin" value="org.eclipse.ant.ui"/> + <property name="version" value="2.0.2"/> + <pluginLocation plugin="org.eclipse.swt" property="location.org.eclipse.swt"/> + <pluginLocation plugin="org.apache.ant" property="location.org.apache.ant"/> + <pluginLocation plugin="org.eclipse.ant.core" property="location.org.eclipse.ant.core"/> + <pluginLocation plugin="org.eclipse.ant.ui" property="location.org.eclipse.ant.ui"/> + <pluginLocation plugin="org.eclipse.ui" property="location.org.eclipse.ui"/> + <pluginLocation plugin="org.eclipse.help" property="location.org.eclipse.help"/> + <pluginLocation plugin="org.eclipse.core.boot" property="location.org.eclipse.core.boot"/> + <pluginLocation plugin="org.apache.lucene" property="location.org.apache.lucene"/> + <pluginLocation plugin="org.eclipse.core.runtime" property="location.org.eclipse.core.runtime"/> + <pluginLocation plugin="org.apache.xerces" property="location.org.apache.xerces"/> + <pluginLocation plugin="org.eclipse.core.resources" property="location.org.eclipse.core.resources"/> + <property name="bin.includes" value="icons/,plugin.xml,*.jar,plugin.properties,about.html,lib/"/> + <property name="bin.excludes" value="src/,src_ant/"/> + </target> + +</project> \ No newline at end of file
diff --git a/ant/org.eclipse.ant.ui/src_ant/org/eclipse/ant/internal/ui/ant/UIBuildLogger.java b/ant/org.eclipse.ant.ui/src_ant/org/eclipse/ant/internal/ui/ant/UIBuildLogger.java new file mode 100644 index 0000000..feb29bd --- /dev/null +++ b/ant/org.eclipse.ant.ui/src_ant/org/eclipse/ant/internal/ui/ant/UIBuildLogger.java
@@ -0,0 +1,164 @@ +package org.eclipse.ant.internal.ui.ant; + +import java.io.PrintStream; +import java.util.Iterator; +import java.util.Vector; + +import org.apache.tools.ant.*; +import org.eclipse.ant.internal.ui.*; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.swt.widgets.Display; + +public class UIBuildLogger implements BuildLogger { + + protected int priorityFilter = Project.MSG_INFO; + protected IProgressMonitor monitor; + private int logLength = 0; + private int lastTargetEndIndex = 0; + +public UIBuildLogger() { + AntUIPlugin plugin = AntUIPlugin.getPlugin(); + this.monitor = Policy.monitorFor(plugin.getCurrentProgressMonitor()); +} + +/** + * @see BuildListener#buildStarted(BuildEvent) + */ +public void buildStarted(BuildEvent event) { + checkCanceled(); +} + +/** + * @see BuildListener#buildFinished(BuildEvent) + */ +public void buildFinished(BuildEvent event) { + checkCanceled(); + monitor.done(); + handleException(event); +} + +protected void handleException(BuildEvent event) { + Throwable exception = event.getException(); + if (exception == null) + return; + logMessage(Policy.bind("exception.buildException", exception.toString()), Project.MSG_ERR); +} + +/** + * @see BuildListener#targetStarted(BuildEvent) + */ +public void targetStarted(BuildEvent event) { + checkCanceled(); + createNewOutputStructureElement(event.getTarget().getName(), logLength); +} + +protected void refreshConsoleTrees() { + final Vector consoles = AntConsole.getInstances(); + if (consoles.size() == 0) + return; + // we get the display from the console #0 (that exists for sure because consoles!=null) + Display display = ((AntConsole) consoles.get(0)).getSite().getShell().getDisplay(); + // create a new thread for synchronizing all the refresh operations + display.syncExec(new Runnable() { + public void run() { + for (Iterator iterator = consoles.iterator(); iterator.hasNext();) { + AntConsole console = (AntConsole) iterator.next(); + console.refreshTree(); + } + } + }); +} + +protected void createNewOutputStructureElement(String name, int index) { + for (Iterator iterator = AntConsole.getInstances().iterator(); iterator.hasNext();) { + AntConsole console = (AntConsole) iterator.next(); + OutputStructureElement newElement = new OutputStructureElement(name, console.getCurrentOutputStructureElement(), index); + console.setCurrentOutputStructureElement(newElement); + } +} + +/** + * @see BuildListener#targetFinished(BuildEvent) + */ +public void targetFinished(BuildEvent event) { + checkCanceled(); + monitor.worked(1); + handleException(event); + finishCurrentOutputStructureElement(); + // store the end index of this target's log (so that we can use it later) + lastTargetEndIndex = logLength; + refreshConsoleTrees(); +} + +/** + * @see BuildListener#taskStarted(BuildEvent) + */ +public void taskStarted(BuildEvent event) { + checkCanceled(); + createNewOutputStructureElement(event.getTask().getTaskName()); +} + +/** + * @see BuildListener#taskFinished(BuildEvent) + */ +public void taskFinished(BuildEvent event) { + checkCanceled(); + handleException(event); + finishCurrentOutputStructureElement(); + refreshConsoleTrees(); +} + +/** + * @see BuildListener#messageLogged(BuildEvent) + */ +public void messageLogged(BuildEvent event) { + checkCanceled(); + logMessage(event.getMessage(), event.getPriority()); +} + +protected void logMessage(String message, int priority) { + if (priority > priorityFilter) + return; + message += '\n'; + for (Iterator iterator = AntConsole.getInstances().iterator(); iterator.hasNext();) { + AntConsole console = (AntConsole) iterator.next(); + console.append(message, priority); + } + logLength += message.length(); +} + +protected void finishCurrentOutputStructureElement() { + for (Iterator iterator = AntConsole.getInstances().iterator(); iterator.hasNext();) { + AntConsole console = (AntConsole) iterator.next(); + // sets the index that indicates the end of the log part linked to this element + OutputStructureElement output = console.getCurrentOutputStructureElement(); + output.setEndIndex(logLength); + // and sets the current element to the parent of the element + console.setCurrentOutputStructureElement(output.getParent()); + } +} + +protected void checkCanceled() { + if (monitor == null) + return; + if (monitor.isCanceled()) + throw new BuildCanceledException(); +} + +protected void createNewOutputStructureElement(String name) { + createNewOutputStructureElement(name, logLength); +} + +public void setMessageOutputLevel(int level) { + this.priorityFilter = level; +} + +public void setEmacsMode(boolean emacsMode) { +} + +public void setErrorPrintStream(PrintStream err) { +} + +public void setOutputPrintStream(PrintStream output) { +} +} \ No newline at end of file