ClientBuildManager.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. //
  2. // System.Web.Compilation.ClientBuildManager
  3. //
  4. // Authors:
  5. // Chris Toshok ([email protected])
  6. // Gonzalo Paniagua Javier ([email protected])
  7. //
  8. // (C) 2006 Novell, Inc (http://www.novell.com)
  9. //
  10. //
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. //
  30. #if NET_2_0
  31. using System;
  32. using System.CodeDom;
  33. using System.CodeDom.Compiler;
  34. using System.Collections;
  35. using System.IO;
  36. using System.Web;
  37. using System.Web.Hosting;
  38. namespace System.Web.Compilation {
  39. public sealed class ClientBuildManager : MarshalByRefObject, IDisposable {
  40. string virt_dir;
  41. string phys_src_dir;
  42. string phys_target_dir;
  43. ClientBuildManagerParameter build_params;
  44. public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir)
  45. {
  46. virt_dir = appVirtualDir; // TODO: adjust vpath (it allows 'blah' that turns into '/blah', '////blah', '\\blah'...
  47. phys_src_dir = appPhysicalSourceDir;
  48. }
  49. public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir,
  50. string appPhysicalTargetDir)
  51. : this (appVirtualDir, appPhysicalSourceDir)
  52. {
  53. phys_target_dir = appPhysicalTargetDir;
  54. }
  55. public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir,
  56. string appPhysicalTargetDir, ClientBuildManagerParameter parameter)
  57. : this (appVirtualDir, appPhysicalSourceDir, appPhysicalTargetDir)
  58. {
  59. build_params = parameter;
  60. }
  61. string CreateCodeGenDir ()
  62. {
  63. return null;
  64. /*
  65. string appname = null;
  66. if (virt_dir == "/") {
  67. appname = "root";
  68. } else {
  69. appname = virt_dir.Subtring (1).Replace ('/', '_');
  70. }
  71. string dynamic_dir = null;
  72. string user = Environment.UserName;
  73. for (int i = 0; ; i++){
  74. string d = Path.Combine (Path.GetTempPath (),
  75. String.Format ("{0}-temp-aspnet-{1:x}", user, i));
  76. try {
  77. Directory.CreateDirectory (d);
  78. string stamp = Path.Combine (d, "stamp");
  79. Directory.CreateDirectory (stamp);
  80. dynamic_dir = d;
  81. Directory.Delete (stamp);
  82. break;
  83. } catch (UnauthorizedAccessException){
  84. continue;
  85. }
  86. }
  87. setup.DynamicBase = dynamic_dir;
  88. Directory.CreateDirectory (setup.DynamicBase);
  89. */
  90. }
  91. [MonoTODO]
  92. public void CompileApplicationDependencies ()
  93. {
  94. throw new NotImplementedException ();
  95. }
  96. public void CompileFile (string virtualPath)
  97. {
  98. CompileFile (virtualPath, null);
  99. }
  100. [MonoTODO]
  101. public void CompileFile (string virtualPath, ClientBuildManagerCallback callback)
  102. {
  103. throw new NotImplementedException ();
  104. }
  105. [MonoTODO]
  106. public IRegisteredObject CreateObject (Type type, bool failIfExists)
  107. {
  108. throw new NotImplementedException ();
  109. }
  110. [MonoTODO]
  111. public string GenerateCode (string virtualPath, string virtualFileString, out IDictionary linePragmasTable)
  112. {
  113. throw new NotImplementedException ();
  114. }
  115. [MonoTODO]
  116. public CodeCompileUnit GenerateCodeCompileUnit (string virtualPath, string virtualFileString, out Type codeDomProviderType, out CompilerParameters compilerParameters, out IDictionary linePragmasTable)
  117. {
  118. throw new NotImplementedException ();
  119. }
  120. [MonoTODO]
  121. public CodeCompileUnit GenerateCodeCompileUnit (string virtualPath, out Type codeDomProviderType, out CompilerParameters compilerParameters, out IDictionary linePragmasTable)
  122. {
  123. throw new NotImplementedException ();
  124. }
  125. [MonoTODO]
  126. public string [] GetAppDomainShutdownDirectories ()
  127. {
  128. throw new NotImplementedException ();
  129. }
  130. [MonoTODO]
  131. public IDictionary GetBrowserDefinitions ()
  132. {
  133. throw new NotImplementedException ();
  134. }
  135. [MonoTODO]
  136. public void GetCodeDirectoryInformation (string virtualCodeDir, out Type codeDomProviderType, out CompilerParameters compilerParameters, out string generatedFilesDir)
  137. {
  138. throw new NotImplementedException ();
  139. }
  140. [MonoTODO]
  141. public Type GetCompiledType (string virtualPath)
  142. {
  143. throw new NotImplementedException ();
  144. }
  145. [MonoTODO]
  146. public void GetCompilerParameters (string virtualPath, out Type codeDomProviderType, out CompilerParameters compilerParameters)
  147. {
  148. throw new NotImplementedException ();
  149. }
  150. [MonoTODO]
  151. public string GetGeneratedFileVirtualPath (string filePath)
  152. {
  153. throw new NotImplementedException ();
  154. }
  155. [MonoTODO]
  156. public string GetGeneratedSourceFile (string virtualPath)
  157. {
  158. throw new NotImplementedException ();
  159. }
  160. [MonoTODO]
  161. public string[ ] GetTopLevelAssemblyReferences (string virtualPath)
  162. {
  163. throw new NotImplementedException ();
  164. }
  165. [MonoTODO]
  166. public string[ ] GetVirtualCodeDirectories ()
  167. {
  168. throw new NotImplementedException ();
  169. }
  170. public override object InitializeLifetimeService ()
  171. {
  172. return null;
  173. }
  174. [MonoTODO]
  175. public bool IsCodeAssembly (string assemblyName)
  176. {
  177. throw new NotImplementedException ();
  178. }
  179. [MonoTODO]
  180. public void PrecompileApplication ()
  181. {
  182. throw new NotImplementedException ();
  183. }
  184. [MonoTODO]
  185. public void PrecompileApplication (ClientBuildManagerCallback callback)
  186. {
  187. throw new NotImplementedException ();
  188. }
  189. [MonoTODO]
  190. public void PrecompileApplication (ClientBuildManagerCallback callback, bool forceCleanBuild)
  191. {
  192. throw new NotImplementedException ();
  193. }
  194. [MonoTODO]
  195. public bool Unload ()
  196. {
  197. throw new NotImplementedException ();
  198. }
  199. [MonoTODO]
  200. public string CodeGenDir {
  201. get {
  202. throw new NotImplementedException ();
  203. }
  204. }
  205. [MonoTODO]
  206. public bool IsHostCreated {
  207. get {
  208. throw new NotImplementedException ();
  209. }
  210. }
  211. public event BuildManagerHostUnloadEventHandler AppDomainShutdown;
  212. public event EventHandler AppDomainStarted;
  213. public event BuildManagerHostUnloadEventHandler AppDomainUnloaded;
  214. [MonoTODO]
  215. void IDisposable.Dispose ()
  216. {
  217. throw new NotImplementedException ();
  218. }
  219. }
  220. }
  221. #endif