diff --git a/src/Microsoft.Extensions.DependencyModel/DependencyContext.cs b/src/Microsoft.Extensions.DependencyModel/DependencyContext.cs index b1cb8ccf7..f1caa7346 100644 --- a/src/Microsoft.Extensions.DependencyModel/DependencyContext.cs +++ b/src/Microsoft.Extensions.DependencyModel/DependencyContext.cs @@ -15,13 +15,21 @@ namespace Microsoft.Extensions.DependencyModel private static readonly Lazy _defaultContext = new Lazy(LoadDefault); - public DependencyContext(string target, string runtime, CompilationOptions compilationOptions, CompilationLibrary[] compileLibraries, RuntimeLibrary[] runtimeLibraries) + public DependencyContext(string target, + string runtime, + bool isPortable, + CompilationOptions compilationOptions, + CompilationLibrary[] compileLibraries, + RuntimeLibrary[] runtimeLibraries, + IReadOnlyList> runtimeGraph) { Target = target; Runtime = runtime; + IsPortable = isPortable; CompilationOptions = compilationOptions; CompileLibraries = compileLibraries; RuntimeLibraries = runtimeLibraries; + RuntimeGraph = runtimeGraph; } public static DependencyContext Default => _defaultContext.Value; @@ -30,12 +38,16 @@ namespace Microsoft.Extensions.DependencyModel public string Runtime { get; } + public bool IsPortable { get; } + public CompilationOptions CompilationOptions { get; } public IReadOnlyList CompileLibraries { get; } public IReadOnlyList RuntimeLibraries { get; } + public IReadOnlyList> RuntimeGraph { get; } + private static DependencyContext LoadDefault() { var entryAssembly = Assembly.GetEntryAssembly(); diff --git a/src/Microsoft.Extensions.DependencyModel/RuntimeLibrary.cs b/src/Microsoft.Extensions.DependencyModel/RuntimeLibrary.cs index 39369c6d5..02b3df530 100644 --- a/src/Microsoft.Extensions.DependencyModel/RuntimeLibrary.cs +++ b/src/Microsoft.Extensions.DependencyModel/RuntimeLibrary.cs @@ -8,12 +8,39 @@ namespace Microsoft.Extensions.DependencyModel { public class RuntimeLibrary : Library { - public RuntimeLibrary(string libraryType, string packageName, string version, string hash, string[] assemblies, Dependency[] dependencies, bool serviceable) + public RuntimeLibrary( + string libraryType, + string packageName, + string version, + string hash, + string[] assemblies, + RuntimeTarget[] subTargets, + Dependency[] dependencies, + bool serviceable) : base(libraryType, packageName, version, hash, dependencies, serviceable) { Assemblies = assemblies.Select(path => new RuntimeAssembly(path)).ToArray(); + SubTargets = subTargets; } public IReadOnlyList Assemblies { get; } + + public IReadOnlyList SubTargets { get; } + } + + public class RuntimeTarget + { + public RuntimeTarget(string runtime, IReadOnlyList assemblies, IReadOnlyList nativeLibraries) + { + Runtime = runtime; + Assemblies = assemblies; + NativeLibraries = nativeLibraries; + } + + public string Runtime { get; } + + public IReadOnlyList Assemblies { get; } + + public IReadOnlyList NativeLibraries { get; } } } \ No newline at end of file