Start a new topic
Answered

Command Line dcc.exe

What are the command line option for a basic compile... The Build in Visual Studio does NOT show dcc.exe (Unless there is some verbose switch i can add)


i wanna build a project from command line if can... so i can intergrate with my own build tools.


Best Answer

The DuoCode compiler (dcc.exe) was designed to work exactly as the C# compiler (csc.exe) - you can get a list of all the command line switches by typing: dcc.exe /?


To compile a simple application from the command line, you (currently) need to type:


dcc.exe hello.cs /nostdlib /reference:mscorlib.dll


mscorlib.dll is the one located next do dcc.exe


(note: the need for explicit /nostdlib and /reference switches will be removed in the next release)


Hi, just a quick heads up: we've just release DuoCode 0.6 with full support for Mono! You can run dcc.exe / xbuild on any OS you like :)


More info here: http://blog.duoco.de/2015/05/18/duocode-0.6-with-mono-visual-studio-2015-rc-support/

DUDE.... THANK YOU SOOOO MUCH!!!


You got me to thinking, instead of using MSBuild.exe that is called from a Process.Start...


I just wrote a small builder tool to use from inside my host application (Microsoft.Build.Evaluation)


Which basically uses the build engine from inside the app domain... Which keeps a hold of the compilers

in the AppDomain.


Now my AjaxGateway Build Server is building my projects from my mac using Xamarin Studio 

JUST AS FAST IF IN VISUAL STUDIO


Take a look at this last result which was taking at least 5 seconds for the build only... rebuild even longer.


But now using the build engine from inside the app domain a FULL REBUILD (targets: Clean, Build)

takes .50 seconds


======================

Microsoft Build Engine

======================

Tools - 12.0

Config - Debug

Targets - Clean, Build


Build started 4/26/2015 4:00:39 PM.

__________________________________________________

Project "C:\Projects\AJAX\ASP\AjaxDuo\AjaxGateway.Duo.csproj" (Clean;Build target(s)):


Target CoreClean:

    Deleting file "C:\Projects\AJAX\ASP\AjaxDuo\scripts\AjaxGateway.Duo.dll".

    Deleting file "C:\Projects\AJAX\ASP\AjaxDuo\scripts\AjaxGateway.Duo.js".

    Deleting file "C:\Projects\AJAX\ASP\AjaxDuo\scripts\AjaxGateway.Duo.js.map".

    Deleting file "C:\Projects\AJAX\ASP\AjaxDuo\scripts\mscorlib.js".

Target CompileDuoCode:

             _| _ _ _ _| _  

      o o (_||_|(_) (_(_)(_|(-' 

    

    DuoCode Compiler version 0.5.1223.0 beta (x86)

    Powered by .NET Compiler Platform ("Roslyn") 1.0.0.50128

    Expires on Tuesday, 30 June 2015

    

    

    Generating IL assembly...

    

    Generating JavaScript...

    

    DuoCode compile succeeded in 0.090 sec

    

    4 files written:

      C:\Projects\AJAX\ASP\AjaxDuo\scripts\AjaxGateway.Duo.js (lines: 322, size: 16 KB)

      C:\Projects\AJAX\ASP\AjaxDuo\scripts\AjaxGateway.Duo.js.map

      C:\Projects\AJAX\ASP\AjaxDuo\scripts\AjaxGateway.Duo.dll

      

    

Target _CopyFilesMarkedCopyLocal:

    Copying file from "C:\Projects\AJAX\ASP\AjaxDuo\Packages\DuoCode.0.5.1223.0-beta\build\\..\tools\mscorlib.js" to "scripts\mscorlib.js".


Build succeeded.

    0 Warning(s)

    0 Error(s)


Time Elapsed 00:00:00.50


Task Complete.




THANKS FOR THAT RESPONSE!!!!



Forgot to mention, that new DuoCode v0.5 http://duoco.de/download

supports basic run similar to csc.exe like:

dcc.exe hello.cs

as you requested before.

Enjoy.

It's the same reason that MSBuild on regular C# project takes much longer than building inside VS IDE.

The answer is that VS loads compiler assemblies (dcc.exe in DuoCode project) and keeps them in memory / AppDomain.

When building using MSBuild, the compiler + Roslyn must be loaded every build, that takes time (1-3 seconds, depends on machine).


MSBuild.exe HelloDuoCode1.csproj executed from command line takes SOOO much longer to build

a duo code project then if you were to just hit build in visual studio... WHY?


Are you passing switches or something to optimize the compile when building from Visual Studio as

apposed to building from command line?

Answer

The DuoCode compiler (dcc.exe) was designed to work exactly as the C# compiler (csc.exe) - you can get a list of all the command line switches by typing: dcc.exe /?


To compile a simple application from the command line, you (currently) need to type:


dcc.exe hello.cs /nostdlib /reference:mscorlib.dll


mscorlib.dll is the one located next do dcc.exe


(note: the need for explicit /nostdlib and /reference switches will be removed in the next release)

I see the MSBUILD... i was just trying to play around with the dcc.exe on MacOS  via mono...


I can run the dcc.exe  but i dont know what switches to use to try a small HELLO WORLD compile

from the command line

When you create a new DuoCode from the provided project templates, it will install the DuoCode compiler automatically via a NuGet package, by adding a .targets file reference to the .csproj file. This means that when you build the project, the .targets will automatically invoke the DuoCode compiler (dcc.exe) instead of the "regular" C# compiler.


This means that in order to build your project from the command line, all you have to is build it regularly via MSBuild, no need to call dcc directly.


We'll release an update soon that will allow controlling the DuoCode compilation process with additional options (via project properties in Visual Studio)

Login or Signup to post a comment