diff options
author | Nate McMaster <natemcmaster@users.noreply.github.com> | 2018-11-20 22:34:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-20 22:34:53 +0300 |
commit | 71ca1faa6bd4e3fbac7b8678c54fbd3e437ce7b9 (patch) | |
tree | 78290c5a8af6d8e7053c76ba512edc44d672f064 | |
parent | 33095908b91188590c11c667c27abc68d6287f8a (diff) |
React to MSBuild breaking changes and remove ProdCon v1 variables (#4161)
This should unblock the consumption of the latest .NET Core SDK, which includes breaking changes in MSBuild. We don't _really_ need the MSBuild APIs which were broken because ProdCon v1 is dead. This removes the unused ProdCon v1 tasks and targets.
-rw-r--r-- | build/Publish.targets | 74 | ||||
-rw-r--r-- | build/RepositoryBuild.targets | 1 | ||||
-rw-r--r-- | build/dependencies.props | 11 | ||||
-rw-r--r-- | build/repo.props | 3 | ||||
-rw-r--r-- | build/repo.targets | 13 | ||||
-rw-r--r-- | build/tasks/CheckExpectedPackagesExist.cs | 69 | ||||
-rw-r--r-- | build/tasks/CheckVersionOverrides.cs | 45 | ||||
-rw-r--r-- | build/tasks/Logger/FlowLogger.cs | 61 | ||||
-rw-r--r-- | build/tasks/Logger/MSBuildLogger.cs | 200 | ||||
-rw-r--r-- | build/tasks/RepoTasks.csproj | 1 | ||||
-rw-r--r-- | build/tasks/RepoTasks.tasks | 13 | ||||
-rw-r--r-- | build/tasks/RuntimeGraphManager.cs (renamed from build/tasks/Utilities/RuntimeGraphManager.cs) | 0 | ||||
-rw-r--r-- | run.ps1 | 44 | ||||
-rwxr-xr-x | run.sh | 64 | ||||
-rw-r--r-- | src/Installers/Windows/build.ps1 | 22 |
15 files changed, 3 insertions, 618 deletions
diff --git a/build/Publish.targets b/build/Publish.targets index 1aab9b260d..ffb4352ef7 100644 --- a/build/Publish.targets +++ b/build/Publish.targets @@ -15,16 +15,8 @@ GetFilesToPublish; PublishToLocalFolder; PublishToAzureFeed; - PublishToTransportFeed; PublishToMyGet; </PublishDependsOn> - - <!-- Settings for pushing to the transport feed --> - <PushToBlobFeed_UploadTimeoutMinutes>10</PushToBlobFeed_UploadTimeoutMinutes> - <PushToBlobFeed_Overwrite Condition="'$(PushToBlobFeed_Overwrite)' == ''">false</PushToBlobFeed_Overwrite> - <PushToBlobFeed_MaxClients Condition="'$(PushToBlobFeed_MaxClients)' == ''">8</PushToBlobFeed_MaxClients> - <BlobFileRelativePathBase Condition="'$(BlobFileRelativePathBase)' == ''">assets</BlobFileRelativePathBase> - <BlobFileRelativePathBase Condition="!HasTrailingSlash('$(BlobFileRelativePathBase)')">$(BlobFileRelativePathBase)/</BlobFileRelativePathBase> </PropertyGroup> <Target Name="Publish" DependsOnTargets="$(PublishDependsOn)" /> @@ -74,52 +66,43 @@ <!-- Windows Server hosting bundle --> <FilesToPublish Include="$(DependencyAssetsDir)$(WindowsHostingBundleInstallerFileName)"> <RelativeBlobPath>$(BlobBasePath)$(WindowsHostingBundleInstallerFileName)</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> </FilesToPublish> <!-- Package archives --> <FilesToPublish Include="$(DependencyAssetsDir)nuGetPackagesArchive-ci-server-$(PackageVersion).zip" > <RelativeBlobPath>$(BlobBasePath)nuGetPackagesArchive-ci-server-$(PackageVersion).zip</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> </FilesToPublish> <FilesToPublish Include="$(DependencyAssetsDir)nuGetPackagesArchive-ci-server-$(PackageVersion).patch.zip" > <RelativeBlobPath>$(BlobBasePath)nuGetPackagesArchive-ci-server-$(PackageVersion).patch.zip</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> </FilesToPublish> <FilesToPublish Include="$(DependencyAssetsDir)nuGetPackagesArchive-ci-server-compat-$(PackageVersion).patch.zip" > <RelativeBlobPath>$(BlobBasePath)nuGetPackagesArchive-ci-server-compat-$(PackageVersion).patch.zip</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> </FilesToPublish> <!-- Intermediate files passed on to the dotnet-CLI. --> <FilesToPublish Include="$(DependencyAssetsDir)nuGetPackagesArchive-$(PackageVersion).lzma" > <RelativeBlobPath>$(BlobBasePath)nuGetPackagesArchive-$(PackageVersion).lzma</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> </FilesToPublish> <FilesToPublish Include="$(DependencyAssetsDir)$(IntermediateInstallerBaseFileName)-%(IntermediateInstaller.Identity)%(IntermediateInstaller.FileExt)" Condition=" '%(IntermediateInstaller.Identity)' != '' "> <RelativeBlobPath>$(BlobBasePath)$(IntermediateInstallerBaseFileName)-%(IntermediateInstaller.Identity)%(IntermediateInstaller.FileExt)</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> </FilesToPublish> <FilesToPublish Include="$(BaseRuntimeVersionFile)"> <RelativeBlobPath>$(BlobBasePath)$(BaseRuntimeVersionFileName)</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> <ContentType>text/plain</ContentType> </FilesToPublish> <!-- Archive installers --> <FilesToPublish Include="$(DependencyAssetsDir)$(InstallerBaseFileName)-%(NativeInstaller.Identity)%(NativeInstaller.FileExt)" Condition=" '%(NativeInstaller.FileExt)' != '' "> <RelativeBlobPath>$(BlobBasePath)$(InstallerBaseFileName)-%(NativeInstaller.Identity)%(NativeInstaller.FileExt)</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> </FilesToPublish> <!-- Support for README badges and dotnet-install.ps1/sh --> <FilesToPublish Include="$(DependencyAssetsDir)$(InstallerBaseFileName)-%(NativeInstaller.Identity)%(NativeInstaller.FileExt)" Condition=" '%(NativeInstaller.FileExt)' != '' "> <RelativeBlobPath>$(AliasBlobBasePath)$(InstallerAliasBaseFileName)-%(NativeInstaller.Identity)%(NativeInstaller.FileExt)</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> <Overwrite>true</Overwrite> <!-- These uploads duplicate the same blob in a separate location for README download links and to make dotnet-install.ps1/sh work when specifying -Channel. --> <IsDuplicateUpload>true</IsDuplicateUpload> @@ -127,7 +110,6 @@ <FilesToPublish Include="@(SharedFxVersionBadge)"> <RelativeBlobPath>$(AliasBlobBasePath)%(SharedFxVersionBadge.FileName)%(SharedFxVersionBadge.Extension)</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> <CacheControl>no-cache, no-store, must-revalidate</CacheControl> <ContentType>image/svg+xml</ContentType> <Overwrite>true</Overwrite> @@ -135,7 +117,6 @@ <FilesToPublish Include="$(LatestRuntimeVersionFile)"> <RelativeBlobPath>$(AliasBlobBasePath)$(LatestRuntimeVersionFileName)</RelativeBlobPath> - <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData> <CacheControl>no-cache, no-store, must-revalidate</CacheControl> <ContentType>text/plain</ContentType> <Overwrite>true</Overwrite> @@ -154,7 +135,6 @@ <FilesToPublish Include="$(DependencyPackagesDir)%(ArtifactInfo.FileName)%(ArtifactInfo.Extension)" Condition="'%(ArtifactInfo.ArtifactType)' == 'JavaJar'"> <RelativeBlobPath>$(JarBlobBasePath)%(ArtifactInfo.FileName)%(ArtifactInfo.Extension)</RelativeBlobPath> - <ManifestArtifactData>Type=JavaJar</ManifestArtifactData> </FilesToPublish> <FilesToPublish Include="$(DependencyAssetsDir)%(ArtifactInfo.FileName)%(ArtifactInfo.Extension)" Condition="'%(ArtifactInfo.ArtifactType)' == 'MavenPOM'"> @@ -163,7 +143,6 @@ <NpmPackageToPublish Include="$(DependencyAssetsDir)%(ArtifactInfo.FileName)%(ArtifactInfo.Extension)" Condition="'%(ArtifactInfo.ArtifactType)' == 'NpmPackage'"> <RelativeBlobPath>$(NpmBlobBasePath)%(ArtifactInfo.PackageId)/%(ArtifactInfo.FileName)%(ArtifactInfo.Extension)</RelativeBlobPath> - <ManifestArtifactData>Type=NpmPackage</ManifestArtifactData> <ContentType>application/tar+gzip</ContentType> </NpmPackageToPublish> </ItemGroup> @@ -274,57 +253,4 @@ Files="@(FilesToPublish)" /> </Target> - <Target Name="PublishToTransportFeed" - DependsOnTargets="ResolveCommitHash;GetFilesToPublish" - Condition="'$(PublishToTransportFeed)' == 'true'"> - - <ItemGroup> - <PackageToPublishToTransport - Include="@(PackageToPublish)" - Condition="'%(PackageToPublish.Category)' == 'ship'" /> - - <PackageToPublishToTransport - Include="@(PackageToPublish)" - ManifestArtifactData="NonShipping=true" - Condition="'%(PackageToPublish.Category)' != 'ship'" /> - - <FilesToPublishToTransport Include="@(NpmPackageToPublish)" - RelativeBlobPath="$(BlobFileRelativePathBase)%(NpmPackageToPublish.RelativeBlobPath)" - ManifestArtifactData="%(NpmPackageToPublish.ManifestArtifactData)" /> - - <!-- Filter aliased artifacts to workaround dotnet/buildtools#1855 --> - <FilesToPublishToTransport Include="@(FilesToPublish)" - RelativeBlobPath="$(BlobFileRelativePathBase)%(FilesToPublish.RelativeBlobPath)" - ManifestArtifactData="%(FilesToPublish.ManifestArtifactData)" - Condition=" '%(FilesToPublish.IsDuplicateUpload)' != 'true' " /> - </ItemGroup> - - - <PushToBlobFeed ExpectedFeedUrl="$(PublishBlobFeedUrl)" - AccountKey="$(PublishBlobFeedKey)" - ItemsToPush="@(PackageToPublishToTransport)" - Overwrite="$(PushToBlobFeed_Overwrite)" - UploadTimeoutInMinutes="$(PushToBlobFeed_UploadTimeoutMinutes)" - ManifestBranch="$(BuildBranch)" - ManifestBuildId="$(Version)" - ManifestBuildData="ProductVersion=$(PackageVersion);UniverseCommitHash=$(CommitHash)" - ManifestCommit="$(CommitHash)" - ManifestName="aspnet" - MaxClients="$(PushToBlobFeed_MaxClients)" - Condition="@(PackageToPublish->Count()) != 0" /> - - <PushToBlobFeed ExpectedFeedUrl="$(PublishBlobFeedUrl)" - AccountKey="$(PublishBlobFeedKey)" - ItemsToPush="@(FilesToPublishToTransport)" - PublishFlatContainer="true" - Overwrite="$(PushToBlobFeed_Overwrite)" - UploadTimeoutInMinutes="$(PushToBlobFeed_UploadTimeoutMinutes)" - ManifestBranch="$(BuildBranch)" - ManifestBuildId="$(Version)" - ManifestBuildData="ProductVersion=$(PackageVersion);UniverseCommitHash=$(CommitHash)" - ManifestCommit="$(CommitHash)" - ManifestName="aspnet" - MaxClients="$(PushToBlobFeed_MaxClients)" /> - </Target> - </Project> diff --git a/build/RepositoryBuild.targets b/build/RepositoryBuild.targets index 6a14264dca..0c88f5afad 100644 --- a/build/RepositoryBuild.targets +++ b/build/RepositoryBuild.targets @@ -86,7 +86,6 @@ <RepositoryBuildArguments>$(RepositoryBuildArguments) /p:BuildNumber=$(BuildNumber)</RepositoryBuildArguments> <RepositoryBuildArguments>$(RepositoryBuildArguments) /p:Configuration=$(Configuration)</RepositoryBuildArguments> <RepositoryBuildArguments>$(RepositoryBuildArguments) /p:IsFinalBuild=$(IsFinalBuild)</RepositoryBuildArguments> - <RepositoryBuildArguments>$(RepositoryBuildArguments) /noconsolelogger '/l:RepoTasks.FlowLogger,$(MSBuildThisFileDirectory)tasks\bin\publish\RepoTasks.dll;Summary;FlowId=$(RepositoryToBuild)'</RepositoryBuildArguments> <RepositoryBuildArguments>$(RepositoryBuildArguments) '/p:DotNetAssetRootAccessTokenSuffix=$(DotNetAssetRootAccessTokenSuffix)'</RepositoryBuildArguments> <RepositoryBuildArguments>$(RepositoryBuildArguments) '/p:DotNetAssetRootUrl=$(DotNetAssetRootUrl)'</RepositoryBuildArguments> <RepositoryBuildArguments Condition=" '$(SkipTestsDueToMissingSharedFx)' == 'true' ">$(RepositoryBuildArguments) /p:SkipAspNetCoreRuntimeInstall=true</RepositoryBuildArguments> diff --git a/build/dependencies.props b/build/dependencies.props index 0e6582f464..bb75148f65 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,10 +1,10 @@ <Project> - <!-- These package versions may be overridden or updated by automation. --> - <PropertyGroup Label="Package Versions: Auto" Condition=" '$(DotNetPackageVersionPropsPath)' == '' "> + <PropertyGroup Label="Package Versions: .NET Core dependencies"> <!-- Packages from dotnet/core-setup --> <MicrosoftExtensionsDependencyModelPackageVersion>3.0.0-preview-27117-01</MicrosoftExtensionsDependencyModelPackageVersion> <MicrosoftNETCoreAppPackageVersion>3.0.0-preview-27117-01</MicrosoftNETCoreAppPackageVersion> + <MicrosoftNETCoreApp30PackageVersion>$(MicrosoftNETCoreAppPackageVersion)</MicrosoftNETCoreApp30PackageVersion> <MicrosoftNETCoreDotNetAppHostPackageVersion>3.0.0-preview-27117-01</MicrosoftNETCoreDotNetAppHostPackageVersion> <MicrosoftDotNetPlatformAbstractionsPackageVersion>3.0.0-preview-27117-01</MicrosoftDotNetPlatformAbstractionsPackageVersion> @@ -114,15 +114,9 @@ <MicrosoftEntityFrameworkCorePackageVersion>3.0.0-preview.18569.2</MicrosoftEntityFrameworkCorePackageVersion> </PropertyGroup> - <Import Project="$(DotNetPackageVersionPropsPath)" Condition="'$(DotNetPackageVersionPropsPath)' != ''" /> <Import Project="dependencies.folderbuilds.props" Condition=" '$(IsUniverseBuild)' != 'true' AND '$(DotNetPackageVersionPropsPath)' == ''" /> <PropertyGroup> - <!-- Assign this variable last because it may be updated from DotNetPackageVersionPropsPath as MicrosoftNETCoreAppPackageVersion. --> - <MicrosoftNETCoreApp30PackageVersion Condition="'$(MicrosoftNETCoreAppPackageVersion)' != ''">$(MicrosoftNETCoreAppPackageVersion)</MicrosoftNETCoreApp30PackageVersion> - <!-- Assign this variable to ensure they are consistent. --> - <MicrosoftNETCoreAppPackageVersion>$(MicrosoftNETCoreApp30PackageVersion)</MicrosoftNETCoreAppPackageVersion> - <!-- Determined by build tools --> <InternalAspNetCoreSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSdkPackageVersion> <InternalAspNetCoreSiteExtensionSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSiteExtensionSdkPackageVersion> @@ -148,7 +142,6 @@ <BenchmarksOnlyPomeloEntityFrameworkCoreMySqlPackageVersion>2.1.1</BenchmarksOnlyPomeloEntityFrameworkCoreMySqlPackageVersion> <CastleCorePackageVersion>4.2.1</CastleCorePackageVersion> - <DevDependency_MicrosoftDotNetBuildTasksFeedPackageVersion>2.2.0-preview1-03124-01</DevDependency_MicrosoftDotNetBuildTasksFeedPackageVersion> <DevDependency_MicrosoftExtensionsDependencyModelPackageVersion>2.1.0</DevDependency_MicrosoftExtensionsDependencyModelPackageVersion> <DevDependency_WindowsAzureStoragePackageVersion>8.7.0</DevDependency_WindowsAzureStoragePackageVersion> <FSharpCorePackageVersion>4.2.1</FSharpCorePackageVersion> diff --git a/build/repo.props b/build/repo.props index 91aeb2bd04..fa1370912e 100644 --- a/build/repo.props +++ b/build/repo.props @@ -85,9 +85,6 @@ <PublishToMyGet Condition=" $(PublishType.Contains('myget')) ">true</PublishToMyGet> <!-- azure = non-orchestrated builds --> <PublishToAzureFeed Condition="$(PublishType.Contains('azure'))">true</PublishToAzureFeed> - - <!-- blob = orchestrated builds --> - <PublishToTransportFeed Condition="$(PublishType.Contains('blob'))">true</PublishToTransportFeed> </PropertyGroup> <Import Project="runtimes.props" /> diff --git a/build/repo.targets b/build/repo.targets index 89c393ebd9..93a372d4fc 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -22,7 +22,6 @@ <CompileDependsOn>$(CompileDependsOn);BuildProjects;PackSharedSources</CompileDependsOn> <CompileDependsOn Condition="'$(_ProjectsOnly)' != 'true'">$(CompileDependsOn);PackProjects;BuildRepositories;BuildSharedFx</CompileDependsOn> <PackageDependsOn Condition=" '$(_ProjectsOnly)' == 'true'">$(PackageDependsOn);PackProjects</PackageDependsOn> - <PackageDependsOn Condition="'$(TestOnly)' != 'true' AND '$(_ProjectsOnly)' != 'true'">$(PackageDependsOn);CheckExpectedPackagesExist</PackageDependsOn> <PackageDependsOn Condition="'$(TestOnly)' != 'true'">$(PackageDependsOn);CodeSign</PackageDependsOn> <TestDependsOn>$(TestDependsOn);TestProjects</TestDependsOn> <TestDependsOn Condition="'$(_ProjectsOnly)' != 'true'">$(TestDependsOn);_TestRepositories</TestDependsOn> @@ -303,10 +302,6 @@ </Target> <Target Name="VerifyExternalDependencyConfig"> - <RepoTasks.CheckVersionOverrides DotNetPackageVersionPropsPath="$(DotNetPackageVersionPropsPath)" - DependenciesFile="$(MSBuildThisFileDirectory)dependencies.props" - Condition="'$(DotNetPackageVersionPropsPath)' != ''" /> - <Error Text="Missing Version metadata for the following external dependencies: %0A - @(ExternalDependency->WithMetadataValue('Version', ''), '%0A - '). " Condition=" @(ExternalDependency->WithMetadataValue('Version', '')->Count()) != 0 " /> </Target> @@ -314,14 +309,6 @@ <Target Name="FastCheck" DependsOnTargets="ComputeGraph;VerifyPackageArtifactConfig;VerifyAllReposHaveNuGetPackageVerifier" /> - <Target Name="CheckExpectedPackagesExist"> - <ItemGroup> - <PackageArtifactFile Include="$(BuildDir)*.nupkg" Exclude="$(BuildDir)*.symbols.nupkg" /> - </ItemGroup> - - <RepoTasks.CheckExpectedPackagesExist Packages="@(PackageArtifact)" Files="@(PackageArtifactFile)" /> - </Target> - <Target Name="VerifyAllReposHaveNuGetPackageVerifier" DependsOnTargets="_PrepareRepositories"> <Error Condition="'%(Repository.Identity)' != '' AND !Exists('%(Repository.RootPath)NuGetPackageVerifier.json')" Text="Repository %(Repository.Identity) is missing NuGetPackageVerifier.json. Expected file to exist in %(Repository.RootPath)NuGetPackageVerifier.json" /> diff --git a/build/tasks/CheckExpectedPackagesExist.cs b/build/tasks/CheckExpectedPackagesExist.cs deleted file mode 100644 index 0df55e5d47..0000000000 --- a/build/tasks/CheckExpectedPackagesExist.cs +++ /dev/null @@ -1,69 +0,0 @@ -// 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 - { - /// <summary> - /// The item group containing the nuget packages to split in different folders. - /// </summary> - [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<string>(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; - } - } -} diff --git a/build/tasks/CheckVersionOverrides.cs b/build/tasks/CheckVersionOverrides.cs deleted file mode 100644 index a510a8b800..0000000000 --- a/build/tasks/CheckVersionOverrides.cs +++ /dev/null @@ -1,45 +0,0 @@ -// 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.Linq; -using Microsoft.Build.Construction; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace RepoTasks -{ - public class CheckVersionOverrides : Task - { - [Required] - public string DotNetPackageVersionPropsPath { get; set; } - - [Required] - public string DependenciesFile { get; set; } - - public override bool Execute() - { - Log.LogMessage($"Verifying versions set in {DotNetPackageVersionPropsPath} match expected versions set in {DependenciesFile}"); - - var versionOverrides = ProjectRootElement.Open(DotNetPackageVersionPropsPath); - var dependencies = ProjectRootElement.Open(DependenciesFile); - var pinnedVersions = dependencies.PropertyGroups - .Where(p => string.Equals("Package Versions: Pinned", p.Label)) - .SelectMany(p => p.Properties) - .ToDictionary(p => p.Name, p => p.Value, StringComparer.OrdinalIgnoreCase); - - foreach (var prop in versionOverrides.Properties) - { - if (pinnedVersions.TryGetValue(prop.Name, out var pinnedVersion)) - { - if (!string.Equals(pinnedVersion, prop.Value, StringComparison.OrdinalIgnoreCase)) - { - Log.LogError($"The imported package version props file conflicts with a pinned version variable {prop.Name}. Imported value: {prop.Value}, Pinned value: {pinnedVersion}"); - } - } - } - - return !Log.HasLoggedErrors; - } - } -} diff --git a/build/tasks/Logger/FlowLogger.cs b/build/tasks/Logger/FlowLogger.cs deleted file mode 100644 index e6a214fdff..0000000000 --- a/build/tasks/Logger/FlowLogger.cs +++ /dev/null @@ -1,61 +0,0 @@ -// 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.Linq; -using Microsoft.Build.Framework; -using Microsoft.Build.Logging; - -namespace RepoTasks -{ - public class FlowLogger : ConsoleLogger - { - private volatile bool _initialized; - - public FlowLogger() - { - } - - public override void Initialize(IEventSource eventSource, int nodeCount) - { - PreInit(eventSource); - base.Initialize(eventSource, nodeCount); - } - - public override void Initialize(IEventSource eventSource) - { - PreInit(eventSource); - base.Initialize(eventSource); - } - - private void PreInit(IEventSource eventSource) - { - if (_initialized) return; - _initialized = true; - - var flowId = GetFlowId(); - var prefix = $"{flowId,-22}| "; - var write = WriteHandler; - WriteHandler = msg => write(prefix + msg); - - eventSource.BuildStarted += (o, e) => - { - WriteHandler(e.Message + Environment.NewLine); - }; - } - - private string GetFlowId() - { - var parameters = Parameters?.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); - if (parameters == null || parameters.Length == 0) - { - return null; - } - - const string flowIdParamName = "FlowId="; - return parameters - .FirstOrDefault(p => p.StartsWith(flowIdParamName, StringComparison.Ordinal)) - ?.Substring(flowIdParamName.Length); - } - } -} diff --git a/build/tasks/Logger/MSBuildLogger.cs b/build/tasks/Logger/MSBuildLogger.cs deleted file mode 100644 index 458bd698d9..0000000000 --- a/build/tasks/Logger/MSBuildLogger.cs +++ /dev/null @@ -1,200 +0,0 @@ -// 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 Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using NuGet.Common; - -namespace NuGet.Build -{ - /// <summary> - /// TaskLoggingHelper -> ILogger - /// </summary> - internal class MSBuildLogger : LoggerBase, Common.ILogger - { - private readonly TaskLoggingHelper _taskLogging; - - private delegate void LogMessageWithDetails(string subcategory, - string code, - string helpKeyword, - string file, - int lineNumber, - int columnNumber, - int endLineNumber, - int endColumnNumber, - MessageImportance importance, - string message, - params object[] messageArgs); - - private delegate void LogErrorWithDetails(string subcategory, - string code, - string helpKeyword, - string file, - int lineNumber, - int columnNumber, - int endLineNumber, - int endColumnNumber, - string message, - params object[] messageArgs); - - private delegate void LogMessageAsString(MessageImportance importance, - string message, - params object[] messageArgs); - - private delegate void LogErrorAsString(string message, - params object[] messageArgs); - - public MSBuildLogger(TaskLoggingHelper taskLogging) - { - _taskLogging = taskLogging ?? throw new ArgumentNullException(nameof(taskLogging)); - } - - public override void Log(ILogMessage message) - { - if (DisplayMessage(message.Level)) - { - if (RuntimeEnvironmentHelper.IsMono) - { - LogForMono(message); - return; - } - else - { - var logMessage = message as IRestoreLogMessage; - - if (logMessage == null) - { - logMessage = new RestoreLogMessage(message.Level, message.Message) - { - Code = message.Code, - FilePath = message.ProjectPath - }; - } - LogForNonMono(logMessage); - } - } - } - - /// <summary> - /// Log using with metadata for non mono platforms. - /// </summary> - private void LogForNonMono(IRestoreLogMessage message) - { - switch (message.Level) - { - case LogLevel.Error: - LogError(message, _taskLogging.LogError, _taskLogging.LogError); - break; - - case LogLevel.Warning: - LogError(message, _taskLogging.LogWarning, _taskLogging.LogWarning); - break; - - case LogLevel.Minimal: - LogMessage(message, MessageImportance.High, _taskLogging.LogMessage, _taskLogging.LogMessage); - break; - - case LogLevel.Information: - LogMessage(message, MessageImportance.Normal, _taskLogging.LogMessage, _taskLogging.LogMessage); - break; - - case LogLevel.Debug: - case LogLevel.Verbose: - default: - // Default to LogLevel.Debug and low importance - LogMessage(message, MessageImportance.Low, _taskLogging.LogMessage, _taskLogging.LogMessage); - break; - } - } - - /// <summary> - /// Log using basic methods to avoid missing methods on mono. - /// </summary> - private void LogForMono(ILogMessage message) - { - switch (message.Level) - { - case LogLevel.Error: - _taskLogging.LogError(message.Message); - break; - - case LogLevel.Warning: - _taskLogging.LogWarning(message.Message); - break; - - case LogLevel.Minimal: - _taskLogging.LogMessage(MessageImportance.High, message.Message); - break; - - case LogLevel.Information: - _taskLogging.LogMessage(MessageImportance.Normal, message.Message); - break; - - case LogLevel.Debug: - case LogLevel.Verbose: - default: - // Default to LogLevel.Debug and low importance - _taskLogging.LogMessage(MessageImportance.Low, message.Message); - break; - } - - return; - } - - private void LogMessage(IRestoreLogMessage logMessage, - MessageImportance importance, - LogMessageWithDetails logWithDetails, - LogMessageAsString logAsString) - { - if (logMessage.Code > NuGetLogCode.Undefined) - { - // NuGet does not currently have a subcategory while throwing logs, hence string.Empty - logWithDetails(string.Empty, - Enum.GetName(typeof(NuGetLogCode), logMessage.Code), - Enum.GetName(typeof(NuGetLogCode), logMessage.Code), - logMessage.FilePath, - logMessage.StartLineNumber, - logMessage.StartColumnNumber, - logMessage.EndLineNumber, - logMessage.EndColumnNumber, - importance, - logMessage.Message); - } - else - { - logAsString(importance, logMessage.Message); - } - } - - private void LogError(IRestoreLogMessage logMessage, - LogErrorWithDetails logWithDetails, - LogErrorAsString logAsString) - { - if (logMessage.Code > NuGetLogCode.Undefined) - { - // NuGet does not currently have a subcategory while throwing logs, hence string.Empty - logWithDetails(string.Empty, - Enum.GetName(typeof(NuGetLogCode), logMessage.Code), - Enum.GetName(typeof(NuGetLogCode), logMessage.Code), - logMessage.FilePath, - logMessage.StartLineNumber, - logMessage.StartColumnNumber, - logMessage.EndLineNumber, - logMessage.EndColumnNumber, - logMessage.Message); - } - else - { - logAsString(logMessage.Message); - } - } - - public override System.Threading.Tasks.Task LogAsync(ILogMessage message) - { - Log(message); - - return System.Threading.Tasks.Task.FromResult(0); - } - } -} diff --git a/build/tasks/RepoTasks.csproj b/build/tasks/RepoTasks.csproj index 20cbf6cce8..9410cf69cb 100644 --- a/build/tasks/RepoTasks.csproj +++ b/build/tasks/RepoTasks.csproj @@ -11,7 +11,6 @@ <PackageReference Include="NuGet.Build.Tasks" Version="$(NuGetInMSBuildVersion)" PrivateAssets="All" /> <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(DevDependency_MicrosoftExtensionsDependencyModelPackageVersion)" PrivateAssets="All" /> <PackageReference Include="WindowsAzure.Storage" Version="$(DevDependency_WindowsAzureStoragePackageVersion)" /> - <PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(DevDependency_MicrosoftDotNetBuildTasksFeedPackageVersion)" ExcludeAssets="Build" /> </ItemGroup> <Import Project="$(RepoTasksSdkPath)\Sdk.targets" Condition="'$(RepoTasksSdkPath)' != '' "/> diff --git a/build/tasks/RepoTasks.tasks b/build/tasks/RepoTasks.tasks index dfc02c5451..329bb5cd0a 100644 --- a/build/tasks/RepoTasks.tasks +++ b/build/tasks/RepoTasks.tasks @@ -3,8 +3,6 @@ <_RepoTaskAssembly>$(MSBuildThisFileDirectory)bin\publish\RepoTasks.dll</_RepoTaskAssembly> </PropertyGroup> - <UsingTask TaskName="RepoTasks.CheckExpectedPackagesExist" AssemblyFile="$(_RepoTaskAssembly)" /> - <UsingTask TaskName="RepoTasks.CheckVersionOverrides" AssemblyFile="$(_RepoTaskAssembly)" /> <UsingTask TaskName="RepoTasks.CreateLzma" AssemblyFile="$(_RepoTaskAssembly)" /> <UsingTask TaskName="RepoTasks.GenerateRestoreSourcesPropsFile" AssemblyFile="$(_RepoTaskAssembly)" /> <UsingTask TaskName="RepoTasks.GetDocXmlFiles" AssemblyFile="$(_RepoTaskAssembly)" /> @@ -12,15 +10,4 @@ <UsingTask TaskName="RepoTasks.OrderBy" AssemblyFile="$(_RepoTaskAssembly)" /> <UsingTask TaskName="RepoTasks.GenerateSharedFrameworkMetadataFiles" AssemblyFile="$(_RepoTaskAssembly)" /> <UsingTask TaskName="RepoTasks.PublishToAzureBlob" AssemblyFile="$(_RepoTaskAssembly)" /> - - <!-- tools from dotnet-buildtools --> - <PropertyGroup> - <NuGetPackagesPath>$(NUGET_PACKAGES)</NuGetPackagesPath> - <NuGetPackagesPath Condition=" '$(NuGetPackagesPath)' == '' AND '$(USERPROFILE)' != '' ">$(USERPROFILE)\.nuget\packages\</NuGetPackagesPath> - <NuGetPackagesPath Condition=" '$(NuGetPackagesPath)' == '' AND '$(HOME)' != '' ">$(HOME)\.nuget\packages\</NuGetPackagesPath> - <NuGetPackagesPath>$([MSBuild]::NormalizeDirectory($(NuGetPackagesPath)))</NuGetPackagesPath> - <_MicrosoftDotNetBuildTasksFeedTaskDir>$(NuGetPackagesPath)microsoft.dotnet.build.tasks.feed\$(DevDependency_MicrosoftDotNetBuildTasksFeedPackageVersion.ToLowerInvariant())\build\netstandard1.5\</_MicrosoftDotNetBuildTasksFeedTaskDir> - </PropertyGroup> - - <UsingTask TaskName="PushToBlobFeed" AssemblyFile="$(_MicrosoftDotNetBuildTasksFeedTaskDir)Microsoft.DotNet.Build.Tasks.Feed.dll"/> </Project> diff --git a/build/tasks/Utilities/RuntimeGraphManager.cs b/build/tasks/RuntimeGraphManager.cs index 82f373ef8d..82f373ef8d 100644 --- a/build/tasks/Utilities/RuntimeGraphManager.cs +++ b/build/tasks/RuntimeGraphManager.cs @@ -38,21 +38,6 @@ The path to the configuration file that stores values. Defaults to korebuild.jso .PARAMETER CI Sets up CI specific settings and variables. -.PARAMETER PackageVersionPropsUrl -(optional) the url of the package versions props path containing dependency versions. - -.PARAMETER AssetRootUrl -(optional) the base url for acquiring build assets from an orchestrated build - -.PARAMETER AccessTokenSuffix -(optional) the query string to append to any blob store access for PackageVersionPropsUrl, if any. - -.PARAMETER RestoreSources -(optional) Semi-colon delimited list of additional NuGet feeds to use as part of restore. - -.PARAMETER ProductBuildId -(optional) The product build ID for correlation with orchestrated builds. - .PARAMETER MSBuildArguments Additional MSBuild arguments to be passed through. @@ -90,11 +75,6 @@ param( [switch]$Reinstall, [string]$ConfigFile = $null, [switch]$CI, - [string]$PackageVersionPropsUrl = $null, - [string]$AccessTokenSuffix = $null, - [string]$RestoreSources = $null, - [string]$AssetRootUrl = $null, - [string]$ProductBuildId = $null, [Parameter(ValueFromRemainingArguments = $true)] [string[]]$MSBuildArguments ) @@ -213,30 +193,6 @@ if (!$LockFile) { $LockFile = Join-Path $Path 'korebuild-lock.txt' } if (!$Channel) { $Channel = 'master' } if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } -if ($PackageVersionPropsUrl) { - $IntermediateDir = Join-Path $PSScriptRoot 'obj' - $PropsFilePath = Join-Path $IntermediateDir 'external-dependencies.props' - New-Item -ItemType Directory $IntermediateDir -ErrorAction Ignore | Out-Null - Get-RemoteFile "${PackageVersionPropsUrl}${AccessTokenSuffix}" $PropsFilePath - $MSBuildArguments += "-p:DotNetPackageVersionPropsPath=$PropsFilePath" -} - -if ($RestoreSources) { - $MSBuildArguments += "-p:DotNetAdditionalRestoreSources=$RestoreSources" -} - -if ($AssetRootUrl) { - $MSBuildArguments += "-p:DotNetAssetRootUrl=$AssetRootUrl" -} - -if ($AccessTokenSuffix) { - $MSBuildArguments += "-p:DotNetAssetRootAccessTokenSuffix=$AccessTokenSuffix" -} - -if ($ProductBuildId) { - $MSBuildArguments += "-p:DotNetProductBuildId=$ProductBuildId" -} - # Execute $korebuildPath = Get-KoreBuild @@ -19,11 +19,6 @@ lockfile_path='' channel='' tools_source='' ci=false -package_version_props_url='' -asset_root_url='' -access_token_suffix='' -restore_sources='' -product_build_id='' msbuild_args=() # @@ -44,10 +39,6 @@ __usage() { echo " --path <PATH> The directory to build. Defaults to the directory containing the script." echo " --lockfile <PATH> The path to the korebuild-lock.txt file. Defaults to \$repo_path/korebuild-lock.txt" echo " -s|--tools-source|-ToolsSource <URL> The base url where build tools can be downloaded. Overrides the value from the config file." - echo " --package-version-props-url <URL> The url of the package versions props path containing dependency versions." - echo " --access-token <Token> The query string to append to any blob store access for PackageVersionPropsUrl, if any." - echo " --restore-sources <Sources> Semi-colon delimited list of additional NuGet feeds to use as part of restore." - echo " --product-build-id <ID> The product build ID for correlation with orchestrated builds." echo " -u|--update Update to the latest KoreBuild even if the lock file is present." echo " --reinstall Reinstall KoreBuild." echo " --ci Apply CI specific settings and environment variables." @@ -187,36 +178,6 @@ while [[ $# -gt 0 ]]; do tools_source="${1:-}" [ -z "$tools_source" ] && __error "Missing value for parameter --tools-source" && __usage ;; - --package-version-props-url|-PackageVersionPropsUrl) - shift - # This parameter can be an empty string, but it should be set - [ -z "${1+x}" ] && __error "Missing value for parameter --package-version-props-url" && __usage - package_version_props_url="$1" - ;; - --access-token-suffix|-AccessTokenSuffix) - shift - # This parameter can be an empty string, but it should be set - [ -z "${1+x}" ] && __error "Missing value for parameter --access-token-suffix" && __usage - access_token_suffix="$1" - ;; - --restore-sources|-RestoreSources) - shift - # This parameter can be an empty string, but it should be set - [ -z "${1+x}" ] && __error "Missing value for parameter --restore-sources" && __usage - restore_sources="$1" - ;; - --asset-root-url|-AssetRootUrl) - shift - # This parameter can be an empty string, but it should be set - [ -z "${1+x}" ] && __error "Missing value for parameter --asset-root-url" && __usage - asset_root_url="$1" - ;; - --product-build-id|-ProductBuildId) - shift - # This parameter can be an empty string, but it should be set - [ -z "${1+x}" ] && __error "Missing value for parameter --product-build-id" && __usage - product_build_id="$1" - ;; -u|--update|-Update) update=true ;; @@ -277,31 +238,6 @@ if [ -f "$config_file" ]; then fi [ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" - -if [ ! -z "$package_version_props_url" ]; then - intermediate_dir="$repo_path/obj" - props_file_path="$intermediate_dir/external-dependencies.props" - mkdir -p "$intermediate_dir" - __get_remote_file "$package_version_props_url" "$props_file_path" - msbuild_args[${#msbuild_args[*]}]="-p:DotNetPackageVersionPropsPath=$props_file_path" -fi - -if [ ! -z "$restore_sources" ]; then - msbuild_args[${#msbuild_args[*]}]="-p:DotNetAdditionalRestoreSources=$restore_sources" -fi - -if [ ! -z "$asset_root_url" ]; then - msbuild_args[${#msbuild_args[*]}]="-p:DotNetAssetRootUrl=$asset_root_url" -fi - -if [ ! -z "$access_token_suffix" ]; then - msbuild_args[${#msbuild_args[*]}]="-p:DotNetAssetRootAccessTokenSuffix=$access_token_suffix" -fi - -if [ ! -z "$product_build_id" ]; then - msbuild_args[${#msbuild_args[*]}]="-p:DotNetProductBuildId=$product_build_id" -fi - [ -z "$lockfile_path" ] && lockfile_path="$repo_path/korebuild-lock.txt" [ -z "$channel" ] && channel='master' [ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' diff --git a/src/Installers/Windows/build.ps1 b/src/Installers/Windows/build.ps1 index f8df1c7192..287bcdb243 100644 --- a/src/Installers/Windows/build.ps1 +++ b/src/Installers/Windows/build.ps1 @@ -15,9 +15,6 @@ param( [string]$BuildNumber = 't000', [switch]$IsFinalBuild, [string]$SignType = '', - [string]$PackageVersionPropsUrl = $null, - [string]$AccessTokenSuffix = $null, - [string]$AssetRootUrl = $null, [switch]$clean ) @@ -60,24 +57,6 @@ try { $msbuildArgs += '-t:Clean' } - if ($AssetRootUrl) { - $msbuildArgs += "-p:DotNetAssetRootUrl=$AssetRootUrl" - } - - if ($AccessTokenSuffix) { - $msbuildArgs += "-p:DotNetAccessTokenSuffix=$AccessTokenSuffix" - } - - if ($PackageVersionPropsUrl) { - $IntermediateDir = Join-Path $PSScriptRoot 'obj' - $PropsFilePath = Join-Path $IntermediateDir 'external-dependencies.props' - New-Item -ItemType Directory $IntermediateDir -ErrorAction Ignore | Out-Null - Get-RemoteFile "${PackageVersionPropsUrl}${AccessTokenSuffix}" $PropsFilePath - $msbuildArgs += "-p:DotNetPackageVersionPropsPath=$PropsFilePath" - } - - $msbuildArgs += '-t:Build' - Invoke-Block { & $msbuild ` WindowsInstallers.proj ` -restore ` @@ -92,6 +71,7 @@ try { "-p:SignType=$SignType" ` "-p:IsFinalBuild=$IsFinalBuild" ` "-bl:$repoRoot/artifacts/logs/installers.msbuild.binlog" ` + '-t:Build' ` @msbuildArgs } } |