Esempio n. 1
0
        public bool FirstOccuranceOfAssembly(MessageContext ctxt, CST.AssemblyName name, Trace trace)
        {
            var prev = default(Trace);

            if (AssemblyToTrace.TryGetValue(name, out prev))
            {
                Env.Log(new DuplicateTraceEntryMessage(ctxt, prev.Name, trace.Name));
                return(false);
            }
            else
            {
                AssemblyToTrace.Add(name, trace);
                return(true);
            }
        }
Esempio n. 2
0
        // ----------------------------------------------------------------------
        // Last compilation times
        // ----------------------------------------------------------------------

        // TODO: Will return null if assembly def was compiled into a trace file...
        public static DateTime?LastCompilationTime(CompilerEnvironment env, CST.AssemblyName assemblyName, out string fn)
        {
            var assmName  = CST.CSTWriter.WithAppend(env.Global, CST.WriterStyle.Uniform, assemblyName.Append);
            var finalName = default(string);

            switch (env.CompilationMode)
            {
            case CompilationMode.Plain:
            case CompilationMode.Collecting:
                finalName = Constants.AllFileName;
                break;

            case CompilationMode.Traced:
                finalName = Constants.AssemblyFileName;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            fn = Path.Combine(Path.Combine(env.OutputDirectory, JST.Lexemes.StringToFileName(assmName)), finalName);
            return(File.Exists(fn) ? (DateTime?)File.GetLastWriteTimeUtc(fn) : null);
        }
Esempio n. 3
0
 public JST.Expression ResolveAssembly(CST.AssemblyName assemblyName)
 {
     return(Env.JSTHelpers.DefaultResolveAssembly(this, assemblyName));
 }
Esempio n. 4
0
 public string ResolveAssemblyReferenceToSlot(CST.AssemblyDef assemblyDef, CST.AssemblyName assemblyName)
 {
     return(AssemblyMappingFor(assemblyDef).ResolveAssemblyReferenceToSlot(assemblyName));
 }
Esempio n. 5
0
 public string ResolveAssemblyReferenceToSlot(CST.AssemblyName assemblyName)
 {
     return(referencedAssemblies.For(ctxt, assemblyName));
 }
Esempio n. 6
0
 private static void FriendlyAssemblyName(StringBuilder sb, CST.AssemblyName name)
 {
     JST.Lexemes.AppendStringToFriendlyIdentifier(sb, name.Name, 15);
 }