2004-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Tue, 8 Jun 2004 06:20:11 +0000 (06:20 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Tue, 8 Jun 2004 06:20:11 +0000 (06:20 -0000)
* System.Web.dll.sources: removed CSCompiler.cs

* System.Web.Compilation/CSCompiler.cs: removed.

* System.Web.Compilation/CachingCompiler.cs: language independent
compilation for single files.

* System.Web.UI/SimpleWebHandlerParser.cs:
* System.Web.UI/TemplateParser.cs: pass the language when compiling from
a file.

svn path=/trunk/mcs/; revision=29017

mcs/class/System.Web/ChangeLog
mcs/class/System.Web/System.Web.Compilation/CSCompiler.cs [deleted file]
mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs
mcs/class/System.Web/System.Web.Compilation/ChangeLog
mcs/class/System.Web/System.Web.UI/ChangeLog
mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs
mcs/class/System.Web/System.Web.UI/TemplateParser.cs
mcs/class/System.Web/System.Web.dll.sources

index 502b723dfb3690443a71a4e097ea77be66de12df..bec52a25991ed831d36eb5f8e71fe491138f3780 100644 (file)
@@ -1,3 +1,7 @@
+2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * System.Web.dll.sources: removed CSCompiler.cs
+
 2004-06-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * System.Web.dll.sources: removing ServerVariablesCollection. It does
diff --git a/mcs/class/System.Web/System.Web.Compilation/CSCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/CSCompiler.cs
deleted file mode 100644 (file)
index 69969f3..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.Web.Compilation.CSCompiler
-//
-// Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2003 Ximian, Inc (http://www.ximian.com)
-//
-using System;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Collections.Specialized;
-using System.IO;
-using System.Text;
-using System.Reflection;
-using Microsoft.CSharp;
-
-namespace System.Web.Compilation
-{
-       class CSCompiler
-       {
-               static CodeDomProvider provider;
-               static ICodeCompiler compiler;
-               string filename;
-               ArrayList assemblies;
-               CompilerParameters options;
-
-               static CSCompiler ()
-               {
-                       provider = new CSharpCodeProvider ();
-                       compiler = provider.CreateCompiler ();
-               }
-
-               private CSCompiler (string filename, ArrayList assemblies)
-               {
-                       this.filename = filename;
-                       this.assemblies = assemblies;
-                       options = new CompilerParameters ();
-                       if (assemblies != null) {
-                               StringCollection coll = options.ReferencedAssemblies;
-                               foreach (string str in assemblies)
-                                       coll.Add (str);
-                       }
-               }
-
-               public Assembly GetCompiledAssembly ()
-               {
-                       CompilerResults results = compiler.CompileAssemblyFromFile (options, filename);
-                       if (results.NativeCompilerReturnValue != 0) {
-                               StreamReader reader = new StreamReader (filename);
-                               throw new CompilationException (filename, results.Errors, reader.ReadToEnd ());
-                       }
-
-                       return results.CompiledAssembly;
-               }
-
-               static public Assembly CompileCSFile (string file, ArrayList assemblies)
-               {
-                       CSCompiler compiler = new CSCompiler (file, assemblies);
-                       return compiler.GetCompiledAssembly ();
-               }
-
-               static public CodeDomProvider Provider {
-                       get { return provider; }
-               }
-
-               static public ICodeCompiler Compiler {
-                       get { return compiler; }
-               }
-       }
-}
-
index 1075ca01f2dee3defa944748c1eab1ebe788d6bc..82324ea195fd405b812d3c53d2b9de19d0a01bdf 100644 (file)
@@ -8,13 +8,12 @@
 // (c) Copyright Novell, Inc. (http://www.novell.com)
 //
 using System;
-using System.CodeDom;
 using System.CodeDom.Compiler;
 using System.Collections;
 using System.Collections.Specialized;
-using System.IO;
 using System.Web.UI;
 using System.Web.Caching;
+using System.Web.Configuration;
 
 namespace System.Web.Compilation
 {
@@ -79,7 +78,8 @@ namespace System.Web.Compilation
                        return options;
                }
 
-               public static CompilerResults Compile (string key, string file, ArrayList assemblies)
+               public static CompilerResults Compile (string language, string key, string file,
+                                                       ArrayList assemblies)
                {
                        Cache cache = HttpRuntime.Cache;
                        CompilerResults results = (CompilerResults) cache [key];
@@ -90,9 +90,17 @@ namespace System.Web.Compilation
                                results = (CompilerResults) cache [key];
                                if (results != null)
                                        return results;
-
+                               CompilationConfiguration config;
+                               config = CompilationConfiguration.GetInstance (HttpContext.Current);
+                               CodeDomProvider provider = config.GetProvider (language);
+                               if (provider == null)
+                                       throw new HttpException ("Configuration error. Language not supported: " +
+                                                                 language, 500);
+
+                               ICodeCompiler compiler = provider.CreateCompiler ();
                                CompilerParameters options = GetOptions (assemblies);
-                               results = CSCompiler.Compiler.CompileAssemblyFromFile (options, file);
+                               results = compiler.CompileAssemblyFromFile (options, file);
                                string [] deps = (string []) assemblies.ToArray (typeof (string));
                                cache.Insert (key, results, new CacheDependency (deps));
                        }
index dc7461b6d13e6704ffe8d9de21d5bfdeb0e3d45b..0e24a038163e54d8aa33fa3d6c28b48d0c7a7362 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * CSCompiler.cs: removed.
+
+       * CachingCompiler.cs: language independent compilation for single files.
+
 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * BaseCompiler.cs:
index 7249a52f6c7e4edff9fc1997a9ef3c9f557a5125..f3f919e09112c14f2aae37f30aebd33d3d5f1b91 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * SimpleWebHandlerParser.cs:
+       * TemplateParser.cs: pass the language when compiling from a file.
+
 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * SimpleWebHandlerParser.cs: if we have a global.asax, move its
index 1b44dc87b0c595da3da6fe01e2814cc1f62f3517..c0c42d7992497b8d6d3df17b08e55b9dfc27813c 100644 (file)
@@ -287,7 +287,7 @@ namespace System.Web.UI
 
                        AddDependency (realPath);
 
-                       CompilerResults result = CachingCompiler.Compile (realPath, realPath, assemblies);
+                       CompilerResults result = CachingCompiler.Compile (language, realPath, realPath, assemblies);
                        if (result.NativeCompilerReturnValue != 0) {
                                StreamReader reader = new StreamReader (realPath);
                                throw new CompilationException (realPath, result.Errors, reader.ReadToEnd ());
index c2530d9e8b016c1548a8c1da8e1e9a26c3f98cc3..19a59c2283be85b09b06813eb7f505bf17eff8a3 100755 (executable)
@@ -412,7 +412,7 @@ namespace System.Web.UI
 
                        AddDependency (realPath);
 
-                       CompilerResults result = CachingCompiler.Compile (realPath, realPath, assemblies);
+                       CompilerResults result = CachingCompiler.Compile (language, realPath, realPath, assemblies);
                        if (result.NativeCompilerReturnValue != 0) {
                                StringWriter writer = new StringWriter();
                                StreamReader reader = new StreamReader (realPath);
index c15744d40a2d1220f854e474825e0ab1f606e5cd..0ddda892c62b827b566bbeeca9034b1ec280e12c 100755 (executable)
@@ -81,7 +81,6 @@ System.Web.Compilation/AspParser.cs
 System.Web.Compilation/AspGenerator.cs
 System.Web.Compilation/WebServiceCompiler.cs
 System.Web.Compilation/CachingCompiler.cs
-System.Web.Compilation/CSCompiler.cs
 System.Web.Compilation/Directive.cs
 System.Web.Compilation/GlobalAsaxCompiler.cs
 System.Web.Compilation/PageCompiler.cs