bodewig 01/08/06 23:19:25
Modified: . WHATSNEW
docs/manual/OptionalTasks dotnet.html
src/main/org/apache/tools/ant/taskdefs/optional/dotnet
CSharp.java Ilasm.java
Log:
update .NET tasks for the beta2 release
changes
-removed 'owner' attribute from ILASM (it just prints a warning and is
stripped from the docs)
-changed the referenced dlls to the beta-2 set
-added some options to csc:
fullpaths
win32res
noconfig
utf8output
Submitted by: Steve Loughran <[EMAIL PROTECTED]>
Revision Changes Path
1.141 +2 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -r1.140 -r1.141
--- WHATSNEW 2001/08/06 14:32:45 1.140
+++ WHATSNEW 2001/08/07 06:19:25 1.141
@@ -143,6 +143,8 @@
* <fixrlf> can now with CR only line-ends and can use an arbitraty
between 2 and 80.
+* The .NET tasks have been adapted to the beta2 release of the framework.
+
Fixed bugs:
-----------
1.4 +48 -11 jakarta-ant/docs/manual/OptionalTasks/dotnet.html
Index: dotnet.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/OptionalTasks/dotnet.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- dotnet.html 2001/03/04 13:35:49 1.3
+++ dotnet.html 2001/08/07 06:19:25 1.4
@@ -6,7 +6,6 @@
<body bgcolor="#ffffff">
<h1>.NET classes for Ant</h1>
-<p>By Steve Loughran; [EMAIL PROTECTED]</p>
<h2>Vision</h2>
<p>
@@ -54,7 +53,6 @@
<li>Type Library Exporter (TlbExp.exe) .dll -> .tlb</li>
<li>TlbImp.exe Type Library Importer </li>
<li>RegAsm.exe Assembly Registration Tool .dll -> .reg | registration</li>
-<li>WebServiceUtil -SOAP proxy import, SDL generation tool</li>
</ol>
<h2>Ant Wrapper for net tasks</h2>
@@ -97,7 +95,7 @@
To use the net tasks one needs
<ul>
-<li> A Win2K box (or any other platform which supports the .net build
tools)</li>
+<li> A Windows box (or any other platform which supports the .net build
tools)</li>
<li> JavaVM - Java1.1 or later; Java1.3 recommended.</li>
@@ -118,6 +116,15 @@
<hr>
<h2> Change Log </h2>
+<h4>Version 0.4</h4>
+This is the beta-2 revision of the tasks.
+<ol>
+<li>ILASM: pulled the owner attribute, added keyfile for giving binaries a
strong name
+(MD5 hash of the checksum)
+<li>CSC: added win32res , noConfig, utf8output, fullpaths
+<li>CSC:
+</ol>
+
<h4>Version 0.3</h4>
The changes here reflect Beta-1 of the dotnet SDK and experience of use in
@@ -245,6 +252,11 @@
<td valign="top">"true"(default) or "false"</td>
</tr>
<tr>
+ <td valign="top">fullpaths</td>
+ <td valign="top">print the full path of files on on errors</td>
+ </tr>
+
+ <tr>
<td valign="top">includes</td>
<td valign="top">comma separated list of patterns of files that must be
included. All files are included when omitted.</td>
@@ -275,6 +287,13 @@
<td valign="top">"com.example.project.entrypoint"</td>
</tr>
<tr>
+ <td valign="top">noConfig</td>
+ <td valign="top">a flag which tells the compiler not
+ to read in the compiler settings files 'csc.rsp' in its
+ bin directory and then the local directory</td>
+ <td valign="top">"true" or "false"(default)</td>
+ </tr>
+<tr>
<td valign="top">optimize</td>
<td valign="top">optimisation flag</td>
<td valign="top">"true" or "false"(default)</td>
@@ -308,7 +327,12 @@
</tr>
<tr>
<td valign="top">unsafe</td>
- <td valign="top">enable unsafe code</td>
+ <td valign="top">enable the <b>unsafe</b> keyword</td>
+ <td valign="top">"true" or "false"(default)</td>
+ </tr>
+<tr>
+ <td valign="top">utf8output</td>
+ <td valign="top">require all compiler output to be in utf-8 format</td>
<td valign="top">"true" or "false"(default)</td>
</tr>
<tr>
@@ -322,6 +346,12 @@
<td valign="top">filename of icon to include</td>
<td valign="top">"res/myicon.ico"</td>
</tr>
+<tr>
+ <td valign="top">win32res</td>
+ <td valign="top">filename of a win32 resource (.RES)file to include
+ This is not a .NET resource, but it what windows is used to.</td>
+ <td valign="top">"res/myapp.res"</td>
+ </tr>
</table>
<p>
@@ -344,7 +374,7 @@
<hr>
<h2> Task: ilasm </h2>
<p>Task to assemble .net 'Intermediate Language' files.
-The task will only work on win2K until other platforms support csc.exe or
+The task will only work on windows until other platforms support csc.exe or
an equivalent. ilasm.exe must be on the execute path too.
</p>
<p>
@@ -399,7 +429,8 @@
<tr>
<td valign="top">extraOptions</td>
<td valign="top">Any extra options which aren't explicitly
- supported by the ilasm task </td>
+ supported by the ilasm task, primarily because they
+ arent really documented: use ilasm /? to see them</td>
<td></td>
</tr>
@@ -408,6 +439,11 @@
<td valign="top">Should a failed compile halt the build?</td>
<td valign="top">"true"(default)</td>
</tr>
+<tr>
+ <td valign="top">fullpaths</td>
+ <td valign="top">Should error text provide the full path to files</td>
+ <td valign="top">"true"(default)</td>
+ </tr>
<tr>
<td valign="top">includes</td>
<td valign="top">comma separated list of patterns of files that must be
@@ -418,6 +454,12 @@
<td valign="top">the name of a file. Each line of this file is
taken to be an include pattern</td>
</tr>
+ <tr>
+ <td valign="top">keyfile</td>
+ <td valign="top">the name of a file containing a private key, with which
+ the assembly output is checksumed and then MD5 signed
+ to have a <i>strong name</i></td>
+ </tr>
<tr>
<td valign="top">listing</td>
<td valign="top">Produce a listing (off by default). Listings go to the
@@ -428,11 +470,6 @@
<td valign="top">outputFile</td>
<td valign="top">filename of output</td>
<td valign="top">"example.exe"</td>
- </tr>
-<tr>
- <td valign="top">owner</td>
- <td valign="top">restrict disassembly by setting the 'owner' string</td>
- <td valign="top">"secret"</td>
</tr>
<tr>
<td valign="top">resourceFile</td>
1.7 +106 -23
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
Index: CSharp.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CSharp.java 2001/07/07 13:51:12 1.6
+++ CSharp.java 2001/08/07 06:19:25 1.7
@@ -222,9 +222,10 @@
}
/**
+ * Fix C# reference inclusion.
* C# is really dumb in how it handles inclusion. You have to list
* every 'assembly' -read DLL that is imported. So already you are
- * making a platform assumption -shared libraries have a .dll extension
+ * making a platform assumption -shared libraries have a .dll;"+
extension
* and the poor developer has to know every library which is included
* why the compiler cant find classes on the path or in a directory,
* is a mystery.
@@ -236,27 +237,43 @@
* Casing is chosen to match that of the file system <i>exactly</i>
* so may work on a unix box too.
*/
- protected static final String DEFAULT_REFERENCE_LIST
- ="System.dll;System.Drawing.dll;System.Data.dll;"+
- "System.Diagnostics.dll;"+
- "System.DirectoryServices.dll;"+
- "System.IO.dll;"+
- "System.Management.dll;"+
- "System.Messaging.dll;"+
- "System.Net.dll;"+
- "System.Runtime.Remoting.dll;"+
- "System.Runtime.Serialization.Formatters.Soap.dll;"+
- "System.Security.dll;"+
- "System.ServiceProcess.dll;"+
- "System.Text.RegularExpressions.dll;"+
- "System.Timers.dll;"+
- "System.Web.dll;"+
- "System.Web.Services.dll;"+
- "System.WinForms.dll;"+
- "System.XML.dll;"+
- "System.XML.Serialization.dll;"+
- "Microsoft.ComServices.dll;";
-
+
+ protected static final String DEFAULT_REFERENCE_LIST=
+ "Accessibility.dll;"+
+ "cscompmgd.dll;"+
+ "CustomMarshalers.dll;"+
+ "IEExecRemote.dll;"+
+ "IEHost.dll;"+
+ "IIEHost.dll;"+
+ "ISymWrapper.dll;"+
+ "Microsoft.JScript.dll;"+
+ "Microsoft.VisualBasic.dll;"+
+ "Microsoft.VisualC.dll;"+
+ "Microsoft.Vsa.dll;"+
+ "Mscorcfg.dll;"+
+ "RegCode.dll;"+
+ "System.Configuration.Install.dll;"+
+ "System.Data.dll;"+
+ "System.Design.dll;"+
+ "System.DirectoryServices.dll;"+
+ "System.EnterpriseServices.dll;"+
+ "System.dll;"+
+ "System.Drawing.Design.dll;"+
+ "System.Drawing.dll;"+
+ "System.Management.dll;"+
+ "System.Messaging.dll;"+
+ "System.Runtime.Remoting.dll;"+
+ "System.Runtime.Serialization.Formatters.Soap.dll;"+
+ "System.Security.dll;"+
+ "System.ServiceProcess.dll;"+
+ "System.Web.dll;"+
+ "System.Web.RegularExpressions.dll;"+
+ "System.Web.Services.dll;"+
+ "System.Windows.Forms.dll;"+
+ "System.XML.dll;";
+
+
+
/**
* get default reference list
* @return null or a string of references.
@@ -608,7 +625,68 @@
else
return null;
}
+ /** icon for incorporation into apps
+ */
+ protected File _win32res;
+
+ /**
+ * Set the win32 icon
+ * @param fileName path to the file. Can be relative, absolute, whatever.
+ */
+ public void setWin32Res(File fileName) {
+ _win32res = fileName;
+ }
+ /**
+ * get the argument or null for no argument needed
+ *
+ * @return The Win32Icon Parameter to CSC
+ */
+ protected String getWin32ResParameter() {
+ if (_win32res!=null)
+ return "/win32res:"+_win32res.toString();
+ else
+ return null;
+ }
+
+ /**
+ * utf out flag
+ */
+
+ protected boolean _utf8output=false;
+
+ /**
+ * enable generation of utf8 output from the compiler.
+ */
+ public void setUtf8Output(boolean enabled) {
+ _utf8output=enabled;
+ }
+
+ protected String getUtf8OutpuParameter() {
+ return _utf8output?"/utf8output":null;
+ }
+
+ protected boolean _noconfig=false;
+
+ protected void setNoConfig(boolean enabled) {
+ _noconfig=enabled;
+ }
+
+ protected String getNoConfigParameter() {
+ return _noconfig?"/noconfig":null;
+ }
+
+ // /fullpaths
+ protected boolean _fullpaths=false;
+
+ public void setFullPaths(boolean enabled) {
+ _fullpaths=enabled;
+ }
+
+ protected String getFullPathsParameter() {
+ return _fullpaths?"/fullpaths":null;
+ }
+
/** defines list
* something like 'RELEASE;WIN32;NO_SANITY_CHECKS;;SOMETHING_ELSE'
*/
@@ -720,6 +798,7 @@
_additionalModules=null;
_includeDefaultReferences=true;
_extraOptions=null;
+ _fullpaths=true;
}
/**
@@ -760,8 +839,12 @@
command.addArgument(getOutputFileParameter());
command.addArgument(getIncludeDefaultReferencesParameter());
command.addArgument(getDefaultReferenceParameter());
+ command.addArgument(getWin32ResParameter());
+ command.addArgument(getUtf8OutpuParameter());
+ command.addArgument(getNoConfigParameter());
+ command.addArgument(getFullPathsParameter());
command.addArgument(getExtraOptionsParameter());
-
+
//get dependencies list.
DirectoryScanner scanner = super.getDirectoryScanner(_srcDir);
String[] dependencies = scanner.getIncludedFiles();
1.7 +21 -21
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java
Index: Ilasm.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Ilasm.java 2001/07/07 13:51:12 1.6
+++ Ilasm.java 2001/08/07 06:19:25 1.7
@@ -144,11 +144,9 @@
_listing = false;
_verbose=false;
_debug=true;
- _owner=null;
_outputFile=null;
_failOnError=true;
_resourceFile=null;
- _owner=null;
_extraOptions=null;
}
@@ -212,10 +210,6 @@
return null;
}
- /** owner string is a slightly trivial barrier to disassembly
- */
-
- protected String _owner;
/**
* Sets the Owner attribute
@@ -224,21 +218,9 @@
*/
public void setOwner(String s) {
- _owner=s;
+ log("This option is not supported by ILASM as of Beta-2, and will be
ignored",Project.MSG_WARN);
}
-
- /**
- * Gets the Owner switch for ilasm
- *
- * @return The Owner string
- */
- protected String getOwnerParameter() {
- if(notEmpty(_owner))
- return "/owner="+_owner;
- else
- return null;
- }
-
+
/** test for a string containing something useful
* @param string to test
* @returns true if the argument is not null or empty
@@ -373,6 +355,24 @@
return _debug?"/debug":null;
}
+ /** file containing private key
+ */
+
+ private File _keyfile;
+
+ public void setKeyfile(File keyfile) {
+ this._keyfile=keyfile;
+ }
+
+ /** get the argument or null for no argument needed
+ */
+ protected String getKeyfileParameter() {
+ if(_keyfile!=null)
+ return "/keyfile:"+_keyfile.toString();
+ else
+ return null;
+ }
+
/** any extra command options?
*/
protected String _extraOptions;
@@ -446,9 +446,9 @@
command.addArgument(getTargetTypeParameter());
command.addArgument(getListingParameter());
command.addArgument(getOutputFileParameter());
- command.addArgument(getOwnerParameter());
command.addArgument(getResourceFileParameter());
command.addArgument(getVerboseParameter());
+ command.addArgument(getKeyfileParameter());
command.addArgument(getExtraOptionsParameter());