Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@474072 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
94104f8777
12 changed files with 177 additions and 71 deletions
  1. +4
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
  2. +10
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetBaseMatchingTask.java
  3. +17
    -8
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java
  4. +7
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetDefine.java
  5. +31
    -8
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetResource.java
  6. +12
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java
  7. +29
    -22
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ildasm.java
  8. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/ImportTypelib.java
  9. +11
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/JSharp.java
  10. +7
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
  11. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/VisualBasicCompile.java
  12. +42
    -9
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java

+ 4
- 0
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java View File

@@ -101,6 +101,7 @@ import java.io.File;


public class CSharp extends DotnetCompile { public class CSharp extends DotnetCompile {


// CheckStyle:VisibilityModifier OFF - bc
/** /**
* defines list: RELEASE;WIN32;NO_SANITY_CHECKS;;SOMETHING_ELSE' * 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 * settings files 'csc.rsp' in its bin directory and then the local directory
*/ */
private boolean noconfig = false; private boolean noconfig = false;
// CheckStyle:VisibilityModifier ON




/** /**
@@ -191,6 +193,7 @@ public class CSharp extends DotnetCompile {
* Set the file alignment. * Set the file alignment.
* Valid values are 0,512, 1024, 2048, 4096, 8192, * Valid values are 0,512, 1024, 2048, 4096, 8192,
* and 16384, 0 means 'leave to the compiler' * and 16384, 0 means 'leave to the compiler'
* @param fileAlign the value to use.
*/ */
public void setFileAlign(int fileAlign) { public void setFileAlign(int fileAlign) {
this.fileAlign = 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. * Returns the delimiter which C# uses to separate references, i.e., a semi colon.
* @return the delimiter.
*/ */
public String getReferenceDelimiter() { public String getReferenceDelimiter() {
return ";"; return ";";


+ 10
- 2
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetBaseMatchingTask.java View File

@@ -34,6 +34,7 @@ import java.util.Enumeration;
* can use shared code. * can use shared code.
*/ */
public class DotnetBaseMatchingTask extends MatchingTask { public class DotnetBaseMatchingTask extends MatchingTask {
// CheckStyle:VisibilityModifier OFF - bc
/** /**
* output file. If not supplied this is derived from the source file * 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 * @since Ant 1.6.3
*/ */
// CheckStyle:ConstantNameCheck OFF - bc
protected static final boolean isWindows = Os.isFamily("windows"); 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. * Overridden because we need to be able to set the srcDir.
* @return the source directory.
*/ */
public File getSrcDir() { public File getSrcDir() {
return this.srcDir; return this.srcDir;
@@ -82,7 +88,7 @@ public class DotnetBaseMatchingTask extends MatchingTask {


/** /**
* add a new source directory to the compile * add a new source directory to the compile
* @param src
* @param src a fileset.
*/ */
public void addSrc(FileSet src) { public void addSrc(FileSet src) {
filesets.add(src); filesets.add(src);
@@ -98,6 +104,7 @@ public class DotnetBaseMatchingTask extends MatchingTask {


/** /**
* create the list of files * create the list of files
* @param command the command to create the files for.
* @param filesToBuild vector to add files to * @param filesToBuild vector to add files to
* @param outputTimestamp timestamp to compare against * @param outputTimestamp timestamp to compare against
* @return number of files out of date * @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 * 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) { protected void addFilesAndExecute(NetCommand command, boolean ignoreTimestamps) {
long outputTimestamp = getOutputFileTimestamp(); long outputTimestamp = getOutputFileTimestamp();


+ 17
- 8
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java View File

@@ -107,6 +107,7 @@ public abstract class DotnetCompile
*/ */
private boolean optimize; private boolean optimize;


// CheckStyle:VisibilityModifier OFF - bc
/** /**
* a list of definitions to support; * a list of definitions to support;
*/ */
@@ -174,6 +175,8 @@ public abstract class DotnetCompile
private boolean useResponseFile = false; private boolean useResponseFile = false;
private static final int AUTOMATIC_RESPONSE_FILE_THRESHOLD = 64; private static final int AUTOMATIC_RESPONSE_FILE_THRESHOLD = 64;


// CheckStyle:VisibilityModifier ON

/** /**
* constructor inits everything and set up the search pattern * 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 * add a new reference fileset to the compilation
* @param reference
* @param reference the files to use.
*/ */
public void addReference(FileSet reference) { public void addReference(FileSet reference) {
referenceFilesets.add(reference); referenceFilesets.add(reference);
@@ -503,7 +506,7 @@ public abstract class DotnetCompile


/** /**
* set the target type to one of exe|library|module|winexe * set the target type to one of exe|library|module|winexe
* @param targetType
* @param targetType the enumerated value.
*/ */
public void setTargetType(TargetTypes targetType) { public void setTargetType(TargetTypes targetType) {
this.targetType = targetType.getValue(); this.targetType = targetType.getValue();
@@ -631,7 +634,7 @@ public abstract class DotnetCompile


/** /**
* add a define to the list of definitions * add a define to the list of definitions
* @param define
* @param define the define value.
*/ */
public void addDefine(DotnetDefine define) { public void addDefine(DotnetDefine define) {
definitionList.addElement(define); definitionList.addElement(define);
@@ -641,6 +644,7 @@ public abstract class DotnetCompile
/** /**
* get a list of definitions or null * get a list of definitions or null
* @return a string beginning /D: or null for no definitions * @return a string beginning /D: or null for no definitions
* @throws BuildException if there is an error.
*/ */
protected String getDefinitionsParameter() throws BuildException { protected String getDefinitionsParameter() throws BuildException {
StringBuffer defines = new StringBuffer(); StringBuffer defines = new StringBuffer();
@@ -725,7 +729,7 @@ public abstract class DotnetCompile


/** /**
* link or embed a resource * link or embed a resource
* @param resource
* @param resource the resource to use.
*/ */
public void addResource(DotnetResource resource) { public void addResource(DotnetResource resource) {
resources.add(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 * to an alternate implementation of the command, such as the Mono or Rotor
* versions -provided they use the same command line arguments as the * versions -provided they use the same command line arguments as the
* .NET framework edition * .NET framework edition
* @param executable
* @param executable the name of the program.
*/ */
public void setExecutable(String executable) { public void setExecutable(String executable) {
this.executable = executable; this.executable = executable;
@@ -797,7 +801,7 @@ public abstract class DotnetCompile
* this is passed in with @file. The task automatically switches * this is passed in with @file. The task automatically switches
* to this mode with big commands; this option is here for * to this mode with big commands; this option is here for
* testing and emergencies * testing and emergencies
* @param useResponseFile
* @param useResponseFile a <code>boolean</code> value.
*/ */
public void setUseResponseFile(boolean useResponseFile) { public void setUseResponseFile(boolean useResponseFile) {
this.useResponseFile = useResponseFile; this.useResponseFile = useResponseFile;
@@ -848,7 +852,7 @@ public abstract class DotnetCompile


/** /**
* fill in the common information * fill in the common information
* @param command
* @param command the net command.
*/ */
protected void fillInSharedParameters(NetCommand command) { protected void fillInSharedParameters(NetCommand command) {
command.setFailOnError(getFailOnError()); command.setFailOnError(getFailOnError());
@@ -871,6 +875,7 @@ public abstract class DotnetCompile
/** /**
* for every resource declared, we get the (language specific) * for every resource declared, we get the (language specific)
* resource setting * resource setting
* @param command the net command.
*/ */
protected void addResources(NetCommand command) { protected void addResources(NetCommand command) {
Enumeration e = resources.elements(); Enumeration e = resources.elements();
@@ -882,6 +887,7 @@ public abstract class DotnetCompile


/* XXX Javadoc makes little sense, rewrite /* XXX Javadoc makes little sense, rewrite
* from a resource, get the * from a resource, get the
* @param command
* @param resource * @param resource
* @return a string containing the resource param, or a null string * @return a string containing the resource param, or a null string
* to conditionally exclude a resource. * 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 * 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 * @param outputTimestamp timestamp to compare against
* @return number of files out of date * @return number of files out of date
*/ */
@@ -941,7 +948,7 @@ public abstract class DotnetCompile


/** /**
* add any compiler specifics * add any compiler specifics
* @param command
* @param command the command to use.
*/ */
protected abstract void addCompilerSpecificOptions(NetCommand command); protected abstract void addCompilerSpecificOptions(NetCommand command);


@@ -956,6 +963,7 @@ public abstract class DotnetCompile


/** /**
* test for a file being managed or not * 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 * @return true if we think this is a managed executable, and thus OK
* for linking * for linking
* @todo look at the PE header of the exe and see if it is managed or not. * @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 * valid build types are exe|library|module|winexe
*/ */
public static class TargetTypes extends EnumeratedAttribute { public static class TargetTypes extends EnumeratedAttribute {
/** {@inheritDoc}. */
public String[] getValues() { public String[] getValues() {
return new String[] { return new String[] {
"exe", "exe",


+ 7
- 3
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetDefine.java View File

@@ -50,13 +50,17 @@ public class DotnetDefine {
this.unlessCond = condition; this.unlessCond = condition;
} }


/**
* Get the name of the definition.
* @return the name.
*/
public String getName() { public String getName() {
return name; return name;
} }


/** /**
* the name of the definition. Required. * the name of the definition. Required.
* @param name
* @param name the name value.
*/ */
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
@@ -67,7 +71,7 @@ public class DotnetDefine {
* was declared and not met * was declared and not met
* @param owner owning task * @param owner owning task
* @return The value of the definition. * @return The value of the definition.
* @throws BuildException
* @throws BuildException if there is an error.
*/ */
public String getValue(Task owner) throws BuildException { public String getValue(Task owner) throws BuildException {
if (name == null) { if (name == null) {
@@ -83,7 +87,7 @@ public class DotnetDefine {


/** /**
* logic taken from patternset * logic taken from patternset
* @param owner
* @param owner the owning task.
* @return true if the condition is valid * @return true if the condition is valid
*/ */
public boolean isSet(Task owner) { public boolean isSet(Task owner) {


+ 31
- 8
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetResource.java View File

@@ -23,7 +23,8 @@ import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.FileSet;
import java.util.Iterator; 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. * Used by {@link DotnetCompile} to name resources.
@@ -62,6 +63,10 @@ public class DotnetResource {
*/ */
private String namespace = null; private String namespace = null;


/**
* Return the embed attribute.
* @return the embed value.
*/
public boolean isEmbed() { public boolean isEmbed() {
return embed; return embed;
} }
@@ -69,12 +74,16 @@ public class DotnetResource {
/** /**
* embed the resource in the assembly (default, true) or just link to it. * 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) { public void setEmbed(boolean embed) {
this.embed = embed; this.embed = embed;
} }


/**
* The file resource.
* @return the file resource.
*/
public File getFile() { public File getFile() {
return file; return file;
} }
@@ -82,12 +91,16 @@ public class DotnetResource {
/** /**
* name the resource * name the resource
* *
* @param file
* @param file the file.
*/ */
public void setFile(File file) { public void setFile(File file) {
this.file = file; this.file = file;
} }


/**
* Get the public attribute.
* @return the public attribute.
*/
public Boolean getPublic() { public Boolean getPublic() {
return isPublic; return isPublic;
} }
@@ -95,12 +108,16 @@ public class DotnetResource {
/** /**
* VB and J# only: is a resource public or not? * VB and J# only: is a resource public or not?
* *
* @param aPublic
* @param aPublic a <code>boolean</code> value.
*/ */
public void setPublic(Boolean aPublic) { public void setPublic(Boolean aPublic) {
isPublic = aPublic; isPublic = aPublic;
} }


/**
* The name of the resource.
* @return the name of the resource.
*/
public String getName() { public String getName() {
return name; return name;
} }
@@ -108,7 +125,7 @@ public class DotnetResource {
/** /**
* should the resource have a name? * should the resource have a name?
* *
* @param name
* @param name the name of the resource.
*/ */
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
@@ -140,21 +157,27 @@ public class DotnetResource {


private void checkParameters() { private void checkParameters() {
if (hasFilesets()) { if (hasFilesets()) {
if (getName() != null)
if (getName() != null) {
throw new BuildException( throw new BuildException(
"Cannot use <resource name=\"...\"> attribute with filesets"); "Cannot use <resource name=\"...\"> attribute with filesets");
if (getFile() != null)
}
if (getFile() != null) {
throw new BuildException( throw new BuildException(
"Cannot use <resource file=\"...\"> attribute with filesets"); "Cannot use <resource file=\"...\"> attribute with filesets");
}
} else { } else {
if (getNamespace() != null)
if (getNamespace() != null) {
throw new BuildException( throw new BuildException(
"Cannot use <resource namespace=\"...\"> attribute without filesets"); "Cannot use <resource namespace=\"...\"> attribute without filesets");
}
} }
} }


/** /**
* build the C# style parameter (which has no public/private option) * 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) { public void getParameters(Project p, NetCommand command, boolean csharpStyle) {
checkParameters(); checkParameters();


+ 12
- 4
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java View File

@@ -61,6 +61,8 @@ import org.apache.tools.ant.types.FileSet;
public class Ilasm public class Ilasm
extends DotnetBaseMatchingTask { extends DotnetBaseMatchingTask {


// CheckStyle:VisibilityModifier OFF - bc
// CheckStyle:ConstantNameCheck OFF - bc
/** /**
* Name of the executable. The .exe suffix is deliberately not included in * Name of the executable. The .exe suffix is deliberately not included in
* anticipation of the unix version * anticipation of the unix version
@@ -132,6 +134,9 @@ public class Ilasm
*/ */
protected Vector referenceFilesets = new Vector(); protected Vector referenceFilesets = new Vector();


// CheckStyle:ConstantNameCheck ON
// CheckStyle:VisibilityModifier ON

/** /**
* @since Ant 1.7 * @since Ant 1.7
*/ */
@@ -145,7 +150,7 @@ public class Ilasm
setIncludes(file_pattern); setIncludes(file_pattern);
} }


// CheckStyle:MethodNameCheck OFF - bc
/** /**
* reset all contents. * reset all contents.
*/ */
@@ -160,6 +165,7 @@ public class Ilasm
resourceFile = null; resourceFile = null;
extraOptions = null; extraOptions = null;
} }
// CheckStyle:MethodNameCheck ON






@@ -432,7 +438,7 @@ public class Ilasm


/** /**
* set the target type to one of exe|library * set the target type to one of exe|library
* @param targetType
* @param targetType the enumerated value.
*/ */
public void setTargetType(TargetTypes targetType) { public void setTargetType(TargetTypes targetType) {
this.targetType = targetType.getValue(); this.targetType = targetType.getValue();
@@ -442,7 +448,7 @@ public class Ilasm
* Explicitly override the Mono auto-detection. * Explicitly override the Mono auto-detection.
* *
* <p>Defaults to false on Windows and true on any other platform.</p> * <p>Defaults to false on Windows and true on any other platform.</p>
*
* @param b a <code>boolean</code> value.
* @since Ant 1.7 * @since Ant 1.7
*/ */
public void setMono(boolean b) { public void setMono(boolean b) {
@@ -496,7 +502,7 @@ public class Ilasm


/** /**
* add a new reference fileset to the compilation * add a new reference fileset to the compilation
* @param reference
* @param reference the fileset to use.
*/ */
public void addReference(FileSet reference) { public void addReference(FileSet reference) {
referenceFilesets.add(reference); referenceFilesets.add(reference);
@@ -504,6 +510,7 @@ public class Ilasm


/** /**
* test for a file being managed or not * 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 * @return true if we think this is a managed executable, and thus OK
* for linking * for linking
* @todo look at the PE header of the exe and see if it is managed or not. * @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 * valid build types are exe|library|module|winexe
*/ */
public static class TargetTypes extends EnumeratedAttribute { public static class TargetTypes extends EnumeratedAttribute {
/** {@inheritDoc}. */
public String[] getValues() { public String[] getValues() {
return new String[]{ return new String[]{
"exe", "exe",


+ 29
- 22
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ildasm.java View File

@@ -153,6 +153,7 @@ public class Ildasm extends Task {
* Set the name of the directory for resources to be created. We cannot control * 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 * their names, but we can say where they get created. If not set, the
* directory of the dest file is used * directory of the dest file is used
* @param resourceDir the directory in which to create resources.
*/ */
public void setResourceDir(File resourceDir) { public void setResourceDir(File resourceDir) {
this.resourceDir = resourceDir; this.resourceDir = resourceDir;
@@ -165,7 +166,7 @@ public class Ildasm extends Task {
* force us to change to this directory before running the application. * force us to change to this directory before running the application.
* i.e use &lt;property location&gt to create an absolute path from a * i.e use &lt;property location&gt to create an absolute path from a
* relative one before setting this value. * relative one before setting this value.
* @param executable
* @param executable the name of the executable to use.
*/ */
public void setExecutable(String executable) { public void setExecutable(String executable) {
this.executable = executable; this.executable = executable;
@@ -173,7 +174,7 @@ public class Ildasm extends Task {


/** /**
* Select the output encoding: ascii, utf8 or unicode * Select the output encoding: ascii, utf8 or unicode
* @param encoding
* @param encoding the enumerated value.
*/ */
public void setEncoding(EncodingTypes encoding) { public void setEncoding(EncodingTypes encoding) {
this.encoding = encoding.getValue(); this.encoding = encoding.getValue();
@@ -181,7 +182,7 @@ public class Ildasm extends Task {


/** /**
* enable (default) or disable assembly language in the output * enable (default) or disable assembly language in the output
* @param assembler
* @param assembler a <code>boolean</code> value.
*/ */
public void setAssembler(boolean assembler) { public void setAssembler(boolean assembler) {
this.assembler = assembler; this.assembler = assembler;
@@ -189,7 +190,7 @@ public class Ildasm extends Task {


/** /**
* enable or disable (default) the original bytes as comments * enable or disable (default) the original bytes as comments
* @param bytes
* @param bytes a <code>boolean</code> value.
*/ */
public void setBytes(boolean bytes) { public void setBytes(boolean bytes) {
this.bytes = bytes; this.bytes = bytes;
@@ -197,7 +198,7 @@ public class Ildasm extends Task {


/** /**
* the output file (required) * the output file (required)
* @param destFile
* @param destFile the destination file.
*/ */
public void setDestFile(File destFile) { public void setDestFile(File destFile) {
this.destFile = destFile; this.destFile = destFile;
@@ -205,7 +206,7 @@ public class Ildasm extends Task {


/** /**
* include header information; default false. * include header information; default false.
* @param header
* @param header a <code>boolean</code> value.
*/ */
public void setHeader(boolean header) { public void setHeader(boolean header) {
this.header = header; this.header = header;
@@ -214,7 +215,7 @@ public class Ildasm extends Task {
/** /**
* name a single item to decode; a class or a method * name a single item to decode; a class or a method
* e.g item="Myclass::method" or item="namespace1::namespace2::Myclass:method(void(int32)) * 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) { public void setItem(String item) {
this.item = item; this.item = item;
@@ -222,7 +223,7 @@ public class Ildasm extends Task {


/** /**
* include line number information; default=false * include line number information; default=false
* @param linenumbers
* @param linenumbers a <code>boolean</code> value.
*/ */
public void setLinenumbers(boolean linenumbers) { public void setLinenumbers(boolean linenumbers) {
this.linenumbers = linenumbers; this.linenumbers = linenumbers;
@@ -230,7 +231,7 @@ public class Ildasm extends Task {


/** /**
* include metadata information * include metadata information
* @param metadata
* @param metadata a <code>boolean</code> value.
*/ */
public void setMetadata(boolean metadata) { public void setMetadata(boolean metadata) {
this.metadata = 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 * 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) { public void setProgressBar(boolean progressBar) {
this.progressBar = progressBar; this.progressBar = progressBar;
@@ -246,7 +247,7 @@ public class Ildasm extends Task {


/** /**
* quote all names. * quote all names.
* @param quoteallnames
* @param quoteallnames a <code>boolean</code> value.
*/ */
public void setQuoteallnames(boolean quoteallnames) { public void setQuoteallnames(boolean quoteallnames) {
this.quoteallnames = quoteallnames; this.quoteallnames = quoteallnames;
@@ -254,7 +255,7 @@ public class Ildasm extends Task {


/** /**
* enable raw exception handling (default = false) * enable raw exception handling (default = false)
* @param rawExceptionHandling
* @param rawExceptionHandling a <code>boolean</code> value.
*/ */
public void setRawExceptionHandling(boolean rawExceptionHandling) { public void setRawExceptionHandling(boolean rawExceptionHandling) {
this.rawExceptionHandling = rawExceptionHandling; this.rawExceptionHandling = rawExceptionHandling;
@@ -262,6 +263,7 @@ public class Ildasm extends Task {


/** /**
* include the source as comments (default=false) * include the source as comments (default=false)
* @param showSource a <code>boolean</code> value.
*/ */
public void setShowSource(boolean showSource) { public void setShowSource(boolean showSource) {
this.showSource = showSource; this.showSource = showSource;
@@ -269,7 +271,7 @@ public class Ildasm extends Task {


/** /**
* the file to disassemble -required * the file to disassemble -required
* @param sourceFile
* @param sourceFile the file to disassemble.
*/ */
public void setSourceFile(File sourceFile) { public void setSourceFile(File sourceFile) {
this.sourceFile = sourceFile; this.sourceFile = sourceFile;
@@ -277,14 +279,14 @@ public class Ildasm extends Task {


/** /**
* alternate name for sourceFile * alternate name for sourceFile
* @param sourceFile
* @param sourceFile the source file.
*/ */
public void setSrcFile(File sourceFile) { public void setSrcFile(File sourceFile) {
setSourceFile(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> * <pre>
* pub : Public * pub : Public
* pri : Private * pri : Private
@@ -296,7 +298,7 @@ public class Ildasm extends Task {
*</pre> *</pre>
* e.g. visibility="pub+pri". * e.g. visibility="pub+pri".
* Family means <code>protected</code> in C#; * Family means <code>protected</code> in C#;
* @param visibility
* @param visibility the options to use.
*/ */
public void setVisibility(String visibility) { public void setVisibility(String visibility) {
this.visibility = visibility; this.visibility = visibility;
@@ -343,7 +345,7 @@ public class Ildasm extends Task {
} }
/** /**
* do the work * do the work
* @throws BuildException
* @throws BuildException if there is an error.
*/ */
public void execute() throws BuildException { public void execute() throws BuildException {
log("This task is deprecated and will be removed in a future version\n" 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 * encoding options; the default is ascii
*/ */
public static class EncodingTypes extends EnumeratedAttribute { 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() { public String[] getValues() {
return new String[]{ return new String[]{
ASCII, ASCII,
@@ -433,7 +439,7 @@ public class Ildasm extends Task {


/** /**
* This method maps from an encoding enum to an encoding option. * 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. * @return The encoding option indicated by the enum value.
*/ */
public static String getEncodingOption(String enumValue) { public static String getEncodingOption(String enumValue) {
@@ -451,6 +457,7 @@ public class Ildasm extends Task {
* visibility options for decoding * visibility options for decoding
*/ */
public static class VisibilityOptions extends EnumeratedAttribute { public static class VisibilityOptions extends EnumeratedAttribute {
/** {@inheritDoc}. */
public String[] getValues() { public String[] getValues() {
return new String[]{ return new String[]{
"pub", //Public "pub", //Public


+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/ImportTypelib.java View File

@@ -81,7 +81,7 @@ public class ImportTypelib extends Task {
* This method names the output file. * This method names the output file.
* *
* This is an operation which is required to have been performed. * This is an operation which is required to have been performed.
* @param destFile
* @param destFile the output file.
*/ */
public void setDestFile(File destFile) { public void setDestFile(File destFile) {
this.destFile = 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 method sets what namespace the typelib is to be in.
* This is an operation which is required to have been performed. * This is an operation which is required to have been performed.
* @param namespace
* @param namespace the namespace to use.
*/ */
public void setNamespace(String namespace) { public void setNamespace(String namespace) {
this.namespace = namespace; this.namespace = namespace;
@@ -99,7 +99,7 @@ public class ImportTypelib extends Task {
/** /**
* This method sets which is the source .tlb file. * This method sets which is the source .tlb file.
* This is an operation which is required to have been performed. * This is an operation which is required to have been performed.
* @param srcFile
* @param srcFile the source file.
*/ */
public void setSrcFile(File srcFile) { public void setSrcFile(File srcFile) {
this.srcFile = srcFile; this.srcFile = srcFile;
@@ -107,7 +107,7 @@ public class ImportTypelib extends Task {


/** /**
* do you want unsafe code. * do you want unsafe code.
* @param unsafe
* @param unsafe a <code>boolean</code> value.
*/ */
public void setUnsafe(boolean unsafe) { public void setUnsafe(boolean unsafe) {
this.unsafe = 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 * 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) { public void setUseSysArray(boolean useSysArray) {
this.useSysArray = 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. * 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) { public void setExtraOptions(String extraOptions) {
this.extraOptions = extraOptions; this.extraOptions = extraOptions;


+ 11
- 4
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/JSharp.java View File

@@ -41,7 +41,7 @@ import org.apache.tools.ant.BuildException;
* @ant.task category="dotnet" name="jsharpc" * @ant.task category="dotnet" name="jsharpc"
*/ */
public class JSharp extends DotnetCompile { public class JSharp extends DotnetCompile {
// CheckStyle:VisibilityModifier OFF - bc
/** /**
* hex base address * hex base address
*/ */
@@ -57,18 +57,25 @@ public class JSharp extends DotnetCompile {
*/ */
boolean secureScoping = false; boolean secureScoping = false;


// CheckStyle:VisibilityModifier ON

/** No arg constructor. */
public JSharp() { public JSharp() {
setExecutable("vjc"); setExecutable("vjc");
} }




/**
* Set the base address attribute.
* @param baseAddress the value to use.
*/
public void setBaseAddress(String baseAddress) { public void setBaseAddress(String baseAddress) {
this.baseAddress = baseAddress; this.baseAddress = baseAddress;
} }


/** /**
* do we want pure java (default, true) or corrupted J#? * do we want pure java (default, true) or corrupted J#?
* @param pureJava
* @param pureJava a <code>boolean</code> value.
*/ */
public void setPureJava(boolean pureJava) { public void setPureJava(boolean pureJava) {
this.pureJava = 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) * 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. * .NET does not have package scoping. Instead it has assembly, private and public.
* By default, package content is public to all. * By default, package content is public to all.
* @param secureScoping
* @param secureScoping a <code>boolean</code> value.
*/ */
public void setSecureScoping(boolean secureScoping) { public void setSecureScoping(boolean secureScoping) {
this.secureScoping = secureScoping; this.secureScoping = secureScoping;
@@ -103,7 +110,7 @@ public class JSharp extends DotnetCompile {


/** /**
* add jvc specific commands * add jvc specific commands
* @param command
* @param command the command to add to.
*/ */
protected void addCompilerSpecificOptions(NetCommand command) { protected void addCompilerSpecificOptions(NetCommand command) {
if (pureJava) { if (pureJava) {


+ 7
- 4
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java View File

@@ -57,6 +57,7 @@ import org.apache.tools.ant.types.Commandline;
public class NetCommand { public class NetCommand {


private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
// CheckStyle:VisibilityModifier OFF - bc


/** /**
* owner project * owner project
@@ -93,6 +94,8 @@ public class NetCommand {
*/ */
protected boolean failOnError; protected boolean failOnError;


// CheckStyle:VisibilityModifier ON

/** /**
* the directory to execute the command in. When null, the current * the directory to execute the command in. When null, the current
* directory is used. * directory is used.
@@ -164,7 +167,7 @@ public class NetCommand {


/** /**
* set the directory to run from, if the default is inadequate * set the directory to run from, if the default is inadequate
* @param directory
* @param directory the directory to use.
*/ */
public void setDirectory(File directory) { public void setDirectory(File directory) {
this.directory = directory; this.directory = directory;
@@ -239,7 +242,7 @@ public class NetCommand {


/** /**
* set this to true to always use the response file * set this to true to always use the response file
* @param useResponseFile
* @param useResponseFile a <code>boolean</code> value.
*/ */
public void setUseResponseFile(boolean useResponseFile) { public void setUseResponseFile(boolean useResponseFile) {
this.useResponseFile = useResponseFile; this.useResponseFile = useResponseFile;
@@ -255,7 +258,7 @@ public class NetCommand {


/** /**
* set threshold for automatically using response files -use 0 for off * 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) { public void setAutomaticResponseFileThreshold(int automaticResponseFileThreshold) {
this.automaticResponseFileThreshold = automaticResponseFileThreshold; this.automaticResponseFileThreshold = automaticResponseFileThreshold;
@@ -359,7 +362,7 @@ public class NetCommand {
throw new BuildException("saving command stream to " + temporaryCommandFile, ex); throw new BuildException("saving command stream to " + temporaryCommandFile, ex);
} }


String newCommandLine[] = new String[2];
String[] newCommandLine = new String[2];
newCommandLine[0] = commands[0]; newCommandLine[0] = commands[0];
newCommandLine[1] = "@" + temporaryCommandFile.getAbsolutePath(); newCommandLine[1] = "@" + temporaryCommandFile.getAbsolutePath();
logVerbose(Commandline.describeCommand(newCommandLine)); logVerbose(Commandline.describeCommand(newCommandLine));


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/VisualBasicCompile.java View File

@@ -317,7 +317,7 @@ public class VisualBasicCompile extends DotnetCompile {


/** /**
* implement VBC commands * implement VBC commands
* @param command
* @param command the command to set arguements on.
*/ */
protected void addCompilerSpecificOptions(NetCommand command) { protected void addCompilerSpecificOptions(NetCommand command) {
command.addArgument(getRemoveIntChecksParameter()); command.addArgument(getRemoveIntChecksParameter());


+ 42
- 9
src/main/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java View File

@@ -83,11 +83,14 @@ public class WsdlToDotnet extends Task {
*/ */
private boolean failOnError = true; private boolean failOnError = true;


// CheckStyle:VisibilityModifier OFF - bc
/** /**
* any extra command options? * any extra command options?
*/ */
protected String extraOptions = null; protected String extraOptions = null;


// CheckStyle:VisibilityModifier ON



/** /**
* protocol string. Exact value set depends on SOAP stack version. * protocol string. Exact value set depends on SOAP stack version.
@@ -208,7 +211,7 @@ public class WsdlToDotnet extends Task {
* Optional, default=true * Optional, default=true
* *
* @since Ant 1.7 * @since Ant 1.7
* @param ideErrors
* @param ideErrors a <code>boolean</code> value.
*/ */
public void setIdeErrors(boolean ideErrors) { public void setIdeErrors(boolean ideErrors) {
this.ideErrors = ideErrors; this.ideErrors = ideErrors;
@@ -220,7 +223,7 @@ public class WsdlToDotnet extends Task {
* offer different options. * offer different options.
* @since Ant 1.7 * @since Ant 1.7
* *
* @param protocol
* @param protocol the protocol to use.
*/ */
public void setProtocol(String protocol) { public void setProtocol(String protocol) {
this.protocol = protocol; this.protocol = protocol;
@@ -230,7 +233,7 @@ public class WsdlToDotnet extends Task {
* add a new source schema to the compilation * add a new source schema to the compilation
* @since Ant 1.7 * @since Ant 1.7
* *
* @param source
* @param source a nested schema element.
*/ */
public void addSchema(Schema source) { public void addSchema(Schema source) {
schemas.add(source); schemas.add(source);
@@ -239,7 +242,7 @@ public class WsdlToDotnet extends Task {
/** /**
* flag to trigger turning a filename into a file:url * flag to trigger turning a filename into a file:url
* ignored for the mono compiler. * ignored for the mono compiler.
* @param b
* @param b a <code>boolean</code> value.
*/ */
public void setMakeURL(boolean b) { public void setMakeURL(boolean b) {
wsdl.setMakeURL(b); wsdl.setMakeURL(b);
@@ -248,7 +251,7 @@ public class WsdlToDotnet extends Task {
/** /**
* identify the compiler * identify the compiler
* @since Ant 1.7 * @since Ant 1.7
* @param compiler
* @param compiler the enumerated value.
*/ */
public void setCompiler(Compiler compiler) { public void setCompiler(Compiler compiler) {
this.compiler = compiler; this.compiler = compiler;
@@ -365,10 +368,16 @@ public class WsdlToDotnet extends Task {
private String url; private String url;
private boolean makeURL = false; 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"; 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"; 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: "; 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: "; 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 "; public static final String ERROR_NO_URL_CONVERT = "Could not URL convert ";


/** /**
@@ -411,18 +420,26 @@ public class WsdlToDotnet extends Task {
return file.toString(); return file.toString();
} }


/**
* Get the file.
* @return the file used.
*/
public File getFile() { public File getFile() {
return file; return file;
} }


/** /**
* name of a file to use as a source of WSDL or XSD data * 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) { public void setFile(File file) {
this.file = file; this.file = file;
} }


/**
* Get the url.
* @return the URL of the resource.
*/
public String getUrl() { public String getUrl() {
return url; return url;
} }
@@ -430,12 +447,16 @@ public class WsdlToDotnet extends Task {
/** /**
* url of a resource. * url of a resource.
* URLs have no timestamp checking, and are not validated * URLs have no timestamp checking, and are not validated
* @param url
* @param url the URL string to use.
*/ */
public void setUrl(String url) { public void setUrl(String url) {
this.url = url; this.url = url;
} }


/**
* Get the makeURL attribute.
* @return the attribute.
*/
public boolean isMakeURL() { public boolean isMakeURL() {
return makeURL; return makeURL;
} }
@@ -443,7 +464,7 @@ public class WsdlToDotnet extends Task {
/** /**
* flag to request that a file is turned into an absolute file: URL * flag to request that a file is turned into an absolute file: URL
* before being passed to the WSDL compiler * before being passed to the WSDL compiler
* @param makeURL
* @param makeURL a <code>boolean</code> value.
*/ */
public void setMakeURL(boolean makeURL) { public void setMakeURL(boolean makeURL) {
this.makeURL = makeURL; this.makeURL = makeURL;
@@ -467,16 +488,23 @@ public class WsdlToDotnet extends Task {
*/ */
public static class Compiler extends EnumeratedAttribute { public static class Compiler extends EnumeratedAttribute {


/** microsoft */
public static final String COMPILER_MS = "microsoft"; public static final String COMPILER_MS = "microsoft";
/** mono */
public static final String COMPILER_MONO = "mono"; public static final String COMPILER_MONO = "mono";
/** microsoft-on-mono */
public static final String COMPILER_MS_ON_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 = { String[] compilers = {
COMPILER_MS, COMPILER_MS,
COMPILER_MONO, COMPILER_MONO,
COMPILER_MS_ON_MONO COMPILER_MS_ON_MONO
}; };


/** WSDL */
public static final String EXE_WSDL = "wsdl"; public static final String EXE_WSDL = "wsdl";
/** MONO */
public static final String EXE_MONO = "mono"; public static final String EXE_MONO = "mono";
/** /**
* programs to run * programs to run
@@ -503,6 +531,7 @@ public class WsdlToDotnet extends Task {
true true
}; };


// CheckStyle:VisibilityModifier ON
/** /**
* This is the only method a subclass needs to implement. * This is the only method a subclass needs to implement.
* *
@@ -542,13 +571,17 @@ public class WsdlToDotnet extends Task {
return extraCompilerArgs[getIndex()]; return extraCompilerArgs[getIndex()];
} }


/**
* Get where the current value supports absolute files.
* @return true if the compiler does supports absolute files.
*/
public boolean supportsAbsoluteFiles() { public boolean supportsAbsoluteFiles() {
return absoluteFiles[getIndex()]; return absoluteFiles[getIndex()];
} }


/** /**
* apply any extra arguments of this class * apply any extra arguments of this class
* @param command
* @param command the command to apply the arguments to.
*/ */
public void applyExtraArgs(NetCommand command) { public void applyExtraArgs(NetCommand command) {
String[] args = getExtraArgs(); String[] args = getExtraArgs();


Loading…
Cancel
Save