[commit] r2183 - in trunk: Install SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Wed Apr 24 13:53:33 CDT 2013


Author: ksmyth
Date: Wed Apr 24 13:53:33 2013
New Revision: 2183

Log:
Define MSBuild task GenerateCSharpDSML

Modified:
   trunk/Install/GME_SDK.wxs
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.cs
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.csproj
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/AssemblyInfo.cs
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/Resources.Designer.cs
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/app.manifest

Modified: trunk/Install/GME_SDK.wxs
==============================================================================
--- trunk/Install/GME_SDK.wxs	Wed Apr 24 13:52:43 2013	(r2182)
+++ trunk/Install/GME_SDK.wxs	Wed Apr 24 13:53:33 2013	(r2183)
@@ -187,7 +187,7 @@
       </Class>
       <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
       <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32" Name="Class" Value="CSharpDSMLGenerator.CSharpDSMLGeneratorInterpreter" Type="string" Action="write" />
-      <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32" Name="Assembly" Value="CSharpDSMLGenerator, Version=1.0.7.0, Culture=neutral" Type="string" Action="write" />
+      <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32" Name="Assembly" Value="CSharpDSMLGenerator, Version=1.0.8.0, Culture=neutral" Type="string" Action="write" />
       <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
       <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32" Name="CodeBase" Value="file:///[#CSharpDSMLGenerator.dll]" Type="string" Action="write" />
       <RegistryValue Root="HKCR" Key="Component Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Name="0" Value=".NET Category" Type="string" Action="write" />

Modified: trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.cs
==============================================================================
--- trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.cs	Wed Apr 24 13:52:43 2013	(r2182)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.cs	Wed Apr 24 13:53:33 2013	(r2183)
@@ -128,13 +128,42 @@
                 metaInterpreter.InvokeEx(project, null, null, (int)ComponentStartMode.GME_SILENT_MODE);
                 MgaGateway.BeginTransaction();
             }
+
+            string outputDir = ".";
+            if (project.ProjectConnStr.StartsWith("MGA="))
+            {
+                outputDir = Path.GetDirectoryName(project.ProjectConnStr.Substring(4));
+            }
+            GeneratorMode mode;
+            if (startMode != ComponentStartMode.GME_SILENT_MODE)
+            {
+                ApiGenerator apiForm = new ApiGenerator();
+                apiForm.txtOutputDir.Text =
+                    Path.GetDirectoryName(project.ProjectConnStr.Substring("MGA=".Length));
+
+                DialogResult dr = apiForm.ShowDialog();
+                if (dr != DialogResult.OK)
+                {
+                    return;
+                }
+
+                mode = ((ApiGenerator.ModeItem)apiForm.cbMode.SelectedItem).Mode;
+            }
+            else
+            {
+                mode = GeneratorMode.Namespaces;
+            }
+            GenerateDotNetCode(project, paradigmXmpFile, outputDir, mode);
+        }
+
+        public bool GenerateDotNetCode(MgaProject project, string paradigmXmpFile, string outputDir, GeneratorMode mode)
+        {
             //paradigm = MgaMeta.DsmlModel.GetParadigm(paradigmXmpFile);
             Generator.Configuration.DsmlModel = new MgaMeta.DsmlModel(paradigmXmpFile);
             // Important step
             //Generator.Configuration.LocalFactory.Clear();
             Generator.Configuration.DsmlName = project.RootFolder.Name;
             List<MgaObject> all = new List<MgaObject>();
-            CodeCompileUnit compileunit = new CodeCompileUnit();
 
             // TODO: add version
             //var fileVersion = new CodeAttributeDeclaration() {
@@ -180,6 +209,7 @@
 
             GMEConsole.Info.WriteLine("Processing graph...");
 
+            CodeCompileUnit compileunit = new CodeCompileUnit();
             foreach (var obj in all.Where(condition))
             {
                 if (obj.MetaBase.Name == "RootFolder" &&
@@ -227,41 +257,9 @@
                 }
             }
 
-            GeneratorMode mode;
-            if (startMode != ComponentStartMode.GME_SILENT_MODE)
-            {
-                ApiGenerator apiForm = new ApiGenerator();
-                apiForm.txtOutputDir.Text =
-                    Path.GetDirectoryName(project.ProjectConnStr.Substring("MGA=".Length));
-
-                DialogResult dr = apiForm.ShowDialog();
-                if (dr != DialogResult.OK)
-                {
-                    return;
-                }
-
-                mode = ((ApiGenerator.ModeItem)apiForm.cbMode.SelectedItem).Mode;
-            }
-            else
-            {
-                mode = GeneratorMode.Namespaces;
-            }
             {
                 // TODO: a lot of parameters must be set based on the user's choice.
-
-                string language = "";
-                language = "c#";
-                // TBD: do not use these options!
-                //language = "c++";
-                //language = "vb";
-                //language = "javascript";
-                //language = "vj#";
-
-                string outputDir = ".";
-                if (project.ProjectConnStr.StartsWith("MGA="))
-                {
-                    outputDir = Path.GetDirectoryName(project.ProjectConnStr.Substring(4));
-                }
+                string language = "c#";
                 List<string> sourceFile = CodeDomGenerateCode(
                     CodeDomProvider.CreateProvider(language),
                     compileunit,
@@ -318,7 +316,8 @@
                 errors.Sort((x, y) => y.IsWarning.CompareTo(x.IsWarning));
 
                 errors.
-                    ForEach(x => {
+                    ForEach(x =>
+                    {
                         var msg = string.Format("{0} ({1}) {2} ", x.FileName, x.Line, x.ErrorText);
 
                         if (x.IsWarning)
@@ -336,7 +335,9 @@
                     GMEConsole.Info.WriteLine(
                         "{0} was generated and is ready to use.",
                         Path.GetFullPath(cr.PathToAssembly));
+                    return true;
                 }
+                return false;
             }
         }
 
@@ -611,8 +612,8 @@
 
         #region IMgaComponentEx Members
 
-        MgaGateway MgaGateway { get; set; }
-        GMEConsole GMEConsole { get; set; }
+        internal MgaGateway MgaGateway { get; set; }
+        internal GMEConsole GMEConsole { get; set; }
 
         public void InvokeEx(MgaProject project, MgaFCO currentobj, MgaFCOs selectedobjs, int param)
         {

Modified: trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.csproj
==============================================================================
--- trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.csproj	Wed Apr 24 13:52:43 2013	(r2182)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.csproj	Wed Apr 24 13:53:33 2013	(r2183)
@@ -13,7 +13,8 @@
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <CodeContractsAssemblyMode>0</CodeContractsAssemblyMode>
-    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -73,6 +74,7 @@
     </ApplicationIcon>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Microsoft.Build.Framework" />
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Drawing" />
@@ -82,11 +84,11 @@
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
-    <Reference Include="GME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
-    <Reference Include="GME.Util, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
-    <Reference Include="GME.MGA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
-    <Reference Include="GME.MGA.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
-    <Reference Include="GME.MGA.Meta, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
+    <Reference Include="GME, Version=1.0.1.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
+    <Reference Include="GME.Util, Version=1.0.1.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
+    <Reference Include="GME.MGA, Version=1.0.1.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
+    <Reference Include="GME.MGA.Core, Version=1.0.1.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
+    <Reference Include="GME.MGA.Meta, Version=1.0.1.0, Culture=neutral, PublicKeyToken=f240a760fe751c2e, processorArchitecture=MSIL" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="ApiGenerator.cs">
@@ -97,6 +99,7 @@
     </Compile>
     <Compile Include="ComponentConfig.cs" />
     <Compile Include="CSharpDSMLGenerator.cs" />
+    <Compile Include="CSharpDSMLTask.cs" />
     <Compile Include="Generator\Base.cs" />
     <Compile Include="Generator\Configuration.cs" />
     <Compile Include="Generator\FCO.cs" />

Modified: trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/AssemblyInfo.cs
==============================================================================
--- trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/AssemblyInfo.cs	Wed Apr 24 13:52:43 2013	(r2182)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/AssemblyInfo.cs	Wed Apr 24 13:53:33 2013	(r2183)
@@ -33,6 +33,6 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
 // Keep in sync with app.manifest and GME_SDK.wxs
-[assembly: AssemblyVersion("1.0.7.0")]
-[assembly: AssemblyFileVersion("1.0.7.0")]
+[assembly: AssemblyVersion("1.0.8.0")]
+[assembly: AssemblyFileVersion("1.0.8.0")]
 // also change GME_SDK.wxs

Modified: trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/Resources.Designer.cs
==============================================================================
--- trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/Resources.Designer.cs	Wed Apr 24 13:52:43 2013	(r2182)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/Resources.Designer.cs	Wed Apr 24 13:53:33 2013	(r2183)
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.237
+//     Runtime Version:4.0.30319.296
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.

Modified: trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/app.manifest
==============================================================================
--- trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/app.manifest	Wed Apr 24 13:52:43 2013	(r2182)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/app.manifest	Wed Apr 24 13:53:33 2013	(r2183)
@@ -3,7 +3,7 @@
   <assemblyIdentity
                type="win32"
                name="CSharpDSMLGenerator"
-               version="1.0.7.0"
+               version="1.0.8.0"
                publicKeyToken="1321e6b92842fe54"
                processorArchitecture="msil" />
   <clrClass


More information about the gme-commit mailing list