You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by jf...@apache.org on 2011/07/09 06:56:10 UTC

svn commit: r1144608 - in /incubator/npanday/trunk/components: dotnet-core/src/main/resources/META-INF/npanday/ dotnet-executable/src/main/java/npanday/executable/compiler/impl/

Author: jfallows
Date: Sat Jul  9 06:56:09 2011
New Revision: 1144608

URL: http://svn.apache.org/viewvc?rev=1144608&view=rev
Log:
Updated syntax for portable class library support, NPANDAY-450

Modified:
    incubator/npanday/trunk/components/dotnet-core/src/main/resources/META-INF/npanday/compiler-plugins.xml
    incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/CSharpCompilerForProfile.java
    incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java

Modified: incubator/npanday/trunk/components/dotnet-core/src/main/resources/META-INF/npanday/compiler-plugins.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/main/resources/META-INF/npanday/compiler-plugins.xml?rev=1144608&r1=1144607&r2=1144608&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-core/src/main/resources/META-INF/npanday/compiler-plugins.xml (original)
+++ incubator/npanday/trunk/components/dotnet-core/src/main/resources/META-INF/npanday/compiler-plugins.xml Sat Jul  9 06:56:09 2011
@@ -209,12 +209,12 @@ under the License.
     </commandFilter>
   </compilerPlugin>
   <compilerPlugin>
-    <identifier>MS-CS:4.0:Portable</identifier>
+    <identifier>MS-CS:4.0+.NETPortable,Profile2</identifier>
     <pluginClass>npanday.executable.compiler.impl.CSharpCompilerForProfile</pluginClass>
     <vendor>MICROSOFT</vendor>
     <executable>csc</executable>
     <language>C_SHARP</language>
-    <profile>PORTABLE</profile>
+    <profile>.NETPortable,Profile2</profile>
     <frameworkVersions>
       <frameworkVersion>4.0</frameworkVersion>      
     </frameworkVersions>
@@ -224,7 +224,7 @@ under the License.
         <architecture>x86</architecture>
       </platform>
     </platforms>
-    <defaultAssemblyPath>C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0</defaultAssemblyPath>
+    <defaultAssemblyPath>C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile2</defaultAssemblyPath>
     <assemblies>
       <assembly>mscorlib</assembly>
       <assembly>System</assembly>
@@ -573,6 +573,87 @@ under the License.
     </commandFilter>
   </compilerPlugin>
   <compilerPlugin>
+    <identifier>MONO-CS:4.0+.NETPortable,Profile2</identifier>
+    <pluginClass>npanday.executable.compiler.impl.CSharpCompilerForProfile</pluginClass>
+    <vendor>MONO</vendor>
+    <executable>gmcs</executable>
+    <language>C_SHARP</language>
+    <profile>.NETPortable,Profile2</profile>
+    <frameworkVersions>
+      <frameworkVersion>4.0</frameworkVersion>      
+    </frameworkVersions>
+    <platforms>
+      <platform>
+        <operatingSystem>Windows</operatingSystem>
+      </platform>
+      <platform>      
+        <operatingSystem>Mac OS X</operatingSystem>
+      </platform>
+      <platform>
+        <operatingSystem>Linux</operatingSystem>
+      </platform>
+      <platform>
+        <operatingSystem>Solaris</operatingSystem>
+      </platform>
+      <platform>
+        <operatingSystem>FreeBSD</operatingSystem>
+      </platform>
+    </platforms>
+    <!-- Mono 2.10.2 missing .NETPortable defaultAssemblyPath, requires profileAssemblyPath -->
+    <assemblies>
+      <assembly>mscorlib</assembly>
+      <assembly>System</assembly>
+      <assembly>System.Core</assembly>
+      <assembly>System.Net</assembly>
+      <assembly>System.Runtime.Serialization</assembly>
+      <assembly>System.ServiceModel</assembly>
+      <assembly>System.Xml</assembly>
+      <assembly>System.Xml.Serialization</assembly>
+    </assemblies>
+    <commandFilter>
+      <includes>
+        <include>out</include>
+        <include>target</include>
+        <include>delaysign</include>
+        <include>doc</include>
+        <include>keyfile</include>
+        <include>keycontainer</include>
+        <include>platform</include>
+        <include>recurse</include>
+        <include>reference</include>
+        <include>addmodule</include>
+        <include>win32res</include>
+        <include>win32icon</include>
+        <include>resource</include>
+        <include>linkresource</include>
+        <include>debug</include>
+        <include>optimize</include>
+        <include>warnaserror</include>
+        <include>warn</include>
+        <include>nowarn</include>
+        <include>checked</include>
+        <include>unsafe</include>
+        <include>define</include>
+        <include>langversion</include>
+        <include>help</include>
+        <include>nologo</include>
+        <include>noconfig</include>
+        <include>baseaddress</include>
+        <include>bugreport</include>
+        <include>codepage</include>
+        <include>utf8output</include>
+        <include>main</include>
+        <include>fullpaths</include>
+        <include>filealign</include>
+        <include>pdb</include>
+        <include>nostdlib</include>
+        <include>lib</include>
+        <include>errorreport</include>
+        <include>moduleassemblyname</include>
+      </includes>
+    </commandFilter>
+  </compilerPlugin>
+  <compilerPlugin>
     <identifier>NEM</identifier>
     <pluginClass>npanday.executable.compiler.impl.NemerleCompiler</pluginClass>
     <vendor>MONO</vendor>

Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/CSharpCompilerForProfile.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/CSharpCompilerForProfile.java?rev=1144608&r1=1144607&r2=1144608&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/CSharpCompilerForProfile.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/CSharpCompilerForProfile.java Sat Jul  9 06:56:09 2011
@@ -18,7 +18,7 @@
  */
 package npanday.executable.compiler.impl;
 
