Address build issues
This commit is contained in:
parent
ab1797cb29
commit
8eecff0112
7 changed files with 82 additions and 54 deletions
|
@ -15,20 +15,24 @@
|
|||
<MSBuild
|
||||
BuildInParallel="False"
|
||||
Projects="$(RepoRoot)/build/package/Microsoft.DotNet.Cli.Installer.DEB.proj"
|
||||
Properties="CliSdkRoot=$(Stage2Directory)/sdk;
|
||||
Properties="ArtifactNameWithVersionSdk=$(ArtifactNameWithVersionSdk);
|
||||
OSName=$(OSName);
|
||||
CLIBuildDll=$(CLIBuildDll);
|
||||
CliSdkRoot=$(Stage2Directory)/sdk;
|
||||
DownloadedSharedHostInstallerFile=$(DownloadedSharedHostInstallerFile);
|
||||
DownloadedHostFxrInstallerFile=$(DownloadedHostFxrInstallerFile);
|
||||
DownloadedSharedFrameworkInstallerFile=$(DownloadedSharedFrameworkInstallerFile);
|
||||
RepoRoot=$(RepoRoot);
|
||||
PackagesDirectory=$(PackagesDirectory);
|
||||
IntermediateDirectory=$(IntermediateDirectory);
|
||||
InstallerExtension=$(InstallerExtension);
|
||||
HostFxrVersion=$(HostFxrVersion);
|
||||
SdkVersion=$(SdkVersion);
|
||||
SharedFrameworkName=$(SharedFrameworkName);
|
||||
SharedFrameworkVersion=$(SharedFrameworkVersion);
|
||||
SharedFrameworkBrandName=$(SharedFrameworkBrandName);
|
||||
SdkBrandName=$(SdkBrandName);"
|
||||
ToolsVersion="4.0"
|
||||
UnloadProjectsOnCompletion="False"
|
||||
UseResultsCache="True">
|
||||
</MSBuild>
|
||||
SdkBrandName=$(SdkBrandName);
|
||||
ToolPath=$(Stage2Directory);"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="Package"
|
||||
|
|
|
@ -2,17 +2,26 @@
|
|||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
|
||||
DefaultTarget="GenerateDebs">
|
||||
|
||||
<PropertyGroup>
|
||||
<CLIBuildDll Condition=" '!Exists($(CLIBuildDll))' ">$([MSBuild]::Unescape($(CLIBuildDll)))</CLIBuildDll>
|
||||
</PropertyGroup>
|
||||
|
||||
<UsingTask TaskName="DotNetRestore" AssemblyFile="$(CLIBuildDll)" />
|
||||
<UsingTask TaskName="ReplaceFileContents" AssemblyFile="$(CLIBuildDll)" />
|
||||
<UsingTask TaskName="DotNetDebTool" AssemblyFile="$(CLIBuildDll)" />
|
||||
<UsingTask TaskName="DotNetTest" AssemblyFile="$(CLIBuildDll)" />
|
||||
|
||||
<Import Project="Microsoft.DotNet.Cli.Installer.DEB.props" />
|
||||
|
||||
<Target Name="GenerateDebs"
|
||||
DependsOnTargets="GenerateSdkDeb;
|
||||
DependsOnTargets="TestDebuild;
|
||||
GenerateSdkDeb;
|
||||
TestSdkDeb;"
|
||||
Condition=" '$(OSName)' == 'ubuntu' " />
|
||||
|
||||
<Target Name="GenerateSdkDeb"
|
||||
Condition=" '$(OSName)' == 'ubuntu' and '$(DebuildPresent)' == 'true' "
|
||||
DependsOnTargets="EnsureDebuild;
|
||||
PrepareDotnetDebDirectories;
|
||||
DependsOnTargets="PrepareDotnetDebDirectories;
|
||||
PrepareDotnetDebTool;"
|
||||
Inputs="@(SdkDebInputFiles)"
|
||||
Outputs="$(SdkInstallerFile)" >
|
||||
|
@ -24,35 +33,49 @@
|
|||
|
||||
<!-- Create layout -->
|
||||
<Copy
|
||||
DestinationFiles="@(SourceFile->'$(DebLayoutPackageRootDir)/%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
DestinationFiles="@(SdkDebInputFiles->'$(DebLayoutPackageRootDir)/sdk/%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
SourceFiles="@(SdkDebInputFiles)"
|
||||
OverwriteReadOnlyFiles="True"
|
||||
SkipUnchangedFiles="False"
|
||||
SourceFiles="@(SdkLayoutOutputDirectory)"
|
||||
UseHardlinksIfPossible="False">
|
||||
</Copy>
|
||||
|
||||
<Copy
|
||||
DestinationFiles="@(SourceFile->'$(DebLayoutDocsDir)/%(RecursiveDir)%(Filename)-$(SdkVersion)%(Extension)')"
|
||||
OverwriteReadOnlyFiles="True"
|
||||
SkipUnchangedFiles="False"
|
||||
DestinationFiles="@(SdkDebManPageFiles->'$(DebLayoutDocsDir)/%(RecursiveDir)%(Filename)-$(SdkVersion)%(Extension)')"
|
||||
SourceFiles="@(SdkDebManPageFiles)"
|
||||
UseHardlinksIfPossible="False">
|
||||
</Copy>
|
||||
|
||||
<Copy
|
||||
DestinationFiles="$(DotnetDebToolConfigJsonFilePath)"
|
||||
OverwriteReadOnlyFiles="True"
|
||||
SkipUnchangedFiles="False"
|
||||
SourceFiles="$(DotnetDebToolConfigJsonFilePath)"
|
||||
UseHardlinksIfPossible="False">
|
||||
</Copy>
|
||||
|
||||
<DotNetDebTool ToolPath="$(Stage2Directory)"
|
||||
InputDir="$(SdkLayoutDirectory)"
|
||||
OutputFile="$(SdkInstallerFile)"
|
||||
<ReplaceFileContents
|
||||
InputFile="$(DebianConfigTemplateFile)"
|
||||
DestinationFile="$(DebianConfigJsonFile)"
|
||||
ReplacementPatterns="@(SdkDebianPackageTemplateReplacement -> '%(Identity)')"
|
||||
ReplacementStrings="@(SdkDebianPackageTemplateReplacement -> '%(ReplacementString)')" />
|
||||
|
||||
<MakeDir Directories="$(DotNetDebToolOutputDirectory)" />
|
||||
|
||||
<DotNetDebTool ToolPath="$(ToolPath)"
|
||||
InputDir="$(SdkDebianLayoutOutputDirectory)"
|
||||
OutputFile="$(DotNetDebToolOutputDirectory)"
|
||||
PackageName="$(SdkDebianPackageName)"
|
||||
PackageVersion="$(SdkVersion)"
|
||||
WorkingDirectory="$(DotnetDebToolDir)" />
|
||||
|
||||
<!-- Copy package to output -->
|
||||
<ItemGroup>
|
||||
<GeneratedDebFiles Include="$(DotNetDebToolOutputDirectory)/*.deb" />
|
||||
</ItemGroup>
|
||||
|
||||
<Error Text="@(GeneratedDebFiles->Count()) .deb files generated." Condition="'@(GeneratedDebFiles->Count())' != 1" />
|
||||
|
||||
<Copy
|
||||
DestinationFiles="$(SdkInstallerFile)"
|
||||
SourceFiles="@(GeneratedDebFiles)"
|
||||
OverwriteReadOnlyFiles="True"
|
||||
SkipUnchangedFiles="False"
|
||||
UseHardlinksIfPossible="False" />
|
||||
|
||||
<!-- Remove Packages -->
|
||||
<Exec Command="sudo dpkg -r $(SdkDebianPackageName)" />
|
||||
|
@ -89,13 +112,6 @@
|
|||
</Target>
|
||||
|
||||
<Target Name="PrepareDotnetDebDirectories">
|
||||
<PropertyGroup>
|
||||
<DebLayoutPackageRootDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutPackageRootDirName)</DebLayoutPackageRootDir>
|
||||
<DebLayoutAbsolutePlacementDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutAbsolutePlacementDirName)</DebLayoutAbsolutePlacementDir>
|
||||
<DebLayoutSamplesDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutSamplesDirName)</DebLayoutSamplesDir>
|
||||
<DebLayoutDocsDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutDocsDirName)</DebLayoutDocsDir>
|
||||
<DebLayoutDebianFilesDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutDebianFilesDirName)</DebLayoutDebianFilesDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Clean the workspace -->
|
||||
<ItemGroup>
|
||||
|
@ -114,8 +130,8 @@
|
|||
$(DebLayoutDebianFilesDir)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Delete Condition=" 'Exists(%(SdkDebianFilesToClean))' " Files="@(SdkDebianFilesToClean)" />
|
||||
<RemoveDir Condition=" 'Exists(%(SdkDebianDirectoriesToClean))' " Directories="@(SdkDebianDirectoriesToClean)" />
|
||||
<Delete Files="@(SdkDebianFilesToClean)" />
|
||||
<RemoveDir Directories="@(SdkDebianDirectoriesToClean)" />
|
||||
<MakeDir Directories="@(SdkDebianDirectoriesToClean)" />
|
||||
<MakeDir Directories="@(SdkDebianLayoutSubDirectories)" />
|
||||
</Target>
|
||||
|
@ -124,26 +140,21 @@
|
|||
DependsOnTargets="WriteDotnetDebToolProjectJson;">
|
||||
|
||||
<DotNetRestore FallbackSource="$(DotnetDebToolPackageSource)"
|
||||
ToolPath="$(Stage2Directory)"
|
||||
ToolPath="$(ToolPath)"
|
||||
WorkingDirectory="$(DotnetDebToolDir)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="WriteDotnetDebToolProjectJson"
|
||||
Inputs="$(MSBuildThisFile);$(MSBuildThisFileDirectory)/Microsoft.DotNet.Cli.Installer.DEB.props"
|
||||
Outputs="$(DotnetDebToolDir)/project.json">
|
||||
<MakeDir Condition=" !Exists($(DotnetDebToolDir)) " Directories="$(DotnetDebToolDir)" />
|
||||
|
||||
<WriteLinesToFile File="$(DotnetDebToolDir)/project.json" Lines="@(DotnetDebToolProjectJsonLines)" />
|
||||
<WriteLinesToFile File="$(DotnetDebToolDir)/project.json"
|
||||
Lines="@(DotnetDebToolProjectJsonLines)"
|
||||
Overwrite="True" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UpdateDotnetDebConfigFile">
|
||||
<ReplaceFileContents
|
||||
InputFile="$(DotnetDebToolConfigJsonFilePath)"
|
||||
DestinationFile="$(DotnetDebToolConfigJsonFilePath)"
|
||||
ReplacementPatterns="@(SdkDebianPackageTemplateReplacement -> '%(Identity)')"
|
||||
ReplacementStrings="@(SdkDebianPackageTemplateReplacement -> '%(ReplacementString)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="EnsureDebuild">
|
||||
<Target Name="TestDebuild">
|
||||
<Exec Command="/usr/bin/env debuild -h" ContinueOnError="true">
|
||||
<Output TaskParameter="ExitCode" PropertyName="DebuildExitCode" />
|
||||
</Exec>
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<SdkDebInputFiles Include="$(SdkLayoutOutputDirectory)/**/*" />
|
||||
<SdkDebInputFiles Include="$(CliSdkRoot)/**/*" />
|
||||
<SdkDebManPageFiles Include="$(ManpagesDirectory)/**/*" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -59,9 +59,20 @@
|
|||
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
|
||||
|
||||
<SdkDebianIntermediateDirectory>$(IntermediateDirectory)/debian/sdk</SdkDebianIntermediateDirectory>
|
||||
<DotNetDebToolOutputDirectory>$(SdkDebianIntermediateDirectory)/deb-tool-output</DotNetDebToolOutputDirectory>
|
||||
<DebianTestResultsXmlFile>$(SdkDebianIntermediateDirectory)/debian-testResults.xml</DebianTestResultsXmlFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Layout Directories -->
|
||||
<PropertyGroup>
|
||||
<SdkDebianLayoutOutputDirectory>$(SdkDebianIntermediateDirectory)/debianLayoutDirectory</SdkDebianLayoutOutputDirectory>
|
||||
<DebLayoutPackageRootDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutPackageRootDirName)</DebLayoutPackageRootDir>
|
||||
<DebLayoutAbsolutePlacementDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutAbsolutePlacementDirName)</DebLayoutAbsolutePlacementDir>
|
||||
<DebLayoutSamplesDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutSamplesDirName)</DebLayoutSamplesDir>
|
||||
<DebLayoutDocsDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutDocsDirName)</DebLayoutDocsDir>
|
||||
<DebLayoutDebianFilesDir>$(SdkDebianLayoutOutputDirectory)/$(DebLayoutDebianFilesDirName)</DebLayoutDebianFilesDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- debian_config.json -->
|
||||
<PropertyGroup>
|
||||
<DebianConfigTemplateFileName>dotnet-debian_config.json</DebianConfigTemplateFileName>
|
||||
|
@ -71,22 +82,22 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<SdkDebianPackageTemplateReplacement Include="SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME">
|
||||
<SdkDebianPackageTemplateReplacement Include="%SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME%">
|
||||
<ReplacementString>$(SharedFrameworkDebianPackageName)</ReplacementString>
|
||||
</SdkDebianPackageTemplateReplacement>
|
||||
<SdkDebianPackageTemplateReplacement Include="SHARED_FRAMEWORK_NUGET_NAME">
|
||||
<SdkDebianPackageTemplateReplacement Include="%SHARED_FRAMEWORK_NUGET_NAME%">
|
||||
<ReplacementString>$(SharedFrameworkName)</ReplacementString>
|
||||
</SdkDebianPackageTemplateReplacement>
|
||||
<SdkDebianPackageTemplateReplacement Include="SHARED_FRAMEWORK_NUGET_VERSION">
|
||||
<SdkDebianPackageTemplateReplacement Include="%SHARED_FRAMEWORK_NUGET_VERSION%">
|
||||
<ReplacementString>$(SharedFrameworkVersion)</ReplacementString>
|
||||
</SdkDebianPackageTemplateReplacement>
|
||||
<SdkDebianPackageTemplateReplacement Include="SHARED_FRAMEWORK_BRAND_NAME">
|
||||
<SdkDebianPackageTemplateReplacement Include="%SHARED_FRAMEWORK_BRAND_NAME%">
|
||||
<ReplacementString>$(SharedFrameworkBrandName)</ReplacementString>
|
||||
</SdkDebianPackageTemplateReplacement>
|
||||
<SdkDebianPackageTemplateReplacement Include="SDK_NUGET_VERSION">
|
||||
<SdkDebianPackageTemplateReplacement Include="%SDK_NUGET_VERSION%">
|
||||
<ReplacementString>$(SdkVersion)</ReplacementString>
|
||||
</SdkDebianPackageTemplateReplacement>
|
||||
<SdkDebianPackageTemplateReplacement Include="CLI_SDK_BRAND_NAME">
|
||||
<SdkDebianPackageTemplateReplacement Include="%CLI_SDK_BRAND_NAME%">
|
||||
<ReplacementString>$(SdkBrandName)</ReplacementString>
|
||||
</SdkDebianPackageTemplateReplacement>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -15,6 +15,7 @@ using Microsoft.DotNet.Tools.Compiler;
|
|||
using Microsoft.DotNet.Tools.Compiler.Csc;
|
||||
using Microsoft.DotNet.Tools.Help;
|
||||
using Microsoft.DotNet.Tools.New;
|
||||
using Microsoft.DotNet.Tools.NuGet;
|
||||
using Microsoft.DotNet.Tools.Pack3;
|
||||
using Microsoft.DotNet.Tools.Publish;
|
||||
using Microsoft.DotNet.Tools.Restore;
|
||||
|
|
|
@ -9,7 +9,7 @@ using Microsoft.DotNet.Cli.Utils;
|
|||
using Microsoft.DotNet.InternalAbstractions;
|
||||
using Microsoft.DotNet.Tools;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Restore
|
||||
namespace Microsoft.DotNet.Tools.NuGet
|
||||
{
|
||||
public class NuGetCommand
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using Microsoft.DotNet.Cli;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.TestFramework;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
"Microsoft.DotNet.Tools.Tests.Utilities": {
|
||||
"target": "project"
|
||||
},
|
||||
"xunit": "2.1.0",
|
||||
"moq.netcore": "4.4.0-beta8",
|
||||
"dotnet-test-xunit": "1.0.0-rc2-192208-24"
|
||||
"xunit": "2.2.0-beta3-build3330",
|
||||
"dotnet-test-xunit": "1.0.0-rc2-330423-54",
|
||||
"moq.netcore": "4.4.0-beta8"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {
|
||||
|
|
Loading…
Add table
Reference in a new issue