Browse Source

Remove incorrect check on the output file length

PR:	15568
Submitted by:	Mike Schilling


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273678 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 22 years ago
parent
commit
ef710b0303
2 changed files with 14 additions and 16 deletions
  1. +12
    -13
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java
  2. +2
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java

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

@@ -93,7 +93,7 @@ import org.apache.tools.ant.types.EnumeratedAttribute;
* First creation * First creation
* </td> * </td>
* <td> * <td>
* Most of the code here was copied verbatim from v0.3 of
* Most of the code here was copied verbatim from v0.3 of
* Steve Loughran's CSharp optional task. Abstracted functionality * Steve Loughran's CSharp optional task. Abstracted functionality
* to allow subclassing of other dotnet compiler types. * to allow subclassing of other dotnet compiler types.
* </td> * </td>
@@ -255,7 +255,7 @@ public abstract class DotnetCompile
clear(); clear();
setIncludes(getFilePattern()); setIncludes(getFilePattern());
} }
/** /**
* reset all contents. * reset all contents.
*/ */
@@ -600,7 +600,7 @@ public abstract class DotnetCompile
targetType.equals("module") || targetType.equals("winexe")) { targetType.equals("module") || targetType.equals("winexe")) {
targetType = targetType; targetType = targetType;
} else { } else {
throw new BuildException("targetType " + targetType
throw new BuildException("targetType " + targetType
+ " is not one of 'exe', 'module', 'winexe' or 'library'" ); + " is not one of 'exe', 'module', 'winexe' or 'library'" );
} }
} }
@@ -663,7 +663,7 @@ public abstract class DotnetCompile
public void setWin32Res(File fileName) { public void setWin32Res(File fileName) {
win32res = fileName; win32res = fileName;
} }
/** /**
* Gets the file of the win32 .res file to include. * Gets the file of the win32 .res file to include.
* @return path to the file. * @return path to the file.
@@ -775,7 +775,7 @@ public abstract class DotnetCompile
public void setDestFile(File file) { public void setDestFile(File file) {
outputFile = file; outputFile = file;
} }


/** /**
* get the argument or null for no argument needed * get the argument or null for no argument needed
@@ -784,8 +784,7 @@ public abstract class DotnetCompile
*/ */
protected String getDestFileParameter() { protected String getDestFileParameter() {
if (outputFile != null) { if (outputFile != null) {
File f = outputFile;
return "/out:" + f.toString();
return "/out:" + outputFile.toString();
} else { } else {
return null; return null;
} }
@@ -825,14 +824,14 @@ public abstract class DotnetCompile
/** /**
* validation code * validation code
* @throws BuildException if validation failed * @throws BuildException if validation failed
*/
protected void validate()
*/
protected void validate()
throws BuildException { throws BuildException {
if (outputFile != null && outputFile.isDirectory()) { if (outputFile != null && outputFile.isDirectory()) {
throw new BuildException("destFile cannot be a directory"); throw new BuildException("destFile cannot be a directory");
} }
} }
/** /**
* Based on DEFAULT_REFERENCE_LIST and getReferenceDelimiter(), * Based on DEFAULT_REFERENCE_LIST and getReferenceDelimiter(),
* build the appropriate reference string for the compiler. * build the appropriate reference string for the compiler.
@@ -846,7 +845,7 @@ public abstract class DotnetCompile
} }
return referenceList.toString(); return referenceList.toString();
} }
/** /**
* Get the pattern for files to compile. * Get the pattern for files to compile.
* @return The compilation file pattern. * @return The compilation file pattern.
@@ -878,14 +877,14 @@ public abstract class DotnetCompile
addFilesAndExecute(command); addFilesAndExecute(command);


} }
/** /**
* Get the delimiter that the compiler uses between references. * Get the delimiter that the compiler uses between references.
* For example, c# will return ";"; VB.NET will return "," * For example, c# will return ";"; VB.NET will return ","
* @return The string delimiter for the reference string. * @return The string delimiter for the reference string.
*/ */
public abstract String getReferenceDelimiter(); public abstract String getReferenceDelimiter();
/** /**
* Get the name of the compiler executable. * Get the name of the compiler executable.
* @return The name of the compiler executable. * @return The name of the compiler executable.


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

@@ -341,11 +341,10 @@ public class Ilasm
*@return the argument string or null for no argument *@return the argument string or null for no argument
*/ */
protected String getOutputFileParameter() { protected String getOutputFileParameter() {
if (outputFile == null || outputFile.length() == 0) {
if (outputFile == null) {
return null; return null;
} }
File f = outputFile;
return "/output=" + f.toString();
return "/output=" + outputFile.toString();
} }






Loading…
Cancel
Save