Beispiel #1
0
        public static DotNetReflection Load(string outputDir, DotNetBuild metadata)
        {
            SetUnmanagedLibraryDirectory(outputDir);

            return(new DotNetReflection(
                       new MemoizingTypeMap(
                           new TypeMap(
                               new TypeAliasNameResolver2(metadata.GeneratedTypeNames),
                               Assembly.LoadFrom(Path.Combine(outputDir, metadata.Assembly)),
                               typeof(string).Assembly,
                               typeof(DotNetReflection).Assembly,
                               typeof(Uno.Application).Assembly
                               )
                           )
                       ));
        }
Beispiel #2
0
        public static string SaveMetadata(BuildResult buildResult)
        {
            var cilBackend   = (CilResult)buildResult.BackendResult;
            var assemblyPath = GetDllPath(buildResult);

            var metadata = new DotNetBuild(
                assembly: Path.GetFileName(assemblyPath),
                entrypointClass: buildResult.Compiler.Data.MainClass.FullName,
                generatedTypeNames:
                cilBackend.AllUnoTypeNames.ToDictionary(
                    keySelector: name => name,
                    elementSelector: cilBackend.GetCilTypeFromUnoName));

            using (var metadataFile = File.OpenWrite(GetMetadataPath(buildResult.OutputDirectory)))
                metadata.WriteTo(metadataFile);

            return(assemblyPath);
        }
Beispiel #3
0
 public static DotNetReflection Load(string outputDir)
 {
     return(Load(outputDir, DotNetBuild.LoadMetadata(outputDir)));
 }