diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java index cd8dfd0a7..35bc33d44 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java @@ -69,9 +69,9 @@ package org.apache.tools.ant.taskdefs.optional.dotnet; // ==================================================================== import java.io.File; - import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.MatchingTask; import org.apache.tools.ant.types.Path; @@ -746,9 +746,9 @@ public class CSharp *@exception BuildException if target is not one of * exe|library|module|winexe */ - public void setTargetType(String targetType) + public void setTargetType(String ttype) throws BuildException { - targetType = targetType.toLowerCase(); + targetType = ttype.toLowerCase(); if (targetType.equals("exe") || targetType.equals("library") || targetType.equals("module") || targetType.equals("winexe")) { targetType = targetType; @@ -1006,7 +1006,7 @@ public class CSharp */ protected String getFileAlignParameter() { if (fileAlign != 0) { - return "/filealing:" + fileAlign; + return "/filealign:" + fileAlign; } else { return null; } @@ -1068,6 +1068,7 @@ public class CSharp if (srcDir == null) { srcDir = project.resolveFile("."); } + log("CSC working from source directory "+srcDir,Project.MSG_VERBOSE); validate(); NetCommand command = new NetCommand(this, "CSC", csc_exe_name); @@ -1114,11 +1115,17 @@ public class CSharp //add to the command for (int i = 0; i < dependencies.length; i++) { File targetFile = new File(base,dependencies[i]); + log(targetFile.toString(),Project.MSG_VERBOSE); command.addArgument(targetFile.toString()); if(targetFile.lastModified()>outputTimestamp) { filesOutOfDate++; - log("Source file "+targetFile.toString()+" is out of date"); + log("Source file "+targetFile.toString()+" is out of date", + Project.MSG_VERBOSE); + } else { + log("Source file "+targetFile.toString()+" is up to date", + Project.MSG_VERBOSE); } + } //now run the command of exe + settings + files diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java index 85682ab09..bed5feacb 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java @@ -226,7 +226,7 @@ public class Ilasm public void setTargetType(String targetType) throws BuildException { - targetType = targetType.toLowerCase(); + this.targetType = targetType.toLowerCase(); if (targetType.equals("exe") || targetType.equals("library")) { targetType = targetType; } else { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java index d31de4109..c7491842f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java @@ -132,9 +132,9 @@ public class NetCommand { */ public NetCommand(Task owner, String title, String program) { - owner = owner; - title = title; - program = program; + this.owner = owner; + this.title = title; + this.program = program; commandLine = new Commandline(); commandLine.setExecutable(program); prepareExecutor(); @@ -215,6 +215,12 @@ public class NetCommand { */ protected void prepareExecutor() { // default directory to the project's base directory + if(owner==null) { + throw new RuntimeException("no owner"); + } + if(owner.getProject()==null) { + throw new RuntimeException("Owner has no project"); + } File dir = owner.getProject().getBaseDir(); ExecuteStreamHandler handler = new LogStreamHandler(owner, Project.MSG_INFO, Project.MSG_WARN);