Skip to content

Commit

Permalink
Support for EnableCache. Update to latest contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Laub committed Jun 28, 2010
1 parent bdee291 commit 9b1d5e9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion contrib
Submodule contrib updated 403 files
10 changes: 1 addition & 9 deletions src/DotWeb.Translator/TranslationEngine.cs
Expand Up @@ -47,15 +47,7 @@ public class TranslationEngine
var asmDependencies = new List<AssemblyDefinition>();
context.GenerateMethod(method, true, asmDependencies);
this.generator.WriteEntryPoint(type);

//string[] ret = new string[asmDependencies.Count];
//for (int i = 0; i < ret.Length; i++) {
// var asm = asmDependencies[i];
// var path = asm.MainModule.Image.FileInformation.FullName;
// ret[i] = path;
//}
//return ret;
return asmDependencies.Select(x => x.Name.Name).ToArray();
return asmDependencies.Select(x => this.resolver.GetAbsolutePath(x.Name)).ToArray();
}

/// <summary>
Expand Down
10 changes: 9 additions & 1 deletion src/DotWeb.Utility/Cecil/AssemblyResolver.cs
Expand Up @@ -34,6 +34,8 @@ public abstract class BaseAssemblyResolver : IAssemblyResolver

private ISymbolReaderProvider provider;

protected Dictionary<string, string> asmPaths = new Dictionary<string, string>();

public void AddSearchDirectory(string directory) {
directories.Add(directory);
}
Expand Down Expand Up @@ -90,7 +92,9 @@ public abstract class BaseAssemblyResolver : IAssemblyResolver
SymbolReaderProvider = readSymbols ? this.provider : null
};

return ModuleDefinition.ReadModule(file, readerParameters).Assembly;
var asmDef = ModuleDefinition.ReadModule(file, readerParameters).Assembly;
this.asmPaths.Add(asmDef.Name.Name, file);
return asmDef;
}

public virtual AssemblyDefinition Resolve(AssemblyNameReference name) {
Expand Down Expand Up @@ -298,6 +302,10 @@ public class AssemblyResolver : BaseAssemblyResolver
}
return ret;
}

public string GetAbsolutePath(AssemblyNameReference asmRef) {
return this.asmPaths[asmRef.Name];
}
}

}
1 change: 0 additions & 1 deletion src/DotWeb.Web/ClientCodeRenderer.cs
Expand Up @@ -39,7 +39,6 @@ namespace DotWeb.Web
public class ClientCodeRenderer
{
private const string DotWebMimeType = "application/x-dotweb";
private const string DotWebHostedMode = "DotWeb.HostedMode";
private readonly IHttpContext context;
private readonly bool isDebug;

Expand Down
2 changes: 1 addition & 1 deletion test/DotWeb.Functional.Test/Server/Web.config
Expand Up @@ -10,7 +10,7 @@
<configuration>

<appSettings>
<add key="DotWeb-EnableCache" value="false"/>
<add key="DotWeb-EnableCache" value="true"/>
</appSettings>

<system.web>
Expand Down

0 comments on commit 9b1d5e9

Please sign in to comment.