[Journal - Building Code in WebEdit.NET]

Building Code in WebEdit.NET

Saturday, May 29, 2004

You may have noticed that I have been toying arround with custom .NET build tools for some time (ScriptBuilder.NET, the "Build" and "Clown" programs of my FileTools collection, and some others not published). Well, the newest trend is make WebEdit.NET into a modest IDE. I've dropped the Scripting IDE, at least GUI-wise, some time ago: its functionality is either available directly through the editor (for short-term solutions, see the "Execute Code" context menu item, which allows for statement execution, as well as temporary macros and modules), or has been taken over by AddIns (long term solutions and persistent macros).

Update (January 9, 2005): WebEdit.NET no longer uses the Gregor.Scripting component, which is based on the now deprecated VSA API. Temporary macros and ad-hoc scripting are still supported, however, with the help of the CodeDom.Compiler mechanism and using temporary AddIns (called "Script AddIns", see the "Build" menu).

In addition to building code for internal purposes, WebEdit.NET now supports building the current file, all open files as a group, or the current project. Build commands can be configured on a per-language basis (in the language configuration file), where the user enters the actual command line (this makes use of parameter substitution, as examplified below):

<!-- WebEditLanguages.xml, should quote command line args -->
<languages>
  <language type="Gregor.Core.CLanguageInfo" name="C#">
    <extension name=".cs" default="1" />
    <keyword name="Banjara" rangekind="User1" />
    <syntaxprovider type="Gregor.Core.CCSharpSyntaxProvider" />
    <syntaxparser type="Gregor.Editing.Coloring.CCsSyntaxParser" />
    <autoconverter type="Gregor.Editing.AutoConversion.CCurlyAutoConverter" />
    <codeassistant type="Gregor.Editing.EditAssistance.CCSharpCodeAssistant" />
    <codedomprovider type="Microsoft.CSharp.CSharpCodeProvider" />
    <autocompletefile relpath="Tokens\CSharpAutoComplete.txt" />
    <autocompletelist name="Document" />
    <aliasfile relpath="Tokens\CSharpAliases" />
    <buildcommand mode="Clown" command="Clown.exe" />
    <buildcommand mode=".NET Module" command="csc.exe &quot;/t:module&quot;" />
    <buildcommand mode="Class Library" command="csc.exe &quot;/t:library&quot;" />
    <buildcommand mode="Windows EXE" command="csc.exe &quot;/t:winexe&quot;" />
    <buildcommand mode="Console EXE" command="csc.exe" />
    <buildcommand mode="AddInConnector" 
                  command="csc.exe &quot;/t:library&quot;
                                   &quot;/r:Gregor.Core.dll,Gregor.AppCore.dll&quot;
                                   &quot;/lib:$Vars.ExeFolderPath%&quot;" />
  </language>
</languages>