2 // System.Web.Compilation.ClientBuildManager
5 // Chris Toshok (toshok@ximian.com)
6 // Gonzalo Paniagua Javier (gonzalo@ximian.com)
8 // (C) 2006 Novell, Inc (http://www.novell.com)
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 using System.CodeDom.Compiler;
37 using System.Collections;
40 using System.Web.Hosting;
42 namespace System.Web.Compilation {
43 public sealed class ClientBuildManager : MarshalByRefObject, IDisposable {
46 string phys_target_dir;
47 ClientBuildManagerParameter build_params;
49 public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir)
51 virt_dir = appVirtualDir; // TODO: adjust vpath (it allows 'blah' that turns into '/blah', '////blah', '\\blah'...
52 phys_src_dir = appPhysicalSourceDir;
55 public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir,
56 string appPhysicalTargetDir)
57 : this (appVirtualDir, appPhysicalSourceDir)
59 phys_target_dir = appPhysicalTargetDir;
62 public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir,
63 string appPhysicalTargetDir, ClientBuildManagerParameter parameter)
64 : this (appVirtualDir, appPhysicalSourceDir, appPhysicalTargetDir)
66 build_params = parameter;
69 string CreateCodeGenDir ()
73 string appname = null;
74 if (virt_dir == "/") {
77 appname = virt_dir.Subtring (1).Replace ('/', '_');
80 string dynamic_dir = null;
81 string user = Environment.UserName;
82 for (int i = 0; ; i++){
83 string d = Path.Combine (Path.GetTempPath (),
84 String.Format ("{0}-temp-aspnet-{1:x}", user, i));
87 Directory.CreateDirectory (d);
88 string stamp = Path.Combine (d, "stamp");
89 Directory.CreateDirectory (stamp);
91 Directory.Delete (stamp);
93 } catch (UnauthorizedAccessException){
97 setup.DynamicBase = dynamic_dir;
98 Directory.CreateDirectory (setup.DynamicBase);
103 public void CompileApplicationDependencies ()
105 throw new NotImplementedException ();
108 public void CompileFile (string virtualPath)
110 CompileFile (virtualPath, null);
114 public void CompileFile (string virtualPath, ClientBuildManagerCallback callback)
116 throw new NotImplementedException ();
120 public IRegisteredObject CreateObject (Type type, bool failIfExists)
122 throw new NotImplementedException ();
126 public string GenerateCode (string virtualPath, string virtualFileString, out IDictionary linePragmasTable)
128 throw new NotImplementedException ();
132 public CodeCompileUnit GenerateCodeCompileUnit (string virtualPath, string virtualFileString, out Type codeDomProviderType, out CompilerParameters compilerParameters, out IDictionary linePragmasTable)
134 throw new NotImplementedException ();
138 public CodeCompileUnit GenerateCodeCompileUnit (string virtualPath, out Type codeDomProviderType, out CompilerParameters compilerParameters, out IDictionary linePragmasTable)
140 throw new NotImplementedException ();
144 public string [] GetAppDomainShutdownDirectories ()
146 throw new NotImplementedException ();
150 public IDictionary GetBrowserDefinitions ()
152 throw new NotImplementedException ();
156 public void GetCodeDirectoryInformation (string virtualCodeDir, out Type codeDomProviderType, out CompilerParameters compilerParameters, out string generatedFilesDir)
158 throw new NotImplementedException ();
162 public Type GetCompiledType (string virtualPath)
164 throw new NotImplementedException ();
168 public void GetCompilerParameters (string virtualPath, out Type codeDomProviderType, out CompilerParameters compilerParameters)
170 throw new NotImplementedException ();
174 public string GetGeneratedFileVirtualPath (string filePath)
176 throw new NotImplementedException ();
180 public string GetGeneratedSourceFile (string virtualPath)
182 throw new NotImplementedException ();
186 public string[ ] GetTopLevelAssemblyReferences (string virtualPath)
188 throw new NotImplementedException ();
192 public string[ ] GetVirtualCodeDirectories ()
194 throw new NotImplementedException ();
197 public override object InitializeLifetimeService ()
203 public bool IsCodeAssembly (string assemblyName)
205 throw new NotImplementedException ();
209 public void PrecompileApplication ()
211 throw new NotImplementedException ();
215 public void PrecompileApplication (ClientBuildManagerCallback callback)
217 throw new NotImplementedException ();
221 public void PrecompileApplication (ClientBuildManagerCallback callback, bool forceCleanBuild)
223 throw new NotImplementedException ();
227 public bool Unload ()
229 throw new NotImplementedException ();
233 public string CodeGenDir {
235 throw new NotImplementedException ();
240 public bool IsHostCreated {
242 throw new NotImplementedException ();
246 public event BuildManagerHostUnloadEventHandler AppDomainShutdown;
247 public event EventHandler AppDomainStarted;
248 public event BuildManagerHostUnloadEventHandler AppDomainUnloaded;
252 void IDisposable.Dispose ()
254 throw new NotImplementedException ();