change to properties, artifact names

This commit is contained in:
Bryan Thornbury 2016-06-27 18:26:57 -07:00
parent 0d37da4d0d
commit fa97921a4d
23 changed files with 698 additions and 87 deletions

View file

@ -5,6 +5,7 @@
<clear />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="cli-deps" value="https://dotnet.myget.org/F/cli-deps/api/v3/index.json" />
<add key="buildtools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>

View file

@ -26,13 +26,21 @@
</PropertyGroup>
<ItemGroup>
<DotnetCliBuildFrameworkInputs Include="build_projects/**/*.cs" />
<DotnetCliBuildFrameworkInputs Include="build_projects/**/*.json" />
<DotnetCliBuildFrameworkInputs Include="build_projects/**/*.cs" Exclude="build_projects/**/obj/**/*.cs" />
<DotnetCliBuildFrameworkInputs Include="build_projects/**/project.json;build_projects/**/project.lock.json" />
</ItemGroup>
<!-- Workaround to "Native image cannot be loaded multiple times" issue
A target in the top level file needs to run and invoke a task
https://github.com/Microsoft/msbuild/issues/750 -->
<Target Name="MSBuildWorkaroundTarget">
<Message Text="Dont remove this target" />
</Target>
<Target Name="BuildDotnetCliBuildFramework"
Inputs="@(DotnetCliBuildFrameworkInputs)"
Outputs="$(CLIBuildDll)">
Outputs="$(CLIBuildDll)"
DependsOnTargets="MSBuildWorkaroundTarget">
<Exec Command="$(PlatformScriptHost) $(MSBuildThisFileDirectory)/build_projects/dotnet-cli-build/build$(PlatformScriptExtension) $(NoRunArg)" WorkingDirectory="$(MSBuildThisFileDirectory)"/>
</Target>
@ -40,7 +48,6 @@
<UsingTask TaskName="CompileTargets" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="TestTargets" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="PackageTargets" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="PublishTargets" AssemblyFile="$(CLIBuildDll)" />
<Target DependsOnTargets="BuildDotnetCliBuildFramework" Name="Compile">
@ -51,13 +58,10 @@
<TestTargets />
</Target>
<Target DependsOnTargets="BuildDotnetCliBuildFramework" Name="Package">
<PackageTargets />
</Target>
<Target DependsOnTargets="BuildDotnetCliBuildFramework" Name="Publish">
<PublishTargets />
</Target>
<Import Project="build/Microsoft.DotNet.Cli.Prepare.targets" />
</Project>
<Import Project="build/Microsoft.DotNet.Cli.Package.targets" />
</Project>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Layout" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)/package/Microsoft.DotNet.Cli.Layout.targets" />
<Import Project="$(MSBuildThisFileDirectory)/package/Microsoft.DotNet.Cli.Archive.targets" />
<Import Project="$(MSBuildThisFileDirectory)/package/Microsoft.DotNet.Cli.Nupkg.targets" />
<Import Project="$(MSBuildThisFileDirectory)/package/Microsoft.DotNet.Cli.Installer.DEB.targets" />
<Import Project="$(MSBuildThisFileDirectory)/package/Microsoft.DotNet.Cli.Installer.MSI.targets" />
<Import Project="$(MSBuildThisFileDirectory)/package/Microsoft.DotNet.Cli.Installer.PKG.targets" />
<Target Name="GenerateInstallers"
DependsOnTargets="Init;Layout;GeneratePkgs;GenerateDebs;GenerateMsis" />
<Target Name="Package"
DependsOnTargets="BuildDotnetCliBuildFramework;
Init;
Layout;
GenerateNugetPackages;
GenerateArchives;
GenerateInstallers" />
</Project>

View file

@ -25,6 +25,7 @@
<Stage2CompilationDirectory>$(BaseOutputDirectory)/stage2compilation</Stage2CompilationDirectory>
<IntermediateDirectory>$(BaseOutputDirectory)/intermediate</IntermediateDirectory>
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>
<SymbolsOutputDirectory>$(BaseOutputDirectory)/stage2symbols</SymbolsOutputDirectory>
</PropertyGroup>
<GenerateBuildVersionInfo RepoRoot="$(RepoRoot)">
@ -46,6 +47,10 @@
<PropertyGroup>
<VersionBadge>$(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg</VersionBadge>
<SdkVersion>$(NugetVersion)</SdkVersion>
<SdkProjectJsonVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-preview3-$(CommitCount)</SdkProjectJsonVersion>
<ProjectModelProjectJsonVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-rc4-$(CommitCount)</ProjectModelProjectJsonVersion>
<DependencyModelAndInternalAbstractionsProjectJsonVersion>$(VersionMajor).$(VersionMinor).1-beta-$(CommitCount)</DependencyModelAndInternalAbstractionsProjectJsonVersion>
<ArchiveExtension Condition=" '$(OSName)' == 'win' ">.zip</ArchiveExtension>
<ArchiveExtension Condition=" '$(OSName)' != 'win' ">.tar.gz</ArchiveExtension>
@ -61,18 +66,15 @@
<ProductMonikerRid Condition=" '$(Rid)' == 'ubuntu.16.04-x64' Or '$(Rid)' == 'fedora.23-x64' Or '$(Rid)' == 'opensuse.13.2-x64' ">$(Rid)</ProductMonikerRid>
<ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(OSName)-$(Architecture)</ProductMonikerRid>
<!-- Generated Installers + Archives -->
<SdkCompressedFile>$(PackagesDirectory)/dotnet-sdk-$(ProductMonikerRid).$(SdkVersion)$(ArchiveExtension)</SdkCompressedFile>
<SdkInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/dotnet-sdk-$(ProductMonikerRid).$(SdkVersion)$(InstallerExtension)</SdkInstallerFile>
<ArtifactNameSdk>dotnet-sdk</ArtifactNameSdk>
<ArtifactNameSdkDebug>dotnet-sdk-debug</ArtifactNameSdkDebug>
<ArtifactNameCombinedHostHostFxrFrameworkSdk>dotnet-dev</ArtifactNameCombinedHostHostFxrFrameworkSdk>
<ArtifactNameCombinedFrameworkSdk>dotnet-sharedframework-sdk</ArtifactNameCombinedFrameworkSdk>
<CombinedFrameworkSDKHostCompressedFile>$(PackagesDirectory)/dotnet-dev-$(ProductMonikerRid).$(SdkVersion)$(ArchiveExtension)</CombinedFrameworkSDKHostCompressedFile>
<CombinedFrameworkSDKHostInstallerFile Condition=" '$(BundleExtension)' != '' ">$(PackagesDirectory)/dotnet-dev-$(ProductMonikerRid).$(SdkVersion)$(BundleExtension)</CombinedFrameworkSDKHostInstallerFile>
<CombinedFrameworkSDKCompressedFile>$(PackagesDirectory)/dotnet-sharedframework-sdk-$(ProductMonikerRid).$(SdkVersion)$(ArchiveExtension)</CombinedFrameworkSDKCompressedFile>
<CombinedFrameworkSDKInstallerFile Condition=" '$(BundleExtension)' != '' ">$(PackagesDirectory)/dotnet-sharedframework-sdk-$(ProductMonikerRid).$(SdkVersion)$(BundleExtension)</CombinedFrameworkSDKInstallerFile>
<SdkSymbolsCompressedFile>$(PackagesDirectory)/dotnet-sdk-debug-$(ProductMonikerRid).$(SdkVersion)$(ArchiveExtension)</SdkSymbolsCompressedFile>
<SdkSymbolsInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/dotnet-sdk-debug-$(ProductMonikerRid).$(SdkVersion)$(InstallerExtension)</SdkSymbolsInstallerFile>
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionSdk>
<ArtifactNameWithVersionSdkDebug>$(ArtifactNameSdkDebug)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionSdkDebug>
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
<ArtifactNameWithVersionCombinedFrameworkSdk>$(ArtifactNameCombinedFrameworkSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionCombinedFrameworkSdk>
<!-- Downloaded Installers + Archives -->
<SharedHostCompressedFile>$(PackagesDirectory)/dotnet-host-$(ProductMonikerRid).$(SharedHostVersion)$(ArchiveExtension)</SharedHostCompressedFile>

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Layout" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="ArchiveDirectory" AssemblyFile="$(CLIBuildDll)" />
<Target Name="SetupGenerateArchivesInputsOutputs" DependsOnTargets="Init">
<PropertyGroup>
<ArchiveOutputDirectory>$(PackagesDirectory)</ArchiveOutputDirectory>
</PropertyGroup>
<ItemGroup>
<GeneratedArchives Include="$(ArchiveOutputDirectory)/%(LayoutDefinition.NameWithVersion)$(ArchiveExtension)" />
</ItemGroup>
</Target>
<Target Name="GenerateArchives"
DependsOnTargets="Init;Layout;SetupGenerateArchivesInputsOutputs"
Inputs="@(LayoutDefinition -> '$(LayoutDirectory)/%(Name)')"
Outputs="@(GeneratedArchives -> '%(Identity)')">
<ArchiveDirectory
FileName="%(LayoutDefinition.NameWithVersion)"
OutputDirectory="$(ArchiveOutputDirectory)"
InputDirectory="$(LayoutDirectory)/%(LayoutDefinition.Name)" >
<Output TaskParameter="OutputArchive"
ItemName="Archives" />
</ArchiveDirectory>
</Target>
</Project>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="DebTargets" AssemblyFile="$(CLIBuildDll)" />
<Target Name="GenerateDebs" >
<DebTargets />
</Target>
</Project>

View file

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="DownloadFile" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="DecompressZip" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="GenerateGuidFromName" AssemblyFile="$(CLIBuildDll)" />
<Target Name="MsiTargetsSetupInputOutputs" DependsOnTargets="Init">
<!-- AcquireWix Properties -->
<PropertyGroup>
<WixVersion>3.10.2</WixVersion>
<WixDownloadUrl>https://dotnetcli.blob.core.windows.net/build/wix/wix.$(WixVersion).zip</WixDownloadUrl>
<WixRoot>$(IntermediateDirectory)/WixTools/$(WixVersion)</WixRoot>
<WixDestinationPath>$(WixRoot)/WixTools.$(WixVersion).zip</WixDestinationPath>
<WixDownloadSentinel>$(WixRoot)/WixDownload.$(WixVersion).sentinel</WixDownloadSentinel>
</PropertyGroup>
<!-- Generate MSI/Bundle Properties -->
<PropertyGroup>
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
<CombinedFrameworkSdkHostBundleEngineName>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)-engine.exe</CombinedFrameworkSdkHostBundleEngineName>
<SdkGenerateMsiPowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatemsi.ps1</SdkGenerateMsiPowershellScript>
<SdkGenerateBundlePowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatebundle.ps1</SdkGenerateBundlePowershellScript>
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
<CombinedFrameworkSdkHostInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostInstallerFile>
<!-- Rename is intentional to reduce confusion over generated vs downloaded msi's -->
<DownloadedSharedFrameworkInstallerFile>$(SharedFrameworkInstallerFile)</DownloadedSharedFrameworkInstallerFile>
<DownloadedHostFxrInstallerFile>$(HostFxrInstallerFile)</DownloadedHostFxrInstallerFile>
<DownloadedSharedHostInstallerFile>$(SharedHostInstallerFile)</DownloadedSharedHostInstallerFile>
</PropertyGroup>
<!-- Consumed By Publish -->
<ItemGroup>
<GeneratedInstallers Include="$(SdkInstallerFile);$(CombinedFrameworkSdkHostInstallerFile)" />
</ItemGroup>
<GenerateGuidFromName Name="$(SdkInstallerFile)">
<Output TaskParameter="OutputGuid"
PropertyName="SdkInstallerUpgradeCode" />
</GenerateGuidFromName>
<GenerateGuidFromName Name="$(CombinedFrameworkSdkHostInstallerFile)">
<Output TaskParameter="OutputGuid"
PropertyName="CombinedFrameworkSDKHostInstallerUpgradeCode" />
</GenerateGuidFromName>
<!-- Test Sdk MSI Properties -->
<PropertyGroup>
<SdkTestMsiPowershellScript>$(RepoRoot)/test/Installer/testmsi.ps1</SdkTestMsiPowershellScript>
<SdkMsiTestedSentinel>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk).MsiTested.sentinel</SdkMsiTestedSentinel>
</PropertyGroup>
</Target>
<Target Name="AcquireWix"
DependsOnTargets="Init;MsiTargetsSetupInputOutputs"
Inputs="$(WixDownloadSentinel)"
Outputs="$(WixDestinationPath)">
<!-- Setup sentinel to take advantage of incrementality -->
<MakeDir Directories="$(WixRoot)" />
<WriteLinesToFile
File="$(WixDownloadSentinel)"
Lines="$(WixVersion)"
Overwrite="true"
Encoding="Unicode"/>
<DownloadFile
Uri="$(WixDownloadUrl)"
DestinationPath="$(WixDestinationPath)"
Overwrite="false" />
<DecompressZip
InputZip="$(WixDestinationPath)"
DestinationDirectory="$(WixRoot)" />
</Target>
<Target Name="GenerateSdkMsi"
DependsOnTargets="Init;Layout;AcquireWix;MsiTargetsSetupInputOutputs"
Condition=" '$(OS)' == 'Windows_NT'"
Inputs="$(SdkLayoutOutputDirectory);
$(SdkGenerateMsiPowershellScript)"
Outputs="$(SdkInstallerFile)">
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateMsiPowershellScript)
'$(SdkLayoutOutputDirectory)'
'$(SdkInstallerFile)'
'$(WixRoot)'
'$(SdkBrandName)'
'$(MsiVersion)'
'$(SimpleVersion)'
'$(NugetVersion)'
'$(SdkInstallerUpgradeCode)'
'$(Architecture)'" />
</Target>
<Target Name="GenerateSdkBundle"
DependsOnTargets="Init;Layout;AcquireWix;MsiTargetsSetupInputOutputs;GenerateSdkMsi"
Condition=" '$(OS)' == 'Windows_NT'"
Inputs="$(SdkInstallerFile);
$(DownloadedSharedFrameworkInstallerFile);
$(DownloadedHostFxrInstallerFile);
$(DownloadedSharedHostInstallerFile);
$(SdkGenerateBundlePowershellScript)"
Outputs="$(CombinedFrameworkSdkHostInstallerFile)">
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateBundlePowershellScript)
'$(SdkInstallerFile)'
'$(DownloadedSharedFrameworkInstallerFile)'
'$(DownloadedHostFxrInstallerFile)'
'$(DownloadedSharedHostInstallerFile)'
'$(CombinedFrameworkSdkHostInstallerFile)'
'$(WixRoot)'
'$(SdkBrandName)'
'$(MsiVersion)'
'$(SimpleVersion)'
'$(NugetVersion)'
'$(CombinedFrameworkSDKHostInstallerUpgradeCode)'
'$(Architecture)'" />
</Target>
<Target Name="TestSdkMsi"
Inputs="$(SdkInstallerFile)"
Outputs="$(SdkMsiTestedSentinel)"
DependsOnTargets="Init;MsiTargetsSetupInputOutputs;GenerateSdkMsi"
Condition=" '$(OS)' == 'Windows_NT'" >
<Exec Command ="powershell -NoProfile -NoLogo $(SdkTestMsiPowershellScript)
-InputMsi '$(SdkInstallerFile)'
-DotnetDir '$(OutputDirectory)'" />
<WriteLinesToFile
File="$(SdkMsiTestedSentinel)"
Lines="$(SdkVersion)"
Overwrite="true"
Encoding="Unicode"/>
</Target>
<Target Name="GenerateMsis"
DependsOnTargets="Init;
Layout;
MsiTargetsSetupInputOutputs;
AcquireWix;
GenerateSdkMsi;
GenerateSdkBundle;
TestSdkMsi"
Condition=" '$(OS)' == 'Windows_NT'" />
<!-- These targets are used in signing, don't remove them! -->
<Target Name="ExtractEngineFromSdkBundle">
<Exec Command="$(WixRoot)/insignia.exe
-ib $(CombinedFrameworkSdkHostInstallerFile)
-o $(CombinedFrameworkSdkHostBundleEngineName)" />
</Target>
<Target Name="ReattachEngineToSdkBundle">
<Exec Command="$(WixRoot)/insignia.exe
-ab $(CombinedFrameworkSdkHostInstallerFile)
-o $(CombinedFrameworkSdkHostBundleEngineName)" />
</Target>
</Project>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="PkgTargets" AssemblyFile="$(CLIBuildDll)" />
<Target Name="GeneratePkgs" >
<PkgTargets />
</Target>
</Project>

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target DependsOnTargets="Init" Name="SetupLayoutInputsOutputs" >
<PropertyGroup>
<LayoutDirectory>$(IntermediateDirectory)/layouts</LayoutDirectory>
</PropertyGroup>
<!-- Set up Items with Layout Input Files -->
<ItemGroup>
<SdkLayoutInput Include="$(OutputDirectory)/sdk/**/*" />
<SdkDebugLayoutInput Include="$(SymbolsOutputDirectory)/sdk/**/*.pdb" />
<CombinedHostHostFxrFrameworkSdkInput Include="$(OutputDirectory)/**" />
<CombinedFrameworkSdkInput Include="$(OutputDirectory)/shared/**/*" />
<CombinedFrameworkSdkInput Include="$(OutputDirectory)/sdk/**/*" />
</ItemGroup>
<PropertyGroup>
<SdkLayoutOutputDirectory>$(LayoutDirectory)/$(ArtifactNameSdk)</SdkLayoutOutputDirectory>
<SdkDebugLayoutOutputDirectory>$(LayoutDirectory)/$(ArtifactNameSdkDebug)</SdkDebugLayoutOutputDirectory>
<CombinedHostHostFxrFrameworkSdkOutputDirectory>$(LayoutDirectory)/$(ArtifactNameCombinedHostHostFxrFrameworkSdk)</CombinedHostHostFxrFrameworkSdkOutputDirectory>
<CombinedFrameworkSdkOutputDirectory>$(LayoutDirectory)/$(ArtifactNameCombinedFrameworkSdk)</CombinedFrameworkSdkOutputDirectory>
</PropertyGroup>
<!-- Set up Items Defining Layouts for easy change -->
<ItemGroup>
<LayoutDefinition Include="SdkName">
<InputFiles>@(SdkLayoutInput)</InputFiles>
<OutputFiles>@(SdkLayoutInput -> '$(SdkLayoutOutputDirectory)/$([MSBuild]::MakeRelative($(OutputDirectory), '%(Identity)'))')</OutputFiles>
<NameWithVersion>$(ArtifactNameWithVersionSdk)</NameWithVersion>
<Name>$(ArtifactNameSdk)</Name>
</LayoutDefinition>
<LayoutDefinition Include="SdkDebug">
<InputFiles>@(SdkDebugLayoutInput)</InputFiles>
<OutputFiles>@(SdkDebugLayoutInput -> '$(SdkDebugLayoutOutputDirectory)/$([MSBuild]::MakeRelative($(SymbolsOutputDirectory), '%(Identity)'))')</OutputFiles>
<NameWithVersion>$(ArtifactNameWithVersionSdkDebug)</NameWithVersion>
<Name>$(ArtifactNameSdkDebug)</Name>
</LayoutDefinition>
<LayoutDefinition Include="CombinedHostHostFxrFrameworkSdk">
<InputFiles>@(CombinedHostHostFxrFrameworkSdkInput)</InputFiles>
<OutputFiles>@(CombinedHostHostFxrFrameworkSdkInput -> '$(CombinedHostHostFxrFrameworkSdkOutputDirectory)/$([MSBuild]::MakeRelative($(OutputDirectory), '%(Identity)'))')</OutputFiles>
<NameWithVersion>$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)</NameWithVersion>
<Name>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)</Name>
</LayoutDefinition>
<LayoutDefinition Include="CombinedFrameworkSdk">
<InputFiles>@(CombinedFrameworkSdkInput)</InputFiles>
<OutputFiles>@(CombinedFrameworkSdkInput -> '$(CombinedFrameworkSdkOutputDirectory)/$([MSBuild]::MakeRelative($(OutputDirectory), '%(Identity)'))')</OutputFiles>
<NameWithVersion>$(ArtifactNameWithVersionCombinedFrameworkSdk)</NameWithVersion>
<Name>$(ArtifactNameCombinedFrameworkSdk)</Name>
</LayoutDefinition>
</ItemGroup>
</Target>
<Target Name="Layout"
DependsOnTargets="Init;SetupLayoutInputsOutputs"
Inputs="@(LayoutDefinition -> '%(InputFiles)')"
Outputs="@(LayoutDefinition -> '%(OutputFiles)')" >
<!-- Copy Files to layout directories based on defintiions -->
<Copy SourceFiles="%(LayoutDefinition.InputFiles)"
DestinationFiles="%(LayoutDefinition.OutputFiles)"
SkipUnchangedFiles="true" />
</Target>
</Project>

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Layout" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="SetupGenerateNugetPackagesInputsOutputs"
DependsOnTargets="Init">
<PropertyGroup>
<NupkgVersionSuffix>$(CommitCount)</NupkgVersionSuffix>
<ProjectsSrcDirectory>$(RepoRoot)/src</ProjectsSrcDirectory>
<PackagingBuildBasePath>$(Stage2CompilationDirectory)/forPackaging</PackagingBuildBasePath>
<NupkgOutputDirectory>$(PackagesDirectory)</NupkgOutputDirectory>
</PropertyGroup>
<ItemGroup>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.Cli.Utils" >
<ProjectName>Microsoft.DotNet.Cli.Utils</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.Compiler.Common">
<ProjectName>Microsoft.DotNet.Compiler.Common</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.Files">
<ProjectName>Microsoft.DotNet.Files</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.InternalAbstractions">
<ProjectName>Microsoft.DotNet.InternalAbstractions</ProjectName>
<Version>$(DependencyModelAndInternalAbstractionsProjectJsonVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.ProjectModel">
<ProjectName>Microsoft.DotNet.ProjectModel</ProjectName>
<Version>$(ProjectModelProjectJsonVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.ProjectModel.Loader">
<ProjectName>Microsoft.DotNet.ProjectModel.Loader</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.ProjectModel.Workspaces">
<ProjectName>Microsoft.DotNet.ProjectModel.Workspaces</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.Extensions.DependencyModel">
<ProjectName>Microsoft.Extensions.DependencyModel</ProjectName>
<Version>$(DependencyModelAndInternalAbstractionsProjectJsonVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.Extensions.Testing.Abstractions">
<ProjectName>Microsoft.Extensions.Testing.Abstractions</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
</ProjectsToPack>
<ProjectPackTargetInputs Include="$(PackagingBuildBasePath)/src/%(ProjectsToPack.ProjectName)/**/netstandard*/%(ProjectName).dll" />
<ProjectPackTargetOutputs Include="$(NupkgOutputDirectory)/%(ProjectsToPack.ProjectName).%(ProjectsToPack.Version).nupkg" />
</ItemGroup>
</Target>
<Target Name="GenerateNugetPackages"
DependsOnTargets="SetupGenerateNugetPackagesInputsOutputs"
Inputs="@(ProjectPackTargetInputs -> '%(Identity)')"
Outputs="@(ProjectPackTargetOutputs -> '%(Identity)')">
<Exec Command="dotnet pack %(ProjectsToPack.Identity)
--no-build
--build-base-path $(PackagingBuildBasePath)
--output $(NupkgOutputDirectory)
--configuration $(Configuration)
--version-suffix $(NupkgVersionSuffix)" />
</Target>
</Project>

View file

@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using Microsoft.Build.Utilities;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
namespace Microsoft.DotNet.Cli.Build
{
public class ArchiveDirectory : Task
{
[Required]
public string FileName { get; set; }
[Required]
public string OutputDirectory { get; set; }
[Required]
public string InputDirectory { get; set; }
[Output]
public string OutputArchive { get; set; }
public override bool Execute()
{
if (!Directory.Exists(InputDirectory))
{
return true;
}
if (CurrentPlatform.IsPlatform(BuildPlatform.Windows))
{
OutputArchive = GenerateZip();
}
else
{
OutputArchive = GenerateTarGz();
}
return true;
}
public string GenerateZip()
{
var extension = ".zip";
var outFile = Path.Combine(OutputDirectory, FileName + extension);
CreateZipFromDirectory(InputDirectory, outFile);
return outFile;
}
public string GenerateTarGz()
{
var extension = ".tar.gz";
var outFile = Path.Combine(OutputDirectory, FileName + extension);
CreateTarGzFromDirectory(InputDirectory, outFile);
return outFile;
}
private static void CreateZipFromDirectory(string directory, string outputArchivePath)
{
FS.Mkdirp(Path.GetDirectoryName(outputArchivePath));
if (File.Exists(outputArchivePath))
{
File.Delete(outputArchivePath);
}
ZipFile.CreateFromDirectory(directory, outputArchivePath, CompressionLevel.Optimal, false);
}
private static void CreateTarGzFromDirectory(string directory, string outputArchivePath)
{
FS.Mkdirp(Path.GetDirectoryName(outputArchivePath));
if (File.Exists(outputArchivePath))
{
File.Delete(outputArchivePath);
}
Cmd("tar", "-czf", outputArchivePath, "-C", directory, ".")
.Execute()
.EnsureSuccessful();
}
}
}

View file

@ -7,15 +7,25 @@ using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.DotNet.InternalAbstractions;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using Microsoft.Build.Utilities;
namespace Microsoft.DotNet.Cli.Build
{
public class DebTargets
public class DebTargets : Task
{
public override bool Execute()
{
BuildContext context = new BuildSetup("MSBuild").UseAllTargetsFromAssembly<DebTargets>().CreateBuildContext();
BuildTargetContext c = new BuildTargetContext(context, null, null);
return GenerateDebs(c).Success;
}
public static BuildTargetResult GenerateDebs(BuildTargetContext c)
{
if (CurrentPlatform.IsPlatform(BuildPlatform.Ubuntu))
{
PrepareTargets.Init(c);
GenerateSdkDeb(c);
}

View file

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using System.Net.Http;
using Microsoft.Build.Utilities;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
namespace Microsoft.DotNet.Cli.Build
{
public class DecompressZip : Task
{
[Required]
public string InputZip { get; set; }
[Required]
public string DestinationDirectory { get; set; }
public override bool Execute()
{
FS.Mkdirp(DestinationDirectory);
ZipFile.ExtractToDirectory(InputZip, DestinationDirectory);
return true;
}
}
}

View file

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using System.Net.Http;
using Microsoft.Build.Utilities;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
namespace Microsoft.DotNet.Cli.Build
{
public class DownloadFile : Task
{
[Required]
public string Uri { get; set; }
[Required]
public string DestinationPath { get; set; }
public bool Overwrite { get; set; }
public override bool Execute()
{
FS.Mkdirp(Path.GetDirectoryName(DestinationPath));
if (File.Exists(DestinationPath) && !Overwrite)
{
return true;
}
using (var httpClient = new HttpClient())
{
var getTask = httpClient.GetStreamAsync(Uri);
using (var outStream = File.Create(DestinationPath))
{
getTask.Result.CopyTo(outStream);
}
}
return true;
}
}
}

View file

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using System.Net.Http;
using Microsoft.Build.Utilities;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.Security.Cryptography;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
namespace Microsoft.DotNet.Cli.Build
{
public class GenerateGuidFromName : Task
{
[Required]
public string Name { get; set; }
[Output]
public string OutputGuid { get; set; }
public override bool Execute()
{
OutputGuid = GenerateGuid(Name).ToString();
return true;
}
public static Guid GenerateGuid(string name)
{
// Any fixed GUID will do for a namespace.
Guid namespaceId = new Guid("28F1468D-672B-489A-8E0C-7C5B3030630C");
using (SHA1 hasher = SHA1.Create())
{
var nameBytes = System.Text.Encoding.UTF8.GetBytes(name ?? string.Empty);
var namespaceBytes = namespaceId.ToByteArray();
SwapGuidByteOrder(namespaceBytes);
var streamToHash = new byte[namespaceBytes.Length + nameBytes.Length];
Array.Copy(namespaceBytes, streamToHash, namespaceBytes.Length);
Array.Copy(nameBytes, 0, streamToHash, namespaceBytes.Length, nameBytes.Length);
var hashResult = hasher.ComputeHash(streamToHash);
var res = new byte[16];
Array.Copy(hashResult, res, res.Length);
unchecked { res[6] = (byte)(0x50 | (res[6] & 0x0F)); }
unchecked { res[8] = (byte)(0x40 | (res[8] & 0x3F)); }
SwapGuidByteOrder(res);
return new Guid(res);
}
}
// Do a byte order swap, .NET GUIDs store multi byte components in little
// endian.
private static void SwapGuidByteOrder(byte[] b)
{
Swap(b, 0, 3);
Swap(b, 1, 2);
Swap(b, 5, 6);
Swap(b, 7, 8);
}
private static void Swap(byte[] b, int x, int y)
{
byte t = b[x];
b[x] = b[y];
b[y] = t;
}
}
}

View file

@ -114,7 +114,7 @@ namespace Microsoft.DotNet.Cli.Build
if (CurrentPlatform.IsPlatform(BuildPlatform.Windows))
{
var cliSdkRoot = c.BuildContext.Get<string>("CLISDKRoot");
var upgradeCode = Utils.GenerateGuidFromName(SdkMsi).ToString().ToUpper();
var upgradeCode = GenerateGuidFromName.GenerateGuid(SdkMsi).ToString().ToUpper();
var cliSdkBrandName = $"'{Monikers.CLISdkBrandName}'";
Cmd("powershell", "-NoProfile", "-NoLogo",
@ -131,7 +131,7 @@ namespace Microsoft.DotNet.Cli.Build
{
if (CurrentPlatform.IsPlatform(BuildPlatform.Windows))
{
var upgradeCode = Utils.GenerateGuidFromName(SdkBundle).ToString().ToUpper();
var upgradeCode = GenerateGuidFromName.GenerateGuid(SdkBundle).ToString().ToUpper();
var cliSdkBrandName = $"'{Monikers.CLISdkBrandName}'";
Cmd("powershell", "-NoProfile", "-NoLogo",

View file

@ -7,10 +7,11 @@ using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.DotNet.InternalAbstractions;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using Microsoft.Build.Utilities;
namespace Microsoft.DotNet.Cli.Build
{
public class PkgTargets
public class PkgTargets : Task
{
public static string PkgsIntermediateDir { get; set; }
public static string SharedHostComponentId { get; set; }
@ -45,10 +46,19 @@ namespace Microsoft.DotNet.Cli.Build
return c.Success();
}
public override bool Execute()
{
BuildContext context = new BuildSetup("MSBuild").UseAllTargetsFromAssembly<DebTargets>().CreateBuildContext();
BuildTargetContext c = new BuildTargetContext(context, null, null);
return GeneratePkgs(c).Success;
}
public static BuildTargetResult GeneratePkgs(BuildTargetContext c)
{
if (CurrentPlatform.IsPlatform(BuildPlatform.OSX))
{
PrepareTargets.Init(c);
InitPkg(c);
GenerateCLISdkProductArchive(c);
}

View file

@ -30,7 +30,7 @@ namespace Microsoft.DotNet.Cli.Build
// "dotnet-compile-fsc.Tests",
"dotnet-new.Tests",
"dotnet-pack.Tests",
"dotnet-projectmodel-server.Tests",
//"dotnet-projectmodel-server.Tests",
"dotnet-publish.Tests",
"dotnet-resgen.Tests",
"dotnet-run.Tests",

View file

@ -22,8 +22,8 @@
"System.Xml.XmlSerializer": "4.0.11",
"WindowsAzure.Storage": "6.2.2-preview",
"NuGet.CommandLine.XPlat": "3.5.0-beta2-1484",
"Microsoft.Build.Framework": "0.1.0-preview-00024-160610",
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00024-160610"
"Microsoft.Build.Framework": "0.1.0-preview-00028-160627",
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00028-160627"
},
"frameworks": {
"netcoreapp1.0": {

View file

@ -38,56 +38,6 @@ namespace Microsoft.DotNet.Cli.Build
}
}
// Generate a Version 5 (SHA1 Name Based) Guid from a name.
public static Guid GenerateGuidFromName(string name)
{
// Any fixed GUID will do for a namespace.
Guid namespaceId = new Guid("28F1468D-672B-489A-8E0C-7C5B3030630C");
using (SHA1 hasher = SHA1.Create())
{
var nameBytes = System.Text.Encoding.UTF8.GetBytes(name ?? string.Empty);
var namespaceBytes = namespaceId.ToByteArray();
SwapGuidByteOrder(namespaceBytes);
var streamToHash = new byte[namespaceBytes.Length + nameBytes.Length];
Array.Copy(namespaceBytes, streamToHash, namespaceBytes.Length);
Array.Copy(nameBytes, 0, streamToHash, namespaceBytes.Length, nameBytes.Length);
var hashResult = hasher.ComputeHash(streamToHash);
var res = new byte[16];
Array.Copy(hashResult, res, res.Length);
unchecked { res[6] = (byte)(0x50 | (res[6] & 0x0F)); }
unchecked { res[8] = (byte)(0x40 | (res[8] & 0x3F)); }
SwapGuidByteOrder(res);
return new Guid(res);
}
}
// Do a byte order swap, .NET GUIDs store multi byte components in little
// endian.
private static void SwapGuidByteOrder(byte[] b)
{
Swap(b, 0, 3);
Swap(b, 1, 2);
Swap(b, 5, 6);
Swap(b, 7, 8);
}
private static void Swap(byte[] b, int x, int y)
{
byte t = b[x];
b[x] = b[y];
b[y] = t;
}
public static void DeleteDirectory(string path)
{
if (Directory.Exists(path))

View file

@ -113,6 +113,4 @@ if(!(Test-Path $DotnetBundleOutput))
Write-Host -ForegroundColor Green "Successfully created dotnet bundle - $DotnetBundleOutput"
_ $RepoRoot\test\Installer\testmsi.ps1 @("$CLISDKMSIFile")
exit $LastExitCode

View file

@ -60,12 +60,12 @@
"exclude": "compile"
},
"MSBuild": "0.1.0-preview-00024-160610",
"Microsoft.Build.Framework": "0.1.0-preview-00024-160610",
"Microsoft.Build.Tasks.Core": "0.1.0-preview-00024-160610",
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00024-160610",
"Microsoft.Build.Targets": "0.1.0-preview-00024-160610",
"Microsoft.Build": "0.1.0-preview-00024-160610",
"MSBuild": "0.1.0-preview-00028-160627",
"Microsoft.Build.Framework": "0.1.0-preview-00028-160627",
"Microsoft.Build.Tasks.Core": "0.1.0-preview-00028-160627",
"Microsoft.Build.Utilities.Core": "0.1.0-preview-00028-160627",
"Microsoft.Build.Targets": "0.1.0-preview-00028-160627",
"Microsoft.Build": "0.1.0-preview-00028-160627",
"Microsoft.Net.Compilers.NetCore": "1.3.0",
"Microsoft.Net.Compilers.Targets.NetCore": "0.1.5-dev",
"Microsoft.Cci": "4.0.0-rc3-24128-00",

View file

@ -2,7 +2,8 @@
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
param(
[Parameter(Mandatory=$true)][string]$inputMsi
[string]$InputMsi,
[string]$DotnetDir
)
. "$PSScriptRoot\..\..\scripts\common\_common.ps1"
@ -38,7 +39,7 @@ $testName = "Microsoft.DotNet.Cli.Msi.Tests"
$testDir="$PSScriptRoot\$testName"
$testBin="$RepoRoot\artifacts\tests\$testName"
pushd "$Stage2Dir"
pushd "$DotnetDir"
try {
.\dotnet restore `