forked from dotnet/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckForTargetInAssetsFile.cs
More file actions
31 lines (23 loc) · 925 Bytes
/
CheckForTargetInAssetsFile.cs
File metadata and controls
31 lines (23 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.Build.Framework;
using NuGet.ProjectModel;
using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.NET.Build.Tasks
{
public class CheckForTargetInAssetsFile : TaskBase
{
public string AssetsFilePath { get; set; }
[Required]
public string TargetFrameworkMoniker { get; set; }
public string RuntimeIdentifier { get; set; }
protected override void ExecuteCore()
{
LockFile lockFile = new LockFileCache(this).GetLockFile(AssetsFilePath);
var nugetFramework = NuGetUtils.ParseFrameworkName(TargetFrameworkMoniker);
lockFile.GetTargetAndThrowIfNotFound(nugetFramework, RuntimeIdentifier);
}
}
}