git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277929 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -1,5 +1,5 @@ | |||||
| /* | /* | ||||
| * Copyright 2001-2004 The Apache Software Foundation | |||||
| * Copyright 2001-2005 The Apache Software Foundation | |||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| @@ -39,7 +39,7 @@ public abstract class Pack extends Task { | |||||
| /** | /** | ||||
| * the required destination file. | * the required destination file. | ||||
| * @param zipFile | |||||
| * @param zipFile the destination file | |||||
| */ | */ | ||||
| public void setZipfile(File zipFile) { | public void setZipfile(File zipFile) { | ||||
| this.zipFile = zipFile; | this.zipFile = zipFile; | ||||
| @@ -47,7 +47,7 @@ public abstract class Pack extends Task { | |||||
| /** | /** | ||||
| * the required destination file. | * the required destination file. | ||||
| * @param zipFile | |||||
| * @param zipFile the destination file | |||||
| */ | */ | ||||
| public void setDestfile(File zipFile) { | public void setDestfile(File zipFile) { | ||||
| setZipfile(zipFile); | setZipfile(zipFile); | ||||
| @@ -55,7 +55,7 @@ public abstract class Pack extends Task { | |||||
| /** | /** | ||||
| * the file to compress; required. | * the file to compress; required. | ||||
| * @param src | |||||
| * @param src the source file | |||||
| */ | */ | ||||
| public void setSrc(File src) { | public void setSrc(File src) { | ||||
| source = src; | source = src; | ||||
| @@ -88,7 +88,7 @@ public abstract class Pack extends Task { | |||||
| /** | /** | ||||
| * validate, then hand off to the subclass | * validate, then hand off to the subclass | ||||
| * @throws BuildException | |||||
| * @throws BuildException on error | |||||
| */ | */ | ||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| validate(); | validate(); | ||||
| @@ -107,8 +107,8 @@ public abstract class Pack extends Task { | |||||
| /** | /** | ||||
| * zip a stream to an output stream | * zip a stream to an output stream | ||||
| * @param in | |||||
| * @param zOut | |||||
| * @param in the stream to zip | |||||
| * @param zOut the output stream | |||||
| * @throws IOException | * @throws IOException | ||||
| */ | */ | ||||
| private void zipFile(InputStream in, OutputStream zOut) | private void zipFile(InputStream in, OutputStream zOut) | ||||
| @@ -123,9 +123,9 @@ public abstract class Pack extends Task { | |||||
| /** | /** | ||||
| * zip a file to an output stream | * zip a file to an output stream | ||||
| * @param file | |||||
| * @param zOut | |||||
| * @throws IOException | |||||
| * @param file the file to zip | |||||
| * @param zOut the output stream | |||||
| * @throws IOException on error | |||||
| */ | */ | ||||
| protected void zipFile(File file, OutputStream zOut) | protected void zipFile(File file, OutputStream zOut) | ||||
| throws IOException { | throws IOException { | ||||
| @@ -1,5 +1,5 @@ | |||||
| /* | /* | ||||
| * Copyright 2000-2004 The Apache Software Foundation | |||||
| * Copyright 2000-2005 The Apache Software Foundation | |||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| @@ -81,11 +81,16 @@ public class Property extends Task { | |||||
| protected boolean userProperty; // set read-only properties | protected boolean userProperty; // set read-only properties | ||||
| /** | |||||
| * Constructor for Property. | |||||
| */ | |||||
| public Property() { | public Property() { | ||||
| this(false); | this(false); | ||||
| } | } | ||||
| /** | /** | ||||
| * Constructor for Property. | |||||
| * @param userProperty if true this is a user property | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| protected Property(boolean userProperty) { | protected Property(boolean userProperty) { | ||||
| @@ -93,6 +98,10 @@ public class Property extends Task { | |||||
| } | } | ||||
| /** | /** | ||||
| * Constructor for Property. | |||||
| * @param userProperty if true this is a user property | |||||
| * @param fallback a project to use to look for references if the reference is | |||||
| * not in the current project | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| protected Property(boolean userProperty, Project fallback) { | protected Property(boolean userProperty, Project fallback) { | ||||
| @@ -108,6 +117,10 @@ public class Property extends Task { | |||||
| this.name = name; | this.name = name; | ||||
| } | } | ||||
| /** | |||||
| * Get the property name. | |||||
| * @return the property name | |||||
| */ | |||||
| public String getName() { | public String getName() { | ||||
| return name; | return name; | ||||
| } | } | ||||
| @@ -136,6 +149,10 @@ public class Property extends Task { | |||||
| this.value = value; | this.value = value; | ||||
| } | } | ||||
| /** | |||||
| * Get the property value. | |||||
| * @return the property value | |||||
| */ | |||||
| public String getValue() { | public String getValue() { | ||||
| return value; | return value; | ||||
| } | } | ||||
| @@ -150,6 +167,10 @@ public class Property extends Task { | |||||
| this.file = file; | this.file = file; | ||||
| } | } | ||||
| /** | |||||
| * Get the file attribute. | |||||
| * @return the file attribute | |||||
| */ | |||||
| public File getFile() { | public File getFile() { | ||||
| return file; | return file; | ||||
| } | } | ||||
| @@ -164,6 +185,10 @@ public class Property extends Task { | |||||
| this.url = url; | this.url = url; | ||||
| } | } | ||||
| /** | |||||
| * Get the url attribute. | |||||
| * @return the url attribute | |||||
| */ | |||||
| public URL getUrl() { | public URL getUrl() { | ||||
| return url; | return url; | ||||
| } | } | ||||
| @@ -183,6 +208,8 @@ public class Property extends Task { | |||||
| } | } | ||||
| /** | /** | ||||
| * Get the prefix attribute. | |||||
| * @return the prefix attribute | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| public String getPrefix() { | public String getPrefix() { | ||||
| @@ -202,6 +229,10 @@ public class Property extends Task { | |||||
| this.ref = ref; | this.ref = ref; | ||||
| } | } | ||||
| /** | |||||
| * Get the refid attribute. | |||||
| * @return the refid attribute | |||||
| */ | |||||
| public Reference getRefid() { | public Reference getRefid() { | ||||
| return ref; | return ref; | ||||
| } | } | ||||
| @@ -216,6 +247,10 @@ public class Property extends Task { | |||||
| this.resource = resource; | this.resource = resource; | ||||
| } | } | ||||
| /** | |||||
| * Get the resource attribute. | |||||
| * @return the resource attribute | |||||
| */ | |||||
| public String getResource() { | public String getResource() { | ||||
| return resource; | return resource; | ||||
| } | } | ||||
| @@ -245,6 +280,8 @@ public class Property extends Task { | |||||
| } | } | ||||
| /** | /** | ||||
| * Get the environment attribute. | |||||
| * @return the environment attribute | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| public String getEnvironment() { | public String getEnvironment() { | ||||
| @@ -265,6 +302,7 @@ public class Property extends Task { | |||||
| /** | /** | ||||
| * The classpath to use when looking up a resource. | * The classpath to use when looking up a resource. | ||||
| * @return a path to be configured | |||||
| */ | */ | ||||
| public Path createClasspath() { | public Path createClasspath() { | ||||
| if (this.classpath == null) { | if (this.classpath == null) { | ||||
| @@ -276,12 +314,15 @@ public class Property extends Task { | |||||
| /** | /** | ||||
| * the classpath to use when looking up a resource, | * the classpath to use when looking up a resource, | ||||
| * given as reference to a <path> defined elsewhere | * given as reference to a <path> defined elsewhere | ||||
| * @param r a reference to a classpath | |||||
| */ | */ | ||||
| public void setClasspathRef(Reference r) { | public void setClasspathRef(Reference r) { | ||||
| createClasspath().setRefid(r); | createClasspath().setRefid(r); | ||||
| } | } | ||||
| /** | /** | ||||
| * Get the classpath used when looking up a resource. | |||||
| * @return the classpath | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| public Path getClasspath() { | public Path getClasspath() { | ||||
| @@ -289,6 +330,7 @@ public class Property extends Task { | |||||
| } | } | ||||
| /** | /** | ||||
| * @param userProperty ignored | |||||
| * @deprecated This was never a supported feature and has been | * @deprecated This was never a supported feature and has been | ||||
| * deprecated without replacement | * deprecated without replacement | ||||
| * @ant.attribute ignore="true" | * @ant.attribute ignore="true" | ||||
| @@ -310,6 +352,7 @@ public class Property extends Task { | |||||
| * set the property in the project to the value. | * set the property in the project to the value. | ||||
| * if the task was give a file, resource or env attribute | * if the task was give a file, resource or env attribute | ||||
| * here is where it is loaded | * here is where it is loaded | ||||
| * @throws BuildException on error | |||||
| */ | */ | ||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| if (getProject() == null) { | if (getProject() == null) { | ||||
| @@ -373,6 +416,7 @@ public class Property extends Task { | |||||
| /** | /** | ||||
| * load properties from a url | * load properties from a url | ||||
| * @param url url to load from | * @param url url to load from | ||||
| * @throws BuildException on error | |||||
| */ | */ | ||||
| protected void loadUrl(URL url) throws BuildException { | protected void loadUrl(URL url) throws BuildException { | ||||
| Properties props = new Properties(); | Properties props = new Properties(); | ||||
| @@ -396,6 +440,7 @@ public class Property extends Task { | |||||
| /** | /** | ||||
| * load properties from a file | * load properties from a file | ||||
| * @param file file to load | * @param file file to load | ||||
| * @throws BuildException on error | |||||
| */ | */ | ||||
| protected void loadFile(File file) throws BuildException { | protected void loadFile(File file) throws BuildException { | ||||
| Properties props = new Properties(); | Properties props = new Properties(); | ||||
| @@ -490,6 +535,7 @@ public class Property extends Task { | |||||
| /** | /** | ||||
| * iterate through a set of properties, | * iterate through a set of properties, | ||||
| * resolve them then assign them | * resolve them then assign them | ||||
| * @param props the properties to iterate over | |||||
| */ | */ | ||||
| protected void addProperties(Properties props) { | protected void addProperties(Properties props) { | ||||
| resolveAllProperties(props); | resolveAllProperties(props); | ||||
| @@ -1,5 +1,5 @@ | |||||
| /* | /* | ||||
| * Copyright 2001-2004 The Apache Software Foundation | |||||
| * Copyright 2001-2005 The Apache Software Foundation | |||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| @@ -74,7 +74,6 @@ public class RecorderEntry implements BuildLogger, SubBuildListener { | |||||
| return filename; | return filename; | ||||
| } | } | ||||
| /** | /** | ||||
| * Turns off or on this recorder. | * Turns off or on this recorder. | ||||
| * | * | ||||
| @@ -87,12 +86,16 @@ public class RecorderEntry implements BuildLogger, SubBuildListener { | |||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * @see BuildListener#buildStarted(BuildEvent) | |||||
| */ | |||||
| public void buildStarted(BuildEvent event) { | public void buildStarted(BuildEvent event) { | ||||
| log("> BUILD STARTED", Project.MSG_DEBUG); | log("> BUILD STARTED", Project.MSG_DEBUG); | ||||
| } | } | ||||
| /** | |||||
| * @see BuildListener#buildFinished(BuildEvent) | |||||
| */ | |||||
| public void buildFinished(BuildEvent event) { | public void buildFinished(BuildEvent event) { | ||||
| log("< BUILD FINISHED", Project.MSG_DEBUG); | log("< BUILD FINISHED", Project.MSG_DEBUG); | ||||
| @@ -135,7 +138,9 @@ public class RecorderEntry implements BuildLogger, SubBuildListener { | |||||
| public void subBuildStarted(BuildEvent event) { | public void subBuildStarted(BuildEvent event) { | ||||
| } | } | ||||
| /** | |||||
| * @see BuildListener#targetStarted(BuildEvent) | |||||
| */ | |||||
| public void targetStarted(BuildEvent event) { | public void targetStarted(BuildEvent event) { | ||||
| log(">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG); | log(">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG); | ||||
| log(StringUtils.LINE_SEP + event.getTarget().getName() + ":", | log(StringUtils.LINE_SEP + event.getTarget().getName() + ":", | ||||
| @@ -143,7 +148,9 @@ public class RecorderEntry implements BuildLogger, SubBuildListener { | |||||
| targetStartTime = System.currentTimeMillis(); | targetStartTime = System.currentTimeMillis(); | ||||
| } | } | ||||
| /** | |||||
| * @see BuildListener#targetFinished(BuildEvent) | |||||
| */ | |||||
| public void targetFinished(BuildEvent event) { | public void targetFinished(BuildEvent event) { | ||||
| log("<< TARGET FINISHED -- " + event.getTarget(), Project.MSG_DEBUG); | log("<< TARGET FINISHED -- " + event.getTarget(), Project.MSG_DEBUG); | ||||
| @@ -153,18 +160,24 @@ public class RecorderEntry implements BuildLogger, SubBuildListener { | |||||
| flush(); | flush(); | ||||
| } | } | ||||
| /** | |||||
| * @see BuildListener#taskStarted(BuildEvent) | |||||
| */ | |||||
| public void taskStarted(BuildEvent event) { | public void taskStarted(BuildEvent event) { | ||||
| log(">>> TASK STARTED -- " + event.getTask(), Project.MSG_DEBUG); | log(">>> TASK STARTED -- " + event.getTask(), Project.MSG_DEBUG); | ||||
| } | } | ||||
| /** | |||||
| * @see BuildListener#taskFinished(BuildEvent) | |||||
| */ | |||||
| public void taskFinished(BuildEvent event) { | public void taskFinished(BuildEvent event) { | ||||
| log("<<< TASK FINISHED -- " + event.getTask(), Project.MSG_DEBUG); | log("<<< TASK FINISHED -- " + event.getTask(), Project.MSG_DEBUG); | ||||
| flush(); | flush(); | ||||
| } | } | ||||
| /** | |||||
| * @see BuildListener#messageLogged(BuildEvent) | |||||
| */ | |||||
| public void messageLogged(BuildEvent event) { | public void messageLogged(BuildEvent event) { | ||||
| log("--- MESSAGE LOGGED", Project.MSG_DEBUG); | log("--- MESSAGE LOGGED", Project.MSG_DEBUG); | ||||
| @@ -207,25 +220,35 @@ public class RecorderEntry implements BuildLogger, SubBuildListener { | |||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * @see BuildLogger#setMessageOutputLevel(int) | |||||
| */ | |||||
| public void setMessageOutputLevel(int level) { | public void setMessageOutputLevel(int level) { | ||||
| if (level >= Project.MSG_ERR && level <= Project.MSG_DEBUG) { | if (level >= Project.MSG_ERR && level <= Project.MSG_DEBUG) { | ||||
| loglevel = level; | loglevel = level; | ||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * @see BuildLogger#setOutputPrintStream(PrintStream) | |||||
| */ | |||||
| public void setOutputPrintStream(PrintStream output) { | public void setOutputPrintStream(PrintStream output) { | ||||
| closeFile(); | closeFile(); | ||||
| out = output; | out = output; | ||||
| } | } | ||||
| /** | |||||
| * @see BuildLogger#setEmacMode(boolean) | |||||
| */ | |||||
| public void setEmacsMode(boolean emacsMode) { | public void setEmacsMode(boolean emacsMode) { | ||||
| this.emacsMode = emacsMode; | this.emacsMode = emacsMode; | ||||
| } | } | ||||
| /** | |||||
| * @see BuildLogger#setErrorPrintStream(PrintStream) | |||||
| */ | |||||
| public void setErrorPrintStream(PrintStream err) { | public void setErrorPrintStream(PrintStream err) { | ||||
| setOutputPrintStream(err); | setOutputPrintStream(err); | ||||
| } | } | ||||
| @@ -1,5 +1,5 @@ | |||||
| /* | /* | ||||
| * Copyright 2000,2002-2004 The Apache Software Foundation | |||||
| * Copyright 2000,2002-2005 The Apache Software Foundation | |||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| @@ -64,6 +64,8 @@ public class TaskOutputStream extends OutputStream { | |||||
| * Write a character to the output stream. This method looks | * Write a character to the output stream. This method looks | ||||
| * to make sure that there isn't an error being reported and | * to make sure that there isn't an error being reported and | ||||
| * will flush each line of input out to the project's log stream. | * will flush each line of input out to the project's log stream. | ||||
| * @param c the character to write | |||||
| * @throws IOException on error | |||||
| */ | */ | ||||
| public void write(int c) throws IOException { | public void write(int c) throws IOException { | ||||