public NuGetAssetResolver(string runtimeFile, IEnumerable<string> packageItems) { RuntimeGraph runtimeGraph = null; if (!String.IsNullOrEmpty(runtimeFile)) { runtimeGraph = JsonRuntimeFormat.ReadRuntimeGraph(runtimeFile); } _conventions = new ManagedCodeConventions(runtimeGraph); _sourceItems = new ContentItemCollection(); _sourceItems.Load(packageItems); }
private RestoreTargetGraph(bool inConflict, NuGetFramework framework, string runtimeIdentifier, RuntimeGraph runtimeGraph, GraphNode<RemoteResolveResult> graph, ISet<RemoteMatch> install, ISet<GraphItem<RemoteResolveResult>> flattened, ISet<LibraryRange> unresolved) { InConflict = inConflict; RuntimeIdentifier = runtimeIdentifier; RuntimeGraph = runtimeGraph; Framework = framework; Graph = graph; Conventions = new ManagedCodeConventions(runtimeGraph); Install = install; Flattened = flattened; Unresolved = unresolved; }
internal ManagedCodePatterns(ManagedCodeConventions conventions) { RuntimeAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { "runtimes/{rid}/lib/{tfm}/{any?}", "lib/{tfm}/{any?}", new PatternDefinition("lib/{assembly?}", defaults: new Dictionary <string, object> { { "tfm", new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, FrameworkConstants.EmptyVersion) } }) }, pathPatterns: new PatternDefinition[] { "runtimes/{rid}/lib/{tfm}/{assembly}", "lib/{tfm}/{assembly}", new PatternDefinition("lib/{assembly}", defaults: new Dictionary <string, object> { { "tfm", new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, FrameworkConstants.EmptyVersion) } }) }); CompileAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { "ref/{tfm}/{any?}", }, pathPatterns: new PatternDefinition[] { "ref/{tfm}/{assembly}", }); NativeLibraries = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { "runtimes/{rid}/native/{any?}", "native/{any?}", }, pathPatterns: new PatternDefinition[] { "runtimes/{rid}/native/{any}", "native/{any}", }); }
internal ManagedCodePatterns(ManagedCodeConventions conventions) { AnyTargettedFile = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("{any}/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("runtimes/{rid}/{any}/{tfm}/{any?}", table: DotnetAnyTable), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("{any}/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("runtimes/{rid}/{any}/{tfm}/{any?}", table: DotnetAnyTable), }); RuntimeAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/lib/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("lib/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("lib/{assembly?}", table: DotnetAnyTable, defaults: NetTFMTable) }, pathPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/lib/{tfm}/{assembly}", table: DotnetAnyTable), new PatternDefinition("lib/{tfm}/{assembly}", table: DotnetAnyTable), new PatternDefinition("lib/{assembly}", table: DotnetAnyTable, defaults: NetTFMTable) }); CompileRefAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("ref/{tfm}/{any?}", table: DotnetAnyTable), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("ref/{tfm}/{assembly}", table: DotnetAnyTable), }); CompileLibAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("lib/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("lib/{assembly?}", table: DotnetAnyTable, defaults: NetTFMTable) }, pathPatterns: new PatternDefinition[] { new PatternDefinition("lib/{tfm}/{assembly}", table: DotnetAnyTable), new PatternDefinition("lib/{assembly}", table: DotnetAnyTable, defaults: NetTFMTable) }); NativeLibraries = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/nativeassets/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("runtimes/{rid}/native/{any?}", table: null, defaults: DefaultTfmAny) }, pathPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/nativeassets/{tfm}/{any}", table: DotnetAnyTable), new PatternDefinition("runtimes/{rid}/native/{any}", table: null, defaults: DefaultTfmAny) }); ResourceAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/lib/{tfm}/{locale?}/{any?}", table: DotnetAnyTable), new PatternDefinition("lib/{tfm}/{locale?}/{any?}", table: DotnetAnyTable), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/lib/{tfm}/{locale}/{satelliteAssembly}", table: DotnetAnyTable), new PatternDefinition("lib/{tfm}/{locale}/{satelliteAssembly}", table: DotnetAnyTable), }); MSBuildFiles = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("build/{tfm}/{msbuild?}", table: DotnetAnyTable), new PatternDefinition("build/{msbuild?}", table: null, defaults: DefaultTfmAny) }, pathPatterns: new PatternDefinition[] { new PatternDefinition("build/{tfm}/{msbuild}", table: DotnetAnyTable), new PatternDefinition("build/{msbuild}", table: null, defaults: DefaultTfmAny) }); MSBuildMultiTargetingFiles = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("buildMultiTargeting/{msbuild?}", table: null, defaults: DefaultTfmAny), // deprecated new PatternDefinition("buildCrossTargeting/{msbuild?}", table: null, defaults: DefaultTfmAny) }, pathPatterns: new PatternDefinition[] { new PatternDefinition("buildMultiTargeting/{msbuild}", table: null, defaults: DefaultTfmAny), // deprecated new PatternDefinition("buildCrossTargeting/{msbuild}", table: null, defaults: DefaultTfmAny) }); ContentFiles = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("contentFiles/{codeLanguage}/{tfm}/{any?}"), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("contentFiles/{codeLanguage}/{tfm}/{any?}"), }); ToolsAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("tools/{tfm}/{rid}/{any?}", table: AnyTable), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("tools/{tfm}/{rid}/{any?}", table: AnyTable), }); EmbedAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("embed/{tfm}/{any?}", table: DotnetAnyTable), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("embed/{tfm}/{assembly}", table: DotnetAnyTable), }); MSBuildTransitiveFiles = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("buildTransitive/{tfm}/{msbuild?}", table: DotnetAnyTable), new PatternDefinition("buildTransitive/{msbuild?}", table: null, defaults: DefaultTfmAny) }, pathPatterns: new PatternDefinition[] { new PatternDefinition("buildTransitive/{tfm}/{msbuild}", table: DotnetAnyTable), new PatternDefinition("buildTransitive/{msbuild}", table: null, defaults: DefaultTfmAny) }); }
internal ManagedCodeCriteria(ManagedCodeConventions conventions) { _conventions = conventions; }
internal ManagedCodePatterns(ManagedCodeConventions conventions) { AnyTargettedFile = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("{any}/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("runtimes/{rid}/{any}/{tfm}/{any?}", table: DotnetAnyTable), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("{any}/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("runtimes/{rid}/{any}/{tfm}/{any?}", table: DotnetAnyTable), }); RuntimeAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/lib/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("lib/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("lib/{assembly?}", table: DotnetAnyTable, defaults: new Dictionary <string, object> { { "tfm", new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, FrameworkConstants.EmptyVersion) } }) }, pathPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/lib/{tfm}/{assembly}", table: DotnetAnyTable), new PatternDefinition("lib/{tfm}/{assembly}", table: DotnetAnyTable), new PatternDefinition("lib/{assembly}", table: DotnetAnyTable, defaults: new Dictionary <string, object> { { "tfm", new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, FrameworkConstants.EmptyVersion) } }) }); CompileAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("ref/{tfm}/{any?}", table: DotnetAnyTable), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("ref/{tfm}/{assembly}", table: DotnetAnyTable), }); NativeLibraries = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/nativeassets/{tfm}/{any?}", table: DotnetAnyTable), new PatternDefinition("runtimes/{rid}/native/{any?}", table: null, defaults: DefaultTfmAny) }, pathPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/nativeassets/{tfm}/{any}", table: DotnetAnyTable), new PatternDefinition("runtimes/{rid}/native/{any}", table: null, defaults: DefaultTfmAny) }); ResourceAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/lib/{tfm}/{locale?}/{any?}", table: DotnetAnyTable), new PatternDefinition("lib/{tfm}/{locale?}/{any?}", table: DotnetAnyTable), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("runtimes/{rid}/lib/{tfm}/{locale}/{satelliteAssembly}", table: DotnetAnyTable), new PatternDefinition("lib/{tfm}/{locale}/{satelliteAssembly}", table: DotnetAnyTable), }); MSBuildFiles = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("build/{tfm}/{msbuild?}", table: DotnetAnyTable), new PatternDefinition("build/{msbuild?}", table: null, defaults: DefaultTfmAny) }, pathPatterns: new PatternDefinition[] { new PatternDefinition("build/{tfm}/{msbuild}", table: DotnetAnyTable), new PatternDefinition("build/{msbuild}", table: null, defaults: DefaultTfmAny) }); ContentFiles = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { new PatternDefinition("contentFiles/{codeLanguage}/{tfm}/{any?}"), }, pathPatterns: new PatternDefinition[] { new PatternDefinition("contentFiles/{codeLanguage}/{tfm}/{any?}"), }); }
public AggregateNuGetAssetResolver(string runtimeFile) { RuntimeGraph runtimeGraph = null; if (!String.IsNullOrEmpty(runtimeFile)) { runtimeGraph = JsonRuntimeFormat.ReadRuntimeGraph(runtimeFile); } _conventions = new ManagedCodeConventions(runtimeGraph); _packages = new Dictionary<string, ContentItemCollection>(); }
internal ManagedCodePatterns(ManagedCodeConventions conventions) { RuntimeAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { "runtimes/{rid}/lib/{tfm}/{any?}", "lib/{tfm}/{any?}", new PatternDefinition("lib/{assembly?}", defaults: new Dictionary<string, object> { { "tfm", new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, FrameworkConstants.EmptyVersion) } }) }, pathPatterns: new PatternDefinition[] { "runtimes/{rid}/lib/{tfm}/{assembly}", "lib/{tfm}/{assembly}", new PatternDefinition("lib/{assembly}", defaults: new Dictionary<string, object> { { "tfm", new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, FrameworkConstants.EmptyVersion) } }) }); CompileAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { "ref/{tfm}/{any?}", }, pathPatterns: new PatternDefinition[] { "ref/{tfm}/{assembly}", }); NativeLibraries = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { "runtimes/{rid}/native/{any?}", "native/{any?}", }, pathPatterns: new PatternDefinition[] { "runtimes/{rid}/native/{any}", "native/{any}", }); ResourceAssemblies = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { "runtimes/{rid}/lib/{tfm}/{locale?}/{any?}", "lib/{tfm}/{locale?}/{any?}" }, pathPatterns: new PatternDefinition[] { "runtimes/{rid}/lib/{tfm}/{locale}/{resources}", "lib/{tfm}/{locale}/{resources}" }); MSBuildFiles = new PatternSet( conventions.Properties, groupPatterns: new PatternDefinition[] { "build/{tfm}/{any?}", new PatternDefinition("build/{any?}", defaults: new Dictionary<string, object> { { "tfm", new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, FrameworkConstants.EmptyVersion) } }) }, pathPatterns: new PatternDefinition[] { "build/{tfm}/{msbuild}", new PatternDefinition("build/{msbuild}", defaults: new Dictionary<string, object> { { "tfm", new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, FrameworkConstants.EmptyVersion) } }) }); }