In .:
[mono.git] / mcs / class / System.Web / System.Web.Compilation / ClientBuildManager.cs
1 //
2 // System.Web.Compilation.ClientBuildManager
3 //
4 // Authors:
5 //      Chris Toshok (toshok@ximian.com)
6 //      Gonzalo Paniagua Javier (gonzalo@ximian.com)
7 //
8 // (C) 2006 Novell, Inc (http://www.novell.com)
9 //
10
11 //
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:
19 // 
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
22 // 
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.
30 //
31
32 #if NET_2_0
33
34 using System;
35 using System.CodeDom;
36 using System.CodeDom.Compiler;
37 using System.Collections;
38 using System.IO;
39 using System.Web;
40 using System.Web.Hosting;
41
42 namespace System.Web.Compilation {
43         public sealed class ClientBuildManager : MarshalByRefObject, IDisposable {
44                 string virt_dir;
45                 string phys_src_dir;
46                 string phys_target_dir;
47                 ClientBuildManagerParameter build_params;
48
49                 public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir)
50                 {
51                         virt_dir = appVirtualDir; // TODO: adjust vpath (it allows 'blah' that turns into '/blah', '////blah', '\\blah'...
52                         phys_src_dir = appPhysicalSourceDir;
53                 }
54
55                 public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir,
56                                         string appPhysicalTargetDir)
57                         : this (appVirtualDir, appPhysicalSourceDir)
58                 {
59                         phys_target_dir = appPhysicalTargetDir;
60                 }
61
62                 public ClientBuildManager (string appVirtualDir, string appPhysicalSourceDir,
63                                         string appPhysicalTargetDir, ClientBuildManagerParameter parameter)
64                         : this (appVirtualDir, appPhysicalSourceDir, appPhysicalTargetDir)
65                 {
66                         build_params = parameter;
67                 }
68
69                 string CreateCodeGenDir ()
70                 {
71                         return null;
72                 /*
73                         string appname = null;
74                         if (virt_dir == "/") {
75                                 appname = "root";
76                         } else {
77                                 appname = virt_dir.Subtring (1).Replace ('/', '_');
78                         }
79
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));
85                         
86                                 try {
87                                         Directory.CreateDirectory (d);
88                                         string stamp = Path.Combine (d, "stamp");
89                                         Directory.CreateDirectory (stamp);
90                                         dynamic_dir = d;
91                                         Directory.Delete (stamp);
92                                         break;
93                                 } catch (UnauthorizedAccessException){
94                                         continue;
95                                 }
96                         }
97                         setup.DynamicBase = dynamic_dir;
98                         Directory.CreateDirectory (setup.DynamicBase);
99                         */
100                 }
101
102                 [MonoTODO]
103                 public void CompileApplicationDependencies ()
104                 {
105                         throw new NotImplementedException ();
106                 }
107
108                 public void CompileFile (string virtualPath)
109                 {
110                         CompileFile (virtualPath, null);
111                 }
112
113                 [MonoTODO]
114                 public void CompileFile (string virtualPath, ClientBuildManagerCallback callback)
115                 {
116                         throw new NotImplementedException ();
117                 }
118
119                 [MonoTODO]
120                 public IRegisteredObject CreateObject (Type type, bool failIfExists)
121                 {
122                         throw new NotImplementedException ();
123                 }
124
125                 [MonoTODO]
126                 public string GenerateCode (string virtualPath, string virtualFileString, out IDictionary linePragmasTable)
127                 {
128                         throw new NotImplementedException ();
129                 }
130
131                 [MonoTODO]
132                 public CodeCompileUnit GenerateCodeCompileUnit (string virtualPath, string virtualFileString, out Type codeDomProviderType, out CompilerParameters compilerParameters, out IDictionary linePragmasTable)
133                 {
134                         throw new NotImplementedException ();
135                 }
136
137                 [MonoTODO]
138                 public CodeCompileUnit GenerateCodeCompileUnit (string virtualPath, out Type codeDomProviderType, out CompilerParameters compilerParameters, out IDictionary linePragmasTable)
139                 {
140                         throw new NotImplementedException ();
141                 }
142
143                 [MonoTODO]
144                 public string [] GetAppDomainShutdownDirectories ()
145                 {
146                         throw new NotImplementedException ();
147                 }
148
149                 [MonoTODO]
150                 public IDictionary GetBrowserDefinitions ()
151                 {
152                         throw new NotImplementedException ();
153                 }
154
155                 [MonoTODO]
156                 public void GetCodeDirectoryInformation (string virtualCodeDir, out Type codeDomProviderType, out CompilerParameters compilerParameters, out string generatedFilesDir)
157                 {
158                         throw new NotImplementedException ();
159                 }
160
161                 [MonoTODO]
162                 public Type GetCompiledType (string virtualPath)
163                 {
164                         throw new NotImplementedException ();
165                 }
166
167                 [MonoTODO]
168                 public void GetCompilerParameters (string virtualPath, out Type codeDomProviderType, out CompilerParameters compilerParameters)
169                 {
170                         throw new NotImplementedException ();
171                 }
172
173                 [MonoTODO]
174                 public string GetGeneratedFileVirtualPath (string filePath)
175                 {
176                         throw new NotImplementedException ();
177                 }
178
179                 [MonoTODO]
180                 public string GetGeneratedSourceFile (string virtualPath)
181                 {
182                         throw new NotImplementedException ();
183                 }
184
185                 [MonoTODO]
186                 public string[ ] GetTopLevelAssemblyReferences (string virtualPath)
187                 {
188                         throw new NotImplementedException ();
189                 }
190
191                 [MonoTODO]
192                 public string[ ] GetVirtualCodeDirectories ()
193                 {
194                         throw new NotImplementedException ();
195                 }
196
197                 public override object InitializeLifetimeService ()
198                 {
199                         return null;
200                 }
201
202                 [MonoTODO]
203                 public bool IsCodeAssembly (string assemblyName)
204                 {
205                         throw new NotImplementedException ();
206                 }
207
208                 [MonoTODO]
209                 public void PrecompileApplication ()
210                 {
211                         throw new NotImplementedException ();
212                 }
213
214                 [MonoTODO]
215                 public void PrecompileApplication (ClientBuildManagerCallback callback)
216                 {
217                         throw new NotImplementedException ();
218                 }
219
220                 [MonoTODO]
221                 public void PrecompileApplication (ClientBuildManagerCallback callback, bool forceCleanBuild)
222                 {
223                         throw new NotImplementedException ();
224                 }
225
226                 [MonoTODO]
227                 public bool Unload ()
228                 {
229                         throw new NotImplementedException ();
230                 }
231
232                 [MonoTODO]
233                 public string CodeGenDir {
234                         get {
235                                 throw new NotImplementedException ();
236                         }
237                 }
238
239                 [MonoTODO]
240                 public bool IsHostCreated {
241                         get {
242                                 throw new NotImplementedException ();
243                         }
244                 }
245
246                 public event BuildManagerHostUnloadEventHandler AppDomainShutdown;
247                 public event EventHandler AppDomainStarted;
248                 public event BuildManagerHostUnloadEventHandler AppDomainUnloaded;
249
250
251                 [MonoTODO]
252                 void IDisposable.Dispose ()
253                 {
254                         throw new NotImplementedException ();
255                 }
256
257         }
258
259 }
260
261 #endif