+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
+++ /dev/null
-//
-// 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; }
- }
- }
-}
-
// (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
{
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];
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));
}
+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:
+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
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 ());
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);
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