[commit] r1995 - in trunk: Install SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties Tests/GPyUnit

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Aug 6 13:15:53 CDT 2012


Author: ksmyth
Date: Mon Aug  6 13:15:46 2012
New Revision: 1995

Log:
Set CSharpDSMLGenerator output path next to .mga file (else cwd). Fixes x64 out-of-proc test

Modified:
   trunk/Install/GME_SDK.wxs
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.cs
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/AssemblyInfo.cs
   trunk/Tests/GPyUnit/test_MetaInterpreter.py

Modified: trunk/Install/GME_SDK.wxs
==============================================================================
--- trunk/Install/GME_SDK.wxs	Fri Aug  3 18:04:20 2012	(r1994)
+++ trunk/Install/GME_SDK.wxs	Mon Aug  6 13:15:46 2012	(r1995)
@@ -185,12 +185,12 @@
         <ProgId Id="MGA.Interpreter.CSharpDSMLGenerator" Description="MGA.Interpreter.CSharpDSMLGenerator" />
       </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\1.0.2.0" Name="Class" Value="CSharpDSMLGenerator.CSharpDSMLGeneratorInterpreter" Type="string" Action="write" />
-      <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32\1.0.2.0" Name="Assembly" Value="CSharpDSMLGenerator, Version=1.0.2.0, Culture=neutral" Type="string" Action="write" />
-      <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32\1.0.2.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
-      <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32\1.0.2.0" Name="CodeBase" Value="file:///[#CSharpDSMLGenerator.dll]" Type="string" Action="write" />
+      <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32\1.0.3.0" Name="Class" Value="CSharpDSMLGenerator.CSharpDSMLGeneratorInterpreter" Type="string" Action="write" />
+      <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32\1.0.3.0" Name="Assembly" Value="CSharpDSMLGenerator, Version=1.0.3.0, Culture=neutral" Type="string" Action="write" />
+      <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32\1.0.3.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
+      <RegistryValue Root="HKCR" Key="CLSID\{78BE7B95-3564-4BA9-8FE6-8D9B91EEE0B8}\InprocServer32\1.0.3.0" Name="CodeBase" Value="file:///[#CSharpDSMLGenerator.dll]" 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.2.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.3.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	Fri Aug  3 18:04:20 2012	(r1994)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/CSharpDSMLGenerator.cs	Mon Aug  6 13:15:46 2012	(r1995)
@@ -242,16 +242,20 @@
                 //language = "javascript";
                 //language = "vj#";
 
-                // TODO: output dir....
+                string outputDir = ".";
+                if (project.ProjectConnStr.StartsWith("MGA="))
+                {
+                    outputDir = Path.GetDirectoryName(project.ProjectConnStr.Substring(4));
+                }
                 List<string> sourceFile = CodeDomGenerateCode(
                     CodeDomProvider.CreateProvider(language),
                     compileunit,
-                    project.Name,
+                    Path.Combine(outputDir, project.Name),
                     mode);
 
                 GMEConsole.Info.WriteLine("API has been generated.");
 
-                string dllFile = Generator.Configuration.ProjectNamespace + ".dll";
+                string dllFile = Path.Combine(outputDir, Generator.Configuration.ProjectNamespace + ".dll");
 
                 // Configure a CompilerParameters that links System.dll
                 // and produces the specified dll file.
@@ -268,7 +272,7 @@
                 // Generate a DLL file.
                 cp.GenerateExecutable = false;
 
-                using (FileStream fs = File.Create("AssemblySignature.snk"))
+                using (FileStream fs = File.Create(Path.Combine(outputDir, "AssemblySignature.snk")))
                 {
                     fs.Write(
                         CSharpDSMLGenerator.Properties.Resources.AssemblySignature,
@@ -276,9 +280,9 @@
                         CSharpDSMLGenerator.Properties.Resources.AssemblySignature.Length);
                 }
 
-                cp.CompilerOptions += " /debug /pdb:" + Generator.Configuration.ProjectNamespace;
-                cp.CompilerOptions += " /doc:" + Generator.Configuration.ProjectNamespace + ".xml";
-                cp.CompilerOptions += " /keyfile:AssemblySignature.snk";
+                cp.CompilerOptions += " /debug /pdb:" + Path.Combine(outputDir, Generator.Configuration.ProjectNamespace);
+                cp.CompilerOptions += " /doc:" + Path.Combine(outputDir, Generator.Configuration.ProjectNamespace) + ".xml";
+                cp.CompilerOptions += " /keyfile:" + Path.Combine(outputDir, "AssemblySignature.snk");
                 //cp.CompilerOptions += " /optimize";
 
                 // Invoke compilation.
