Browse Source

Lets try this as a fix: A new option to turn standardlib on

or off that overrides the defaultreferences switch


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275046 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 22 years ago
parent
commit
067838cf39
1 changed files with 31 additions and 1 deletions
  1. +31
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetCompile.java

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

@@ -160,6 +160,8 @@ public abstract class DotnetCompile

protected String executable;

protected Boolean standardLib;

/**
* Fix .NET reference inclusion. .NET is really dumb in how it handles
* inclusion. You have to list every 'assembly' -read DLL that is imported.
@@ -392,7 +394,11 @@ public abstract class DotnetCompile
*@return The Parameter to CSC
*/
protected String getIncludeDefaultReferencesParameter() {
return "/nostdlib" + (includeDefaultReferences ? "-" : "+");
if(standardLib==null) {
return "/nostdlib" + (includeDefaultReferences ? "-" : "+");
} else {
return null;
}
}


@@ -816,6 +822,29 @@ public abstract class DotnetCompile
this.executable = executable;
}

/**
* turn standard lib support on or off.
* Setting this in either direction overrides anything set in defaultreferences.
* @param standardLib
*/
public void setStandardLib(Boolean standardLib) {
this.standardLib = standardLib;
}


/**
* get the include default references flag or null for no argument needed
*
*@return The Parameter to CSC
*/
protected String getStandardLibParameter() {
if (standardLib != null) {
return "/nostdlib" + (standardLib.booleanValue() ? "-" : "+");
} else {
return null;
}
}

/**
* test for a string containing something useful
*
@@ -909,6 +938,7 @@ public abstract class DotnetCompile
command.addArgument(getAdditionalModulesParameter());
command.addArgument(getDebugParameter());
command.addArgument(getDefaultReferenceParameter());
command.addArgument(getStandardLibParameter());
command.addArgument(getDefinitionsParameter());
command.addArgument(getExtraOptionsParameter());
command.addArgument(getMainClassParameter());


Loading…
Cancel
Save