-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4124d6
commit 6d8bb7e
Showing
7 changed files
with
84 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
trigger: | ||
- master | ||
- main | ||
- latest | ||
- rel/* | ||
- preview/* | ||
|
||
pr: | ||
- master | ||
- main | ||
- latest | ||
- rel/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
CAKE_VERSION=0.38.1 | ||
CAKE_VERSION=0.38.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/Pharmacist.Core/Extractors/PlatformExtractors/NetCoreExtractorBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using NuGet.Frameworks; | ||
using NuGet.LibraryModel; | ||
using NuGet.Versioning; | ||
using Pharmacist.Core.Groups; | ||
using Pharmacist.Core.NuGet; | ||
|
||
namespace Pharmacist.Core.Extractors.PlatformExtractors | ||
{ | ||
/// <summary> | ||
/// WPF platform assemblies and events. | ||
/// </summary> | ||
internal abstract class NetCoreExtractorBase : NuGetExtractor, IPlatformExtractor | ||
{ | ||
private static readonly IReadOnlyList<NuGetFramework> _frameworks = "netcoreapp3.1".ToFrameworks(); | ||
private static readonly LibraryRange _windowsDesktopReference = new LibraryRange("Microsoft.WindowsDesktop.App.Ref", VersionRange.Parse("3.*"), LibraryDependencyTarget.Package); | ||
|
||
private readonly string? _filePath; | ||
|
||
public NetCoreExtractorBase(string? filePath) | ||
{ | ||
_filePath = filePath ?? Path.GetTempPath(); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public NuGetFramework Framework { get; } = _frameworks[0]; | ||
|
||
/// <inheritdoc /> | ||
public abstract AutoPlatform Platform { get; } | ||
|
||
/// <summary> | ||
/// Gets the wanted file names. | ||
/// </summary> | ||
protected abstract HashSet<string> WantedFileNames { get; } | ||
|
||
/// <inheritdoc /> | ||
public async Task Extract(string referenceAssembliesLocation) | ||
{ | ||
await Extract(_frameworks, new[] { _windowsDesktopReference }, _filePath).ConfigureAwait(false); | ||
|
||
if (Input == null) | ||
{ | ||
return; | ||
} | ||
|
||
var fileMetadataEnumerable = Input.IncludeGroup.GetAllFileNames().Where(file => WantedFileNames.Contains(Path.GetFileName(file), StringComparer.InvariantCultureIgnoreCase)); | ||
|
||
var newInput = new InputAssembliesGroup(); | ||
newInput.IncludeGroup.AddFiles(fileMetadataEnumerable); | ||
newInput.SupportGroup.AddFiles(Input.IncludeGroup.GetAllFileNames()); | ||
newInput.SupportGroup.AddFiles(Input.SupportGroup.GetAllFileNames()); | ||
Input = newInput; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters