git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@474072 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -101,6 +101,7 @@ import java.io.File; | |||
| public class CSharp extends DotnetCompile { | |||
| // CheckStyle:VisibilityModifier OFF - bc | |||
| /** | |||
| * defines list: RELEASE;WIN32;NO_SANITY_CHECKS;;SOMETHING_ELSE' | |||
| */ | |||
| @@ -137,6 +138,7 @@ public class CSharp extends DotnetCompile { | |||
| * settings files 'csc.rsp' in its bin directory and then the local directory | |||
| */ | |||
| private boolean noconfig = false; | |||
| // CheckStyle:VisibilityModifier ON | |||
| /** | |||
| @@ -191,6 +193,7 @@ public class CSharp extends DotnetCompile { | |||
| * Set the file alignment. | |||
| * Valid values are 0,512, 1024, 2048, 4096, 8192, | |||
| * and 16384, 0 means 'leave to the compiler' | |||
| * @param fileAlign the value to use. | |||
| */ | |||
| public void setFileAlign(int fileAlign) { | |||
| this.fileAlign = fileAlign; | |||
| @@ -367,6 +370,7 @@ public class CSharp extends DotnetCompile { | |||
| /** | |||
| * Returns the delimiter which C# uses to separate references, i.e., a semi colon. | |||
| * @return the delimiter. | |||
| */ | |||
| public String getReferenceDelimiter() { | |||
| return ";"; | |||
| @@ -34,6 +34,7 @@ import java.util.Enumeration; | |||
| * can use shared code. | |||
| */ | |||
| public class DotnetBaseMatchingTask extends MatchingTask { | |||
| // CheckStyle:VisibilityModifier OFF - bc | |||
| /** | |||
| * output file. If not supplied this is derived from the source file | |||
| */ | |||
| @@ -53,10 +54,15 @@ public class DotnetBaseMatchingTask extends MatchingTask { | |||
| * | |||
| * @since Ant 1.6.3 | |||
| */ | |||
| // CheckStyle:ConstantNameCheck OFF - bc | |||
| protected static final boolean isWindows = Os.isFamily("windows"); | |||
| // CheckStyle:ConstantNameCheck ON | |||
| // CheckStyle:VisibilityModifier ON | |||
| /** | |||
| * Overridden because we need to be able to set the srcDir. | |||
| * @return the source directory. | |||
| */ | |||
| public File getSrcDir() { | |||
| return this.srcDir; | |||
| @@ -82,7 +88,7 @@ public class DotnetBaseMatchingTask extends MatchingTask { | |||
| /** | |||
| * add a new source directory to the compile | |||
| * @param src | |||
| * @param src a fileset. | |||
| */ | |||
| public void addSrc(FileSet src) { | |||
| filesets.add(src); | |||
| @@ -98,6 +104,7 @@ public class DotnetBaseMatchingTask extends MatchingTask { | |||
| /** | |||
| * create the list of files | |||
| * @param command the command to create the files for. | |||
| * @param filesToBuild vector to add files to | |||
| * @param outputTimestamp timestamp to compare against | |||
| * @return number of files out of date | |||
| @@ -164,7 +171,8 @@ public class DotnetBaseMatchingTask extends MatchingTask { | |||
| /** | |||
| * finish off the command by adding all dependent files, execute | |||
| * @param command | |||
| * @param command the command to update. | |||
| * @param ignoreTimestamps not used. | |||
| */ | |||
| protected void addFilesAndExecute(NetCommand command, boolean ignoreTimestamps) { | |||
| long outputTimestamp = getOutputFileTimestamp(); | |||
| @@ -107,6 +107,7 @@ public abstract class DotnetCompile | |||
| */ | |||
| private boolean optimize; | |||
| // CheckStyle:VisibilityModifier OFF - bc | |||
| /** | |||
| * a list of definitions to support; | |||
| */ | |||
| @@ -174,6 +175,8 @@ public abstract class DotnetCompile | |||
| private boolean useResponseFile = false; | |||
| private static final int AUTOMATIC_RESPONSE_FILE_THRESHOLD = 64; | |||
| // CheckStyle:VisibilityModifier ON | |||
| /** | |||
| * constructor inits everything and set up the search pattern | |||
| */ | |||
| @@ -246,7 +249,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * add a new reference fileset to the compilation | |||
| * @param reference | |||
| * @param reference the files to use. | |||
| */ | |||
| public void addReference(FileSet reference) { | |||
| referenceFilesets.add(reference); | |||
| @@ -503,7 +506,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * set the target type to one of exe|library|module|winexe | |||
| * @param targetType | |||
| * @param targetType the enumerated value. | |||
| */ | |||
| public void setTargetType(TargetTypes targetType) { | |||
| this.targetType = targetType.getValue(); | |||
| @@ -631,7 +634,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * add a define to the list of definitions | |||
| * @param define | |||
| * @param define the define value. | |||
| */ | |||
| public void addDefine(DotnetDefine define) { | |||
| definitionList.addElement(define); | |||
| @@ -641,6 +644,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * get a list of definitions or null | |||
| * @return a string beginning /D: or null for no definitions | |||
| * @throws BuildException if there is an error. | |||
| */ | |||
| protected String getDefinitionsParameter() throws BuildException { | |||
| StringBuffer defines = new StringBuffer(); | |||
| @@ -725,7 +729,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * link or embed a resource | |||
| * @param resource | |||
| * @param resource the resource to use. | |||
| */ | |||
| public void addResource(DotnetResource resource) { | |||
| resources.add(resource); | |||
| @@ -745,7 +749,7 @@ public abstract class DotnetCompile | |||
| * to an alternate implementation of the command, such as the Mono or Rotor | |||
| * versions -provided they use the same command line arguments as the | |||
| * .NET framework edition | |||
| * @param executable | |||
| * @param executable the name of the program. | |||
| */ | |||
| public void setExecutable(String executable) { | |||
| this.executable = executable; | |||
| @@ -797,7 +801,7 @@ public abstract class DotnetCompile | |||
| * this is passed in with @file. The task automatically switches | |||
| * to this mode with big commands; this option is here for | |||
| * testing and emergencies | |||
| * @param useResponseFile | |||
| * @param useResponseFile a <code>boolean</code> value. | |||
| */ | |||
| public void setUseResponseFile(boolean useResponseFile) { | |||
| this.useResponseFile = useResponseFile; | |||
| @@ -848,7 +852,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * fill in the common information | |||
| * @param command | |||
| * @param command the net command. | |||
| */ | |||
| protected void fillInSharedParameters(NetCommand command) { | |||
| command.setFailOnError(getFailOnError()); | |||
| @@ -871,6 +875,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * for every resource declared, we get the (language specific) | |||
| * resource setting | |||
| * @param command the net command. | |||
| */ | |||
| protected void addResources(NetCommand command) { | |||
| Enumeration e = resources.elements(); | |||
| @@ -882,6 +887,7 @@ public abstract class DotnetCompile | |||
| /* XXX Javadoc makes little sense, rewrite | |||
| * from a resource, get the | |||
| * @param command | |||
| * @param resource | |||
| * @return a string containing the resource param, or a null string | |||
| * to conditionally exclude a resource. | |||
| @@ -891,6 +897,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * run through the list of reference files and add them to the command | |||
| * @param command the command to use. | |||
| * @param outputTimestamp timestamp to compare against | |||
| * @return number of files out of date | |||
| */ | |||
| @@ -941,7 +948,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * add any compiler specifics | |||
| * @param command | |||
| * @param command the command to use. | |||
| */ | |||
| protected abstract void addCompilerSpecificOptions(NetCommand command); | |||
| @@ -956,6 +963,7 @@ public abstract class DotnetCompile | |||
| /** | |||
| * test for a file being managed or not | |||
| * @param file the file to test. | |||
| * @return true if we think this is a managed executable, and thus OK | |||
| * for linking | |||
| * @todo look at the PE header of the exe and see if it is managed or not. | |||
| @@ -971,6 +979,7 @@ public abstract class DotnetCompile | |||
| * valid build types are exe|library|module|winexe | |||
| */ | |||
| public static class TargetTypes extends EnumeratedAttribute { | |||
| /** {@inheritDoc}. */ | |||
| public String[] getValues() { | |||
| return new String[] { | |||
| "exe", | |||
| @@ -50,13 +50,17 @@ public class DotnetDefine { | |||
| this.unlessCond = condition; | |||
| } | |||
| /** | |||
| * Get the name of the definition. | |||
| * @return the name. | |||
| */ | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| /** | |||
| * the name of the definition. Required. | |||
| * @param name | |||
| * @param name the name value. | |||
| */ | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| @@ -67,7 +71,7 @@ public class DotnetDefine { | |||
| * was declared and not met | |||
| * @param owner owning task | |||
| * @return The value of the definition. | |||
| * @throws BuildException | |||
| * @throws BuildException if there is an error. | |||
| */ | |||
| public String getValue(Task owner) throws BuildException { | |||
| if (name == null) { | |||
| @@ -83,7 +87,7 @@ public class DotnetDefine { | |||
| /** | |||
| * logic taken from patternset | |||
| * @param owner | |||
| * @param owner the owning task. | |||
| * @return true if the condition is valid | |||
| */ | |||
| public boolean isSet(Task owner) { | |||
| @@ -23,7 +23,8 @@ import java.io.File; | |||
| import java.util.ArrayList; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import java.util.Iterator; | |||
| import org.apache.tools.ant.*; | |||
| import org.apache.tools.ant.Project; | |||
| import org.apache.tools.ant.DirectoryScanner; | |||
| /** | |||
| * Used by {@link DotnetCompile} to name resources. | |||
| @@ -62,6 +63,10 @@ public class DotnetResource { | |||
| */ | |||
| private String namespace = null; | |||
| /** | |||
| * Return the embed attribute. | |||
| * @return the embed value. | |||
| */ | |||
| public boolean isEmbed() { | |||
| return embed; | |||
| } | |||
| @@ -69,12 +74,16 @@ public class DotnetResource { | |||
| /** | |||
| * embed the resource in the assembly (default, true) or just link to it. | |||
| * | |||
| * @param embed | |||
| * @param embed a <code>boolean</code> value. | |||
| */ | |||
| public void setEmbed(boolean embed) { | |||
| this.embed = embed; | |||
| } | |||
| /** | |||
| * The file resource. | |||
| * @return the file resource. | |||
| */ | |||
| public File getFile() { | |||
| return file; | |||
| } | |||
| @@ -82,12 +91,16 @@ public class DotnetResource { | |||
| /** | |||
| * name the resource | |||
| * | |||
| * @param file | |||
| * @param file the file. | |||
| */ | |||
| public void setFile(File file) { | |||
| this.file = file; | |||
| } | |||
| /** | |||
| * Get the public attribute. | |||
| * @return the public attribute. | |||
| */ | |||
| public Boolean getPublic() { | |||
| return isPublic; | |||
| } | |||
| @@ -95,12 +108,16 @@ public class DotnetResource { | |||
| /** | |||
| * VB and J# only: is a resource public or not? | |||
| * | |||
| * @param aPublic | |||
| * @param aPublic a <code>boolean</code> value. | |||
| */ | |||
| public void setPublic(Boolean aPublic) { | |||
| isPublic = aPublic; | |||
| } | |||
| /** | |||
| * The name of the resource. | |||
| * @return the name of the resource. | |||
| */ | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| @@ -108,7 +125,7 @@ public class DotnetResource { | |||
| /** | |||
| * should the resource have a name? | |||
| * | |||
| * @param name | |||
| * @param name the name of the resource. | |||
| */ | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| @@ -140,21 +157,27 @@ public class DotnetResource { | |||
| private void checkParameters() { | |||
| if (hasFilesets()) { | |||
| if (getName() != null) | |||
| if (getName() != null) { | |||
| throw new BuildException( | |||
| "Cannot use <resource name=\"...\"> attribute with filesets"); | |||
| if (getFile() != null) | |||
| } | |||
| if (getFile() != null) { | |||
| throw new BuildException( | |||
| "Cannot use <resource file=\"...\"> attribute with filesets"); | |||
| } | |||
| } else { | |||
| if (getNamespace() != null) | |||
| if (getNamespace() != null) { | |||
| throw new BuildException( | |||
| "Cannot use <resource namespace=\"...\"> attribute without filesets"); | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| * build the C# style parameter (which has no public/private option) | |||
| * @param p the current project. | |||
| * @param command the command. | |||
| * @param csharpStyle a <code>boolean</code> attribute. | |||
| */ | |||
| public void getParameters(Project p, NetCommand command, boolean csharpStyle) { | |||
| checkParameters(); | |||
| @@ -61,6 +61,8 @@ import org.apache.tools.ant.types.FileSet; | |||
| public class Ilasm | |||
| extends DotnetBaseMatchingTask { | |||
| // CheckStyle:VisibilityModifier OFF - bc | |||
| // CheckStyle:ConstantNameCheck OFF - bc | |||
| /** | |||
| * Name of the executable. The .exe suffix is deliberately not included in | |||
| * anticipation of the unix version | |||
| @@ -132,6 +134,9 @@ public class Ilasm | |||
| */ | |||
| protected Vector referenceFilesets = new Vector(); | |||
| // CheckStyle:ConstantNameCheck ON | |||
| // CheckStyle:VisibilityModifier ON | |||
| /** | |||
| * @since Ant 1.7 | |||
| */ | |||
| @@ -145,7 +150,7 @@ public class Ilasm | |||
| setIncludes(file_pattern); | |||
| } | |||
| // CheckStyle:MethodNameCheck OFF - bc | |||
| /** | |||
| * reset all contents. | |||
| */ | |||
| @@ -160,6 +165,7 @@ public class Ilasm | |||
| resourceFile = null; | |||
| extraOptions = null; | |||
| } | |||
| // CheckStyle:MethodNameCheck ON | |||
| @@ -432,7 +438,7 @@ public class Ilasm | |||
| /** | |||
| * set the target type to one of exe|library | |||
| * @param targetType | |||
| * @param targetType the enumerated value. | |||
| */ | |||
| public void setTargetType(TargetTypes targetType) { | |||
| this.targetType = targetType.getValue(); | |||
| @@ -442,7 +448,7 @@ public class Ilasm | |||
| * Explicitly override the Mono auto-detection. | |||
| * | |||
| * <p>Defaults to false on Windows and true on any other platform.</p> | |||
| * | |||
| * @param b a <code>boolean</code> value. | |||
| * @since Ant 1.7 | |||
| */ | |||
| public void setMono(boolean b) { | |||
| @@ -496,7 +502,7 @@ public class Ilasm | |||
| /** | |||
| * add a new reference fileset to the compilation | |||
| * @param reference | |||
| * @param reference the fileset to use. | |||
| */ | |||
| public void addReference(FileSet reference) { | |||
| referenceFilesets.add(reference); | |||
| @@ -504,6 +510,7 @@ public class Ilasm | |||
| /** | |||
| * test for a file being managed or not | |||
| * @param file the file to test. | |||
| * @return true if we think this is a managed executable, and thus OK | |||
| * for linking | |||
| * @todo look at the PE header of the exe and see if it is managed or not. | |||
| @@ -520,6 +527,7 @@ public class Ilasm | |||
| * valid build types are exe|library|module|winexe | |||
| */ | |||
| public static class TargetTypes extends EnumeratedAttribute { | |||
| /** {@inheritDoc}. */ | |||
| public String[] getValues() { | |||
| return new String[]{ | |||
| "exe", | |||
| @@ -153,6 +153,7 @@ public class Ildasm extends Task { | |||
| * Set the name of the directory for resources to be created. We cannot control | |||
| * their names, but we can say where they get created. If not set, the | |||
| * directory of the dest file is used | |||
| * @param resourceDir the directory in which to create resources. | |||
| */ | |||
| public void setResourceDir(File resourceDir) { | |||
| this.resourceDir = resourceDir; | |||
| @@ -165,7 +166,7 @@ public class Ildasm extends Task { | |||
| * force us to change to this directory before running the application. | |||
| * i.e use <property location> to create an absolute path from a | |||
| * relative one before setting this value. | |||
| * @param executable | |||
| * @param executable the name of the executable to use. | |||
| */ | |||
| public void setExecutable(String executable) { | |||
| this.executable = executable; | |||
| @@ -173,7 +174,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * Select the output encoding: ascii, utf8 or unicode | |||
| * @param encoding | |||
| * @param encoding the enumerated value. | |||
| */ | |||
| public void setEncoding(EncodingTypes encoding) { | |||
| this.encoding = encoding.getValue(); | |||
| @@ -181,7 +182,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * enable (default) or disable assembly language in the output | |||
| * @param assembler | |||
| * @param assembler a <code>boolean</code> value. | |||
| */ | |||
| public void setAssembler(boolean assembler) { | |||
| this.assembler = assembler; | |||
| @@ -189,7 +190,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * enable or disable (default) the original bytes as comments | |||
| * @param bytes | |||
| * @param bytes a <code>boolean</code> value. | |||
| */ | |||
| public void setBytes(boolean bytes) { | |||
| this.bytes = bytes; | |||
| @@ -197,7 +198,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * the output file (required) | |||
| * @param destFile | |||
| * @param destFile the destination file. | |||
| */ | |||
| public void setDestFile(File destFile) { | |||
| this.destFile = destFile; | |||
| @@ -205,7 +206,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * include header information; default false. | |||
| * @param header | |||
| * @param header a <code>boolean</code> value. | |||
| */ | |||
| public void setHeader(boolean header) { | |||
| this.header = header; | |||
| @@ -214,7 +215,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * name a single item to decode; a class or a method | |||
| * e.g item="Myclass::method" or item="namespace1::namespace2::Myclass:method(void(int32)) | |||
| * @param item | |||
| * @param item the item to decode. | |||
| */ | |||
| public void setItem(String item) { | |||
| this.item = item; | |||
| @@ -222,7 +223,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * include line number information; default=false | |||
| * @param linenumbers | |||
| * @param linenumbers a <code>boolean</code> value. | |||
| */ | |||
| public void setLinenumbers(boolean linenumbers) { | |||
| this.linenumbers = linenumbers; | |||
| @@ -230,7 +231,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * include metadata information | |||
| * @param metadata | |||
| * @param metadata a <code>boolean</code> value. | |||
| */ | |||
| public void setMetadata(boolean metadata) { | |||
| this.metadata = metadata; | |||
| @@ -238,7 +239,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * show a graphical progress bar in a window during the process; off by default | |||
| * @param progressBar | |||
| * @param progressBar a <code>boolean</code> value. | |||
| */ | |||
| public void setProgressBar(boolean progressBar) { | |||
| this.progressBar = progressBar; | |||
| @@ -246,7 +247,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * quote all names. | |||
| * @param quoteallnames | |||
| * @param quoteallnames a <code>boolean</code> value. | |||
| */ | |||
| public void setQuoteallnames(boolean quoteallnames) { | |||
| this.quoteallnames = quoteallnames; | |||
| @@ -254,7 +255,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * enable raw exception handling (default = false) | |||
| * @param rawExceptionHandling | |||
| * @param rawExceptionHandling a <code>boolean</code> value. | |||
| */ | |||
| public void setRawExceptionHandling(boolean rawExceptionHandling) { | |||
| this.rawExceptionHandling = rawExceptionHandling; | |||
| @@ -262,6 +263,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * include the source as comments (default=false) | |||
| * @param showSource a <code>boolean</code> value. | |||
| */ | |||
| public void setShowSource(boolean showSource) { | |||
| this.showSource = showSource; | |||
| @@ -269,7 +271,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * the file to disassemble -required | |||
| * @param sourceFile | |||
| * @param sourceFile the file to disassemble. | |||
| */ | |||
| public void setSourceFile(File sourceFile) { | |||
| this.sourceFile = sourceFile; | |||
| @@ -277,14 +279,14 @@ public class Ildasm extends Task { | |||
| /** | |||
| * alternate name for sourceFile | |||
| * @param sourceFile | |||
| * @param sourceFile the source file. | |||
| */ | |||
| public void setSrcFile(File sourceFile) { | |||
| setSourceFile(sourceFile); | |||
| } | |||
| /** | |||
| * This method sets the visibility options. It chooses one or more of the following, with + signs to | |||
| * concatenate them: | |||
| * This method sets the visibility options. It chooses one | |||
| * or more of the following, with + signs to concatenate them: | |||
| * <pre> | |||
| * pub : Public | |||
| * pri : Private | |||
| @@ -296,7 +298,7 @@ public class Ildasm extends Task { | |||
| *</pre> | |||
| * e.g. visibility="pub+pri". | |||
| * Family means <code>protected</code> in C#; | |||
| * @param visibility | |||
| * @param visibility the options to use. | |||
| */ | |||
| public void setVisibility(String visibility) { | |||
| this.visibility = visibility; | |||
| @@ -343,7 +345,7 @@ public class Ildasm extends Task { | |||
| } | |||
| /** | |||
| * do the work | |||
| * @throws BuildException | |||
| * @throws BuildException if there is an error. | |||
| */ | |||
| public void execute() throws BuildException { | |||
| log("This task is deprecated and will be removed in a future version\n" | |||
| @@ -420,9 +422,13 @@ public class Ildasm extends Task { | |||
| * encoding options; the default is ascii | |||
| */ | |||
| public static class EncodingTypes extends EnumeratedAttribute { | |||
| public final static String UNICODE = "unicode"; | |||
| public final static String UTF8 = "utf8"; | |||
| public final static String ASCII = "ascii"; | |||
| /** Unicode */ | |||
| public static final String UNICODE = "unicode"; | |||
| /** UTF8 */ | |||
| public static final String UTF8 = "utf8"; | |||
| /** ASCII */ | |||
| public static final String ASCII = "ascii"; | |||
| /** {@inheritDoc}. */ | |||
| public String[] getValues() { | |||
| return new String[]{ | |||
| ASCII, | |||
| @@ -433,7 +439,7 @@ public class Ildasm extends Task { | |||
| /** | |||
| * This method maps from an encoding enum to an encoding option. | |||
| * @param enumValue | |||
| * @param enumValue the value to use. | |||
| * @return The encoding option indicated by the enum value. | |||
| */ | |||
| public static String getEncodingOption(String enumValue) { | |||
| @@ -451,6 +457,7 @@ public class Ildasm extends Task { | |||
| * visibility options for decoding | |||
| */ | |||
| public static class VisibilityOptions extends EnumeratedAttribute { | |||
| /** {@inheritDoc}. */ | |||
| public String[] getValues() { | |||
| return new String[]{ | |||
| "pub", //Public | |||
| @@ -81,7 +81,7 @@ public class ImportTypelib extends Task { | |||
| * This method names the output file. | |||
| * | |||
| * This is an operation which is required to have been performed. | |||
| * @param destFile | |||
| * @param destFile the output file. | |||
| */ | |||
| public void setDestFile(File destFile) { | |||
| this.destFile = destFile; | |||
| @@ -90,7 +90,7 @@ public class ImportTypelib extends Task { | |||
| /** | |||
| * This method sets what namespace the typelib is to be in. | |||
| * This is an operation which is required to have been performed. | |||
| * @param namespace | |||
| * @param namespace the namespace to use. | |||
| */ | |||
| public void setNamespace(String namespace) { | |||
| this.namespace = namespace; | |||
| @@ -99,7 +99,7 @@ public class ImportTypelib extends Task { | |||
| /** | |||
| * This method sets which is the source .tlb file. | |||
| * This is an operation which is required to have been performed. | |||
| * @param srcFile | |||
| * @param srcFile the source file. | |||
| */ | |||
| public void setSrcFile(File srcFile) { | |||
| this.srcFile = srcFile; | |||
| @@ -107,7 +107,7 @@ public class ImportTypelib extends Task { | |||
| /** | |||
| * do you want unsafe code. | |||
| * @param unsafe | |||
| * @param unsafe a <code>boolean</code> value. | |||
| */ | |||
| public void setUnsafe(boolean unsafe) { | |||
| this.unsafe = unsafe; | |||
| @@ -115,7 +115,7 @@ public class ImportTypelib extends Task { | |||
| /** | |||
| * set this to map a COM SafeArray to the System.Array class | |||
| * @param useSysArray | |||
| * @param useSysArray a <code>boolean</code> value. | |||
| */ | |||
| public void setUseSysArray(boolean useSysArray) { | |||
| this.useSysArray = useSysArray; | |||
| @@ -123,7 +123,7 @@ public class ImportTypelib extends Task { | |||
| /** | |||
| * set any extra options that are not yet supported by this task. | |||
| * @param extraOptions | |||
| * @param extraOptions the options to use. | |||
| */ | |||
| public void setExtraOptions(String extraOptions) { | |||
| this.extraOptions = extraOptions; | |||
| @@ -41,7 +41,7 @@ import org.apache.tools.ant.BuildException; | |||
| * @ant.task category="dotnet" name="jsharpc" | |||
| */ | |||
| public class JSharp extends DotnetCompile { | |||
| // CheckStyle:VisibilityModifier OFF - bc | |||
| /** | |||
| * hex base address | |||
| */ | |||
| @@ -57,18 +57,25 @@ public class JSharp extends DotnetCompile { | |||
| */ | |||
| boolean secureScoping = false; | |||
| // CheckStyle:VisibilityModifier ON | |||
| /** No arg constructor. */ | |||
| public JSharp() { | |||
| setExecutable("vjc"); | |||
| } | |||
| /** | |||
| * Set the base address attribute. | |||
| * @param baseAddress the value to use. | |||
| */ | |||
| public void setBaseAddress(String baseAddress) { | |||
| this.baseAddress = baseAddress; | |||
| } | |||
| /** | |||
| * do we want pure java (default, true) or corrupted J#? | |||
| * @param pureJava | |||
| * @param pureJava a <code>boolean</code> value. | |||
| */ | |||
| public void setPureJava(boolean pureJava) { | |||
| this.pureJava = pureJava; | |||
| @@ -78,7 +85,7 @@ public class JSharp extends DotnetCompile { | |||
| * Make package scoped code visible to the current assembly only (default: false) | |||
| * .NET does not have package scoping. Instead it has assembly, private and public. | |||
| * By default, package content is public to all. | |||
| * @param secureScoping | |||
| * @param secureScoping a <code>boolean</code> value. | |||
| */ | |||
| public void setSecureScoping(boolean secureScoping) { | |||
| this.secureScoping = secureScoping; | |||
| @@ -103,7 +110,7 @@ public class JSharp extends DotnetCompile { | |||
| /** | |||
| * add jvc specific commands | |||
| * @param command | |||
| * @param command the command to add to. | |||
| */ | |||
| protected void addCompilerSpecificOptions(NetCommand command) { | |||
| if (pureJava) { | |||
| @@ -57,6 +57,7 @@ import org.apache.tools.ant.types.Commandline; | |||
| public class NetCommand { | |||
| private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | |||
| // CheckStyle:VisibilityModifier OFF - bc | |||
| /** | |||
| * owner project | |||
| @@ -93,6 +94,8 @@ public class NetCommand { | |||
| */ | |||
| protected boolean failOnError; | |||
| // CheckStyle:VisibilityModifier ON | |||
| /** | |||
| * the directory to execute the command in. When null, the current | |||
| * directory is used. | |||
| @@ -164,7 +167,7 @@ public class NetCommand { | |||
| /** | |||
| * set the directory to run from, if the default is inadequate | |||
| * @param directory | |||
| * @param directory the directory to use. | |||
| */ | |||
| public void setDirectory(File directory) { | |||
| this.directory = directory; | |||
| @@ -239,7 +242,7 @@ public class NetCommand { | |||
| /** | |||
| * set this to true to always use the response file | |||
| * @param useResponseFile | |||
| * @param useResponseFile a <code>boolean</code> value. | |||
| */ | |||
| public void setUseResponseFile(boolean useResponseFile) { | |||
| this.useResponseFile = useResponseFile; | |||
| @@ -255,7 +258,7 @@ public class NetCommand { | |||
| /** | |||
| * set threshold for automatically using response files -use 0 for off | |||
| * @param automaticResponseFileThreshold | |||
| * @param automaticResponseFileThreshold the threshold value to use. | |||
| */ | |||
| public void setAutomaticResponseFileThreshold(int automaticResponseFileThreshold) { | |||
| this.automaticResponseFileThreshold = automaticResponseFileThreshold; | |||
| @@ -359,7 +362,7 @@ public class NetCommand { | |||
| throw new BuildException("saving command stream to " + temporaryCommandFile, ex); | |||
| } | |||
| String newCommandLine[] = new String[2]; | |||
| String[] newCommandLine = new String[2]; | |||
| newCommandLine[0] = commands[0]; | |||
| newCommandLine[1] = "@" + temporaryCommandFile.getAbsolutePath(); | |||
| logVerbose(Commandline.describeCommand(newCommandLine)); | |||
| @@ -317,7 +317,7 @@ public class VisualBasicCompile extends DotnetCompile { | |||
| /** | |||
| * implement VBC commands | |||
| * @param command | |||
| * @param command the command to set arguements on. | |||
| */ | |||
| protected void addCompilerSpecificOptions(NetCommand command) { | |||
| command.addArgument(getRemoveIntChecksParameter()); | |||
| @@ -83,11 +83,14 @@ public class WsdlToDotnet extends Task { | |||
| */ | |||
| private boolean failOnError = true; | |||
| // CheckStyle:VisibilityModifier OFF - bc | |||
| /** | |||
| * any extra command options? | |||
| */ | |||
| protected String extraOptions = null; | |||
| // CheckStyle:VisibilityModifier ON | |||
| /** | |||
| * protocol string. Exact value set depends on SOAP stack version. | |||
| @@ -208,7 +211,7 @@ public class WsdlToDotnet extends Task { | |||
| * Optional, default=true | |||
| * | |||
| * @since Ant 1.7 | |||
| * @param ideErrors | |||
| * @param ideErrors a <code>boolean</code> value. | |||
| */ | |||
| public void setIdeErrors(boolean ideErrors) { | |||
| this.ideErrors = ideErrors; | |||
| @@ -220,7 +223,7 @@ public class WsdlToDotnet extends Task { | |||
| * offer different options. | |||
| * @since Ant 1.7 | |||
| * | |||
| * @param protocol | |||
| * @param protocol the protocol to use. | |||
| */ | |||
| public void setProtocol(String protocol) { | |||
| this.protocol = protocol; | |||
| @@ -230,7 +233,7 @@ public class WsdlToDotnet extends Task { | |||
| * add a new source schema to the compilation | |||
| * @since Ant 1.7 | |||
| * | |||
| * @param source | |||
| * @param source a nested schema element. | |||
| */ | |||
| public void addSchema(Schema source) { | |||
| schemas.add(source); | |||
| @@ -239,7 +242,7 @@ public class WsdlToDotnet extends Task { | |||
| /** | |||
| * flag to trigger turning a filename into a file:url | |||
| * ignored for the mono compiler. | |||
| * @param b | |||
| * @param b a <code>boolean</code> value. | |||
| */ | |||
| public void setMakeURL(boolean b) { | |||
| wsdl.setMakeURL(b); | |||
| @@ -248,7 +251,7 @@ public class WsdlToDotnet extends Task { | |||
| /** | |||
| * identify the compiler | |||
| * @since Ant 1.7 | |||
| * @param compiler | |||
| * @param compiler the enumerated value. | |||
| */ | |||
| public void setCompiler(Compiler compiler) { | |||
| this.compiler = compiler; | |||
| @@ -365,10 +368,16 @@ public class WsdlToDotnet extends Task { | |||
| private String url; | |||
| private boolean makeURL = false; | |||
| // Errors | |||
| /** One of file or url must be set */ | |||
| public static final String ERROR_NONE_DECLARED = "One of file and url must be set"; | |||
| /** Only one of file or url */ | |||
| public static final String ERROR_BOTH_DECLARED = "Only one of file or url can be set"; | |||
| /** Not found */ | |||
| public static final String ERROR_FILE_NOT_FOUND = "Not found: "; | |||
| /** File is a directory */ | |||
| public static final String ERROR_FILE_IS_DIR = "File is a directory: "; | |||
| /** Could not URL convert */ | |||
| public static final String ERROR_NO_URL_CONVERT = "Could not URL convert "; | |||
| /** | |||
| @@ -411,18 +420,26 @@ public class WsdlToDotnet extends Task { | |||
| return file.toString(); | |||
| } | |||
| /** | |||
| * Get the file. | |||
| * @return the file used. | |||
| */ | |||
| public File getFile() { | |||
| return file; | |||
| } | |||
| /** | |||
| * name of a file to use as a source of WSDL or XSD data | |||
| * @param file | |||
| * @param file the file to use. | |||
| */ | |||
| public void setFile(File file) { | |||
| this.file = file; | |||
| } | |||
| /** | |||
| * Get the url. | |||
| * @return the URL of the resource. | |||
| */ | |||
| public String getUrl() { | |||
| return url; | |||
| } | |||
| @@ -430,12 +447,16 @@ public class WsdlToDotnet extends Task { | |||
| /** | |||
| * url of a resource. | |||
| * URLs have no timestamp checking, and are not validated | |||
| * @param url | |||
| * @param url the URL string to use. | |||
| */ | |||
| public void setUrl(String url) { | |||
| this.url = url; | |||
| } | |||
| /** | |||
| * Get the makeURL attribute. | |||
| * @return the attribute. | |||
| */ | |||
| public boolean isMakeURL() { | |||
| return makeURL; | |||
| } | |||
| @@ -443,7 +464,7 @@ public class WsdlToDotnet extends Task { | |||
| /** | |||
| * flag to request that a file is turned into an absolute file: URL | |||
| * before being passed to the WSDL compiler | |||
| * @param makeURL | |||
| * @param makeURL a <code>boolean</code> value. | |||
| */ | |||
| public void setMakeURL(boolean makeURL) { | |||
| this.makeURL = makeURL; | |||
| @@ -467,16 +488,23 @@ public class WsdlToDotnet extends Task { | |||
| */ | |||
| public static class Compiler extends EnumeratedAttribute { | |||
| /** microsoft */ | |||
| public static final String COMPILER_MS = "microsoft"; | |||
| /** mono */ | |||
| public static final String COMPILER_MONO = "mono"; | |||
| /** microsoft-on-mono */ | |||
| public static final String COMPILER_MS_ON_MONO = "microsoft-on-mono"; | |||
| // CheckStyle:VisibilityModifier OFF - bc | |||
| /** the index to string mappings */ | |||
| String[] compilers = { | |||
| COMPILER_MS, | |||
| COMPILER_MONO, | |||
| COMPILER_MS_ON_MONO | |||
| }; | |||
| /** WSDL */ | |||
| public static final String EXE_WSDL = "wsdl"; | |||
| /** MONO */ | |||
| public static final String EXE_MONO = "mono"; | |||
| /** | |||
| * programs to run | |||
| @@ -503,6 +531,7 @@ public class WsdlToDotnet extends Task { | |||
| true | |||
| }; | |||
| // CheckStyle:VisibilityModifier ON | |||
| /** | |||
| * This is the only method a subclass needs to implement. | |||
| * | |||
| @@ -542,13 +571,17 @@ public class WsdlToDotnet extends Task { | |||
| return extraCompilerArgs[getIndex()]; | |||
| } | |||
| /** | |||
| * Get where the current value supports absolute files. | |||
| * @return true if the compiler does supports absolute files. | |||
| */ | |||
| public boolean supportsAbsoluteFiles() { | |||
| return absoluteFiles[getIndex()]; | |||
| } | |||
| /** | |||
| * apply any extra arguments of this class | |||
| * @param command | |||
| * @param command the command to apply the arguments to. | |||
| */ | |||
| public void applyExtraArgs(NetCommand command) { | |||
| String[] args = getExtraArgs(); | |||