-import npanday.executable.NetExecutable;
+import npanday.executable.compiler.CompilerExecutable;
 import npanday.executable.ExecutionException;
 import npanday.NPandayContext;
 import npanday.executable.compiler.CompilerContext;
@@ -34,24 +34,37 @@ import java.io.File;
 public final class CSharpCompilerForProfile
     extends BaseCompiler
 {
-    private NetExecutable netCompiler;
-
+    private CompilerExecutable netCompiler;
     private CompilerContext compilerContext;
 
-    public boolean failOnErrorOutput()
+    public CSharpCompilerForProfile()
     {
-        return true;
+        netCompiler = new DefaultCompiler();
     }
 
-    public CSharpCompilerForProfile()
+    public void init( NPandayContext npandayContext )
     {
-        netCompiler = new DefaultCompiler();
+        super.init( npandayContext);
+        netCompiler.init( npandayContext );
+        this.compilerContext = (CompilerContext) npandayContext;
+    }
+
+    public boolean failOnErrorOutput()
+    {
+        return netCompiler.failOnErrorOutput();
     }
 
     public List<String> getCommands()
         throws ExecutionException
     {
-        File path = new File( compilerContext.getCompilerCapability().getAssemblyPath() );
+        String assemblyPath = compilerContext.getCompilerCapability().getAssemblyPath();
+        if ( assemblyPath == null )
+        {
+            throw new ExecutionException(
+                "NPANDAY-067-003: The assembly path is not specified" );
+        }
+
+        File path = new File( assemblyPath );
         if ( !path.exists() )
         {
             throw new ExecutionException(
@@ -72,11 +85,4 @@ public final class CSharpCompilerForProf
     {
         
     }
-
-    public void init( NPandayContext npandayContext )
-    {
-        super.init( npandayContext);
-        netCompiler.init( npandayContext );
-        this.compilerContext = (CompilerContext) npandayContext;
-    }
 }

Modified: incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java?rev=1144608&r1=1144607&r2=1144608&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java (original)
+++ incubator/npanday/trunk/components/dotnet-executable/src/main/java/npanday/executable/compiler/impl/DefaultCompiler.java Sat Jul  9 06:56:09 2011
@@ -207,7 +207,8 @@ public final class DefaultCompiler
         }
         commands.add( "/warnaserror-" );
         //commands.add( "/nowarn" );
-        if ( compilerContext.getCompilerRequirement().getVendor().equals( Vendor.MONO ) )
+        if ( compilerContext.getCompilerRequirement().getVendor().equals( Vendor.MONO ) &&
+                 compilerContext.getCompilerRequirement().getProfile() == null)
         {
             commands.add( "/nostdlib" );
             commands.add( "/noconfig" );