• 大小: 30.46MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-03
  • 语言: C#
  • 标签: AspNetCore  2.2  源代码  

资源简介

https://github.com/aspnet/AspNetCore AspNetCore-release-2.2源代码。Asp.Net Core is a Cross-platfrom .net framework for building modern cloud-based web applications on windows,mac or linux

资源截图

代码片段和文件信息

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.framework;
using NuGet.Packaging;
using NuGet.Packaging.Core;
using RepoTasks.Utilities;

namespace RepoTasks
{
    public class CheckExpectedPackagesExist : Microsoft.Build.Utilities.Task
    {
        /// 
        /// The item group containing the nuget packages to split in different folders.
        /// 

        [Required]
        public ITaskItem[] Packages { get; set; }

        [Required]
        public ITaskItem[] Files { get; set; }

        public override bool Execute()
        {
            if (Files?.Length == 0)
            {
                Log.LogError(“No packages were found.“);
                return false;
            }

            var expectedPackages = new HashSet(Packages.Select(i => i.ItemSpec) StringComparer.OrdinalIgnoreCase);

            foreach (var file in Files)
            {
                PackageIdentity identity;
                using (var reader = new PackageArchiveReader(file.ItemSpec))
                {
                    identity = reader.GetIdentity();
                }

                if (!expectedPackages.Contains(identity.Id))
                {
                    Log.LogError($“Unexpected package artifact with id: {identity.Id}“);
                    continue;
                }

                expectedPackages.Remove(identity.Id);
            }

            if (expectedPackages.Count != 0)
            {
                var error = new StringBuilder();
                foreach (var id in expectedPackages)
                {
                    error.Append(“ - “).AppendLine(id);
                }

                Log.LogError($“Expected the following packages but they were not found:“ + error.ToString());
                return false;
            }

            return !Log.HasLoggedErrors;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-21 21:24  AspNetCore-release-2.2\
     目录           0  2018-12-21 21:24  AspNetCore-release-2.2\.azure\
     目录           0  2018-12-21 21:24  AspNetCore-release-2.2\.azure\pipelines\
     文件        7834  2018-12-21 21:24  AspNetCore-release-2.2\.azure\pipelines\ci-official.yml
     文件        1784  2018-12-21 21:24  AspNetCore-release-2.2\.azure\pipelines\ci.yml
     文件        4404  2018-12-21 21:24  AspNetCore-release-2.2\.azure\pipelines\e2e-tests.yml
     目录           0  2018-12-21 21:24  AspNetCore-release-2.2\.azure\pipelines\jobs\
     文件        6094  2018-12-21 21:24  AspNetCore-release-2.2\.azure\pipelines\jobs\default-build.yml
     文件        1196  2018-12-21 21:24  AspNetCore-release-2.2\.azure\pipelines\jobs\iisintegration-job.yml
     文件         737  2018-12-21 21:24  AspNetCore-release-2.2\.azure\pipelines\pr-validation-temp.yml
     文件        1338  2018-12-21 21:24  AspNetCore-release-2.2\.azure\pipelines\site-extensions.yml
     目录           0  2018-12-21 21:24  AspNetCore-release-2.2\.config\
     文件         678  2018-12-21 21:24  AspNetCore-release-2.2\.config\CredScanSuppressions.json
     文件         535  2018-12-21 21:24  AspNetCore-release-2.2\.editorconfig
     文件        2764  2018-12-21 21:24  AspNetCore-release-2.2\.gitattributes
     文件         295  2018-12-21 21:24  AspNetCore-release-2.2\.gitignore
     文件         393  2018-12-21 21:24  AspNetCore-release-2.2\.gitmodules
     目录           0  2018-12-21 21:24  AspNetCore-release-2.2\.vscode\
     文件         115  2018-12-21 21:24  AspNetCore-release-2.2\.vscode\extensions.json
     文件         335  2018-12-21 21:24  AspNetCore-release-2.2\.vscode\launch.json
     文件         185  2018-12-21 21:24  AspNetCore-release-2.2\.vscode\settings.json
     文件         168  2018-12-21 21:24  AspNetCore-release-2.2\CONTRIBUTING.md
     文件        5755  2018-12-21 21:24  AspNetCore-release-2.2\Directory.Build.props
     文件        4771  2018-12-21 21:24  AspNetCore-release-2.2\Directory.Build.targets
     文件         575  2018-12-21 21:24  AspNetCore-release-2.2\LICENSE.txt
     文件         471  2018-12-21 21:24  AspNetCore-release-2.2\NuGet.config
     文件        2995  2018-12-21 21:24  AspNetCore-release-2.2\README.md
     文件        4997  2018-12-21 21:24  AspNetCore-release-2.2\THIRD-PARTY-NOTICES
     文件         260  2018-12-21 21:24  AspNetCore-release-2.2\build.cmd
     文件         253  2018-12-21 21:24  AspNetCore-release-2.2\build.sh
     目录           0  2018-12-21 21:24  AspNetCore-release-2.2\build\
............此处省略17778个文件信息

评论

共有 条评论