You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Hilco Wijbenga <hi...@gmail.com> on 2009/09/20 01:26:01 UTC

C# compiler / plexus-compiler-csharp

Hi all,

I found the plexus-compiler-csharp in
http://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html.
I'd like to know how to actually use this compiler.

I've got some Java code and some C# code (the latter currently in
src/main/csharp but I've also tried src/main/cs). I can't get the C#
code to compile. Mvn -X seems to indicate that the compiler plugin is
still looking in src/main/java for the C# code.

When I put C# code in src/main/java I get a complaint that "This
compiler doesn't support in-process compilation.".

How is this supposed to work? Or should I forget about this plugin and
use an Ant task?

Cheers,
Hilco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: C# compiler / plexus-compiler-csharp

Posted by Hilco Wijbenga <hi...@gmail.com>.
2009/9/19 Hilco Wijbenga <hi...@gmail.com>:
> (Actually, I don't think compilerArgument does anything for javac
> either. I just tried it with "beep beep" and it didn't trigger any
> kind of error or warning. So unless javac compiles a little quicker
> when the Roadrunner urges it on...) :-)

Mmmh, I stand corrected. I just tried it again and now it does fail.
In fact, even "-g -deprecation" fails. It seems to only allow either
"-g" or "-deprecation" but not both.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: C# compiler / plexus-compiler-csharp

Posted by Hilco Wijbenga <hi...@gmail.com>.
2009/9/19 Martin Gainty <mg...@hotmail.com>:
>    <plugin>
>        <artifactId>maven-compiler-plugin</artifactId>
>        <configuration>
>          <compilerId>csharp</compilerId>
> <compilerArgument>csc /out:My.exe File.cs</compilerArgument
>        </configuration>
>        <dependencies>
>          <dependency>
>            <groupId>org.codehaus.plexus</groupId>
>            <artifactId>plexus-compiler-csharp</artifactId>
>            <version>1.5.2</version>
>          </dependency>
>        </dependencies>
>      </plugin>

I tried with

<compilerArgument>-target:library
-out:${project.build.directory}/${project.artifactId}-${project.version}.dll
-debug -recurse:src/main/csharp/*.cs</compilerArgument>

but this does not make the slightest difference. I also tried
<compilerArgument>gmcs ...</compilerArgument> (just to be sure) but
again no dice.

Mvn -X compile still shows the plugin to be looking in src/main/java.
Very silly.

I've got it working with an Ant snippet so I'll stick with that, I
guess. This plexus-compiler-csharp plugin doesn't strike me as
particularly useful. ;-)

(Actually, I don't think compilerArgument does anything for javac
either. I just tried it with "beep beep" and it didn't trigger any
kind of error or warning. So unless javac compiles a little quicker
when the Roadrunner urges it on...) :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: C# compiler / plexus-compiler-csharp

Posted by Martin Gainty <mg...@hotmail.com>.
assuming you want to compile something like csc /out:My.exe File.cs     

did you try configuring compilerArgument to take csc argument e.g

    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerId>csharp</compilerId>
<compilerArgument>csc /out:My.exe File.cs</compilerArgument
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-compiler-csharp</artifactId>
            <version>1.5.2</version>
          </dependency>
        </dependencies>
      </plugin>

http://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html

i don't have csc.exe loaded to test.. open to any suggestions/ideas
hth
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Sat, 19 Sep 2009 16:26:01 -0700
> Subject: C# compiler / plexus-compiler-csharp
> From: hilco.wijbenga@gmail.com
> To: users@maven.apache.org
> 
> Hi all,
> 
> I found the plexus-compiler-csharp in
> http://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html.
> I'd like to know how to actually use this compiler.
> 
> I've got some Java code and some C# code (the latter currently in
> src/main/csharp but I've also tried src/main/cs). I can't get the C#
> code to compile. Mvn -X seems to indicate that the compiler plugin is
> still looking in src/main/java for the C# code.
> 
> When I put C# code in src/main/java I get a complaint that "This
> compiler doesn't support in-process compilation.".
> 
> How is this supposed to work? Or should I forget about this plugin and
> use an Ant task?
> 
> Cheers,
> Hilco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

_________________________________________________________________
Bing brings you health info from trusted sources.
http://www.bing.com/search?q=pet+allergy&form=MHEINA&publ=WLHMTAG&crea=TXT_MHEINA_Health_Health_PetAllergy_1x1

Re: C# compiler / plexus-compiler-csharp

Posted by Dan Tran <da...@gmail.com>.
wow, a question finally get a response after 4 years :)


On Sat, Mar 30, 2013 at 10:58 AM, Gabriel Goïc <ga...@gmail.com>wrote:

> Hilco Wijbenga <hilco.wijbenga <at> gmail.com> writes:
>
> >
> > Hi all,
> >
> > I found the plexus-compiler-csharp in
> >
> http://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html
> .
> > I'd like to know how to actually use this compiler.
> >
> > I've got some Java code and some C# code (the latter currently in
> > src/main/csharp but I've also tried src/main/cs). I can't get the C#
> > code to compile. Mvn -X seems to indicate that the compiler plugin is
> > still looking in src/main/java for the C# code.
> >
> > When I put C# code in src/main/java I get a complaint that "This
> > compiler doesn't support in-process compilation.".
> >
> > How is this supposed to work? Or should I forget about this plugin and
> > use an Ant task?
> >
> > Cheers,
> > Hilco
> >
>
>
> This plugin has a "fork" parameter which must be set to true (according to
> the
> source code of the plugin). Try the following:
>
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>3.0</version>
>     <configuration>
>         <compilerId>csharp</compilerId>
>         <fork>true</fork>
>
>
> <executable>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe</executable>
>         <outputFileName>myDLL</outputFileName>
>     </configuration>
>     <dependencies>
>         <dependency>
>             <groupId>org.codehaus.plexus</groupId>
>             <artifactId>plexus-compiler-csharp</artifactId>
>             <version>2.2</version>
>         </dependency>
>     </dependencies>
> </plugin>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: C# compiler / plexus-compiler-csharp

Posted by Gabriel Goïc <ga...@gmail.com>.
Hilco Wijbenga <hilco.wijbenga <at> gmail.com> writes:

> 
> Hi all,
> 
> I found the plexus-compiler-csharp in
> http://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html.
> I'd like to know how to actually use this compiler.
> 
> I've got some Java code and some C# code (the latter currently in
> src/main/csharp but I've also tried src/main/cs). I can't get the C#
> code to compile. Mvn -X seems to indicate that the compiler plugin is
> still looking in src/main/java for the C# code.
> 
> When I put C# code in src/main/java I get a complaint that "This
> compiler doesn't support in-process compilation.".
> 
> How is this supposed to work? Or should I forget about this plugin and
> use an Ant task?
> 
> Cheers,
> Hilco
> 


This plugin has a "fork" parameter which must be set to true (according to the
source code of the plugin). Try the following:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.0</version>
    <configuration>
        <compilerId>csharp</compilerId>
        <fork>true</fork>
       
<executable>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe</executable>
        <outputFileName>myDLL</outputFileName>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-compiler-csharp</artifactId>
            <version>2.2</version>
        </dependency>
    </dependencies>
</plugin>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: C# compiler / plexus-compiler-csharp

Posted by Hilco Wijbenga <hi...@gmail.com>.
2009/9/19 Wendy Smoak <ws...@gmail.com>:
> On Sat, Sep 19, 2009 at 4:26 PM, Hilco Wijbenga
> <hi...@gmail.com> wrote:
>
>> I've got some Java code and some C# code (the latter currently in
>> src/main/csharp but I've also tried src/main/cs). I can't get the C#
>> code to compile. Mvn -X seems to indicate that the compiler plugin is
>> still looking in src/main/java for the C# code.
>
> If that one doesn't work for you, the NPanday project at Codeplex has
> a collection of plugins for building .NET projects, (and a Visual
> Studio Addin as well.)
>
> http://npanday.codeplex.com/

Yeah, I already had a look there. It's not a C#/.NET project, it's a
Java project with some C# code so I'd like to stick with "normal"
Maven.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: C# compiler / plexus-compiler-csharp

Posted by Wendy Smoak <ws...@gmail.com>.
On Sat, Sep 19, 2009 at 4:26 PM, Hilco Wijbenga
<hi...@gmail.com> wrote:

> I've got some Java code and some C# code (the latter currently in
> src/main/csharp but I've also tried src/main/cs). I can't get the C#
> code to compile. Mvn -X seems to indicate that the compiler plugin is
> still looking in src/main/java for the C# code.

If that one doesn't work for you, the NPanday project at Codeplex has
a collection of plugins for building .NET projects, (and a Visual
Studio Addin as well.)

http://npanday.codeplex.com/

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org