@@ -349,6 +353,7 @@
             GeneratorMode mode = GeneratorMode.OneFile)
         {
             GMEConsole.Info.WriteLine("Generating source code.");
+            string outputDir = Path.GetDirectoryName(outputFileName);
 
             List<string> sourceFiles = new List<string>();
 
@@ -405,6 +410,7 @@
                     {
                         sourceFile = ns.Name + "." + provider.FileExtension;
                     }
+                    sourceFile = Path.Combine(outputDir, sourceFile);
 
                     CodeCompileUnit ccu = new CodeCompileUnit();
                     ccu.Namespaces.Add(ns);
@@ -449,6 +455,7 @@
                         {
                             sourceFile = nsNew.Name + "." + ctd.Name + "." + provider.FileExtension;
                         }
+                        sourceFile = Path.Combine(outputDir, sourceFile);
 
                         CodeCompileUnit ccu = new CodeCompileUnit();
                         ccu.Namespaces.Add(nsNew);

Modified: trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/AssemblyInfo.cs
==============================================================================
--- trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/AssemblyInfo.cs	Fri Aug  3 18:04:20 2012	(r1994)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Properties/AssemblyInfo.cs	Mon Aug  6 13:15:46 2012	(r1995)
@@ -32,5 +32,6 @@
 // You can specify all the values or you can default the Build and Revision Numbers 
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.2.0")]
-[assembly: AssemblyFileVersion("1.0.2.0")]
+[assembly: AssemblyVersion("1.0.3.0")]
+[assembly: AssemblyFileVersion("1.0.3.0")]
+// also change GME_SDK.wxs

Modified: trunk/Tests/GPyUnit/test_MetaInterpreter.py
==============================================================================
--- trunk/Tests/GPyUnit/test_MetaInterpreter.py	Fri Aug  3 18:04:20 2012	(r1994)
+++ trunk/Tests/GPyUnit/test_MetaInterpreter.py	Mon Aug  6 13:15:46 2012	(r1995)
@@ -67,22 +67,21 @@
             launcher.RunComponent("Mga.Interpreter.CSharpDSMLGenerator", mga, None, selectedobj, 128)
         finally:
             mga.Close()
-        self.assertTrue(os.path.isfile(os.path.join(self.dsml_outdir, "ISIS.GME.Dsml.MetaGME.dll")))
+        self.assertTrue(os.path.isfile(os.path.join(self.outdir(), "ISIS.GME.Dsml.MetaGME.Classes.cs")))
+        self.assertTrue(os.path.isfile(os.path.join(self.outdir(), "ISIS.GME.Dsml.MetaGME.dll")))
 
             
     def tearDown(self):
         for file in ("MetaGME.xmp", "MetaGME.mta", "MetaGME.xmp.log"):
             if os.path.isfile(os.path.join(self.outdir(), file)):
                 os.unlink(os.path.join(self.outdir(), file))
+        registrar = DispatchEx("Mga.MgaRegistrar")
+        registrar.RegisterParadigmFromData("XML=" + os.path.abspath(os.path.join(os.environ['GME_ROOT'], "Paradigms\\MetaGME\\MetaGME.xmp")), "MetaGME", 1)
         for filename in ("AssemblySignature.snk", "ISIS.GME.Dsml.MetaGME.Classes.cs", "ISIS.GME.Dsml.MetaGME.dll", "ISIS.GME.Dsml.MetaGME.Interfaces.cs", "ISIS.GME.Dsml.MetaGME.xml", "ISIS.GME.Dsml.pdb"):
-            path = os.path.join(self.dsml_outdir, filename)
+            path = os.path.join(self.outdir(), filename)
             if os.path.isfile(path):
                 os.unlink(path)
     setUp = tearDown
-    
-    @property
-    def dsml_outdir(self):
-        return os.getcwd()
 
     @property
     def connstr(self):


More information about the gme-commit mailing list