dotnet-installer/build/Microsoft.DotNet.Cli.Prepare.targets

208 lines
13 KiB
Text
Raw Normal View History

2016-06-27 18:45:51 +00:00
<?xml version="1.0" encoding="utf-8"?>
2016-06-28 02:09:30 +00:00
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="GetCurrentRuntimeInformation" AssemblyFile="$(CLIBuildDll)" />
2016-06-27 18:45:51 +00:00
<UsingTask TaskName="GenerateBuildVersionInfo" AssemblyFile="$(CLIBuildDll)" />
2016-06-28 02:09:30 +00:00
<UsingTask TaskName="CheckPrereqs" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="SetEnvVar" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="DotNetBuild" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="DotNetPack" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="DotNetRestore" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="DotNetTest" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="DownloadFile" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="ExtractArchive" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="ArchiveDirectory" AssemblyFile="$(CLIBuildDll)" />
2016-06-28 02:09:30 +00:00
<Target Name="Prepare"
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestorePackages;ZipTemplates" />
2016-06-27 18:45:51 +00:00
<Target Name="Init"
DependsOnTargets="BuildDotnetCliBuildFramework">
2016-06-27 18:45:51 +00:00
<!-- Current Runtime Information -->
2016-06-28 02:09:30 +00:00
<GetCurrentRuntimeInformation>
<Output TaskParameter="Rid" PropertyName="Rid" />
<Output TaskParameter="Architecture" PropertyName="Architecture" />
<Output TaskParameter="OSName" PropertyName="OSName" />
</GetCurrentRuntimeInformation>
2016-06-27 18:45:51 +00:00
<!-- Common Properties -->
<PropertyGroup>
<IsDesktopAvailable>False</IsDesktopAvailable>
<IsDesktopAvailable Condition=" '$(OSName)' == 'win' ">True</IsDesktopAvailable>
<DotNetPath>$(Stage0Path)</DotNetPath>
2016-06-27 18:45:51 +00:00
<BaseOutputDirectory>$(RepoRoot)/artifacts/$(Rid)</BaseOutputDirectory>
<ToolsOutputDirectory>$(BaseOutputDirectory)/tools</ToolsOutputDirectory>
<Stage1Directory>$(BaseOutputDirectory)/stage1</Stage1Directory>
<Stage1SymbolsDirectory>$(BaseOutputDirectory)/stage1symbols</Stage1SymbolsDirectory>
<DotnetStage1>$(Stage1Directory)/dotnet$(ExeExtension)</DotnetStage1>
<Stage2Directory>$(BaseOutputDirectory)/stage2</Stage2Directory>
<Stage2SymbolsDirectory>$(BaseOutputDirectory)/stage2symbols</Stage2SymbolsDirectory>
<DotnetStage2>$(Stage2Directory)/dotnet$(ExeExtension)</DotnetStage2>
<OutputDirectory>$(Stage2Directory)/</OutputDirectory>
2016-06-27 18:45:51 +00:00
<Stage2CompilationDirectory>$(BaseOutputDirectory)/stage2compilation</Stage2CompilationDirectory>
<IntermediateDirectory>$(BaseOutputDirectory)/intermediate</IntermediateDirectory>
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
2016-06-27 18:45:51 +00:00
</PropertyGroup>
<GenerateBuildVersionInfo RepoRoot="$(RepoRoot)">
2016-06-28 02:09:30 +00:00
<Output TaskParameter="VersionMajor" PropertyName="VersionMajor" />
<Output TaskParameter="VersionMinor" PropertyName="VersionMinor" />
<Output TaskParameter="VersionPatch" PropertyName="VersionPatch" />
<Output TaskParameter="CommitHash" PropertyName="CommitHash" />
<Output TaskParameter="CommitCount" PropertyName="CommitCount" />
<Output TaskParameter="ReleaseSuffix" PropertyName="ReleaseSuffix" />
<Output TaskParameter="VersionSuffix" PropertyName="VersionSuffix" />
<Output TaskParameter="SimpleVersion" PropertyName="SimpleVersion" />
<Output TaskParameter="NugetVersion" PropertyName="NugetVersion" />
<Output TaskParameter="MsiVersion" PropertyName="MsiVersion" />
<Output TaskParameter="VersionBadgeMoniker" PropertyName="VersionBadgeMoniker" />
<Output TaskParameter="Channel" PropertyName="Channel" />
<Output TaskParameter="BranchName" PropertyName="BranchName" />
2016-06-27 18:45:51 +00:00
</GenerateBuildVersionInfo>
<PropertyGroup>
2016-06-28 02:09:30 +00:00
<VersionBadge>$(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg</VersionBadge>
<SdkVersion>$(NugetVersion)</SdkVersion>
2016-06-28 01:26:57 +00:00
2016-06-29 23:21:46 +00:00
<SdkNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-preview3-$(CommitCount)</SdkNugetVersion>
<ProjectModelNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-rc4-$(CommitCount)</ProjectModelNugetVersion>
<DependencyModelAndInternalAbstractionsNugetVersion>$(VersionMajor).$(VersionMinor).1-beta-$(CommitCount)</DependencyModelAndInternalAbstractionsNugetVersion>
2016-06-28 02:09:30 +00:00
<ArchiveExtension Condition=" '$(OSName)' == 'win' ">.zip</ArchiveExtension>
<ArchiveExtension Condition=" '$(OSName)' != 'win' ">.tar.gz</ArchiveExtension>
<InstallerExtension Condition=" '$(OSName)' == 'win' ">.msi</InstallerExtension>
<InstallerExtension Condition=" '$(OSName)' == 'osx' ">.pkg</InstallerExtension>
<InstallerExtension Condition=" '$(OSName)' == 'ubuntu' ">.deb</InstallerExtension>
<BundleExtension Condition=" '$(OSName)' == 'win' ">.exe</BundleExtension>
<BundleExtension Condition=" '$(OSName)' == 'osx' ">$(InstallerExtension)</BundleExtension>
<BundleExtension Condition=" '$(OSName)' == 'ubuntu' ">$(InstallerExtension)</BundleExtension>
<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>
2016-06-28 01:26:57 +00:00
<ArtifactNameSdk>dotnet-sdk</ArtifactNameSdk>
<ArtifactNameSdkDebug>dotnet-sdk-debug</ArtifactNameSdkDebug>
<ArtifactNameCombinedHostHostFxrFrameworkSdk>dotnet-dev</ArtifactNameCombinedHostHostFxrFrameworkSdk>
<ArtifactNameCombinedFrameworkSdk>dotnet-sharedframework-sdk</ArtifactNameCombinedFrameworkSdk>
2016-06-28 02:09:30 +00:00
2016-06-28 01:26:57 +00:00
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionSdk>
<ArtifactNameWithVersionSdkDebug>$(ArtifactNameSdkDebug)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionSdkDebug>
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
<ArtifactNameWithVersionCombinedFrameworkSdk>$(ArtifactNameCombinedFrameworkSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionCombinedFrameworkSdk>
2016-06-28 02:09:30 +00:00
<!-- Downloaded Installers + Archives -->
2016-06-29 23:21:46 +00:00
<DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host-$(ProductMonikerRid).$(SharedHostVersion)$(InstallerExtension)</DownloadedSharedHostInstallerFileName>
<DownloadedSharedHostInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedSharedHostInstallerFileName)</DownloadedSharedHostInstallerFile>
2016-06-28 02:09:30 +00:00
2016-06-29 23:21:46 +00:00
<DownloadedHostFxrInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-hostfxr-$(ProductMonikerRid).$(HostFxrVersion)$(InstallerExtension)</DownloadedHostFxrInstallerFileName>
<DownloadedHostFxrInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedHostFxrInstallerFileName)</DownloadedHostFxrInstallerFile>
2016-06-28 02:09:30 +00:00
2016-06-29 23:21:46 +00:00
<DownloadedSharedFrameworkInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-sharedframework-$(ProductMonikerRid).$(SharedFrameworkVersion)$(InstallerExtension)</DownloadedSharedFrameworkInstallerFileName>
<DownloadedSharedFrameworkInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedSharedFrameworkInstallerFileName)</DownloadedSharedFrameworkInstallerFile>
2016-06-28 02:09:30 +00:00
<CombinedFrameworkHostCompressedFileName>dotnet-$(ProductMonikerRid).$(SharedFrameworkVersion)$(ArchiveExtension)</CombinedFrameworkHostCompressedFileName>
2016-06-27 18:45:51 +00:00
</PropertyGroup>
2016-06-28 02:09:30 +00:00
<CheckPrereqs />
<!-- SetTelemetryProfile -->
<SetEnvVar Name="DOTNET_CLI_TELEMETRY_PROFILE" Value="$(DOTNET_CLI_TELEMETRY_PROFILE);https://github.com/dotnet/cli;$(CommitHash)" />
2016-06-27 18:45:51 +00:00
</Target>
<Target Name="SetupDownloadHostAndSharedFxInputsOutputs" DependsOnTargets="Init">
<PropertyGroup>
<CoreSetupBlobRootUrl>https://dotnetcli.blob.core.windows.net/dotnet/$(CoreSetupChannel)</CoreSetupBlobRootUrl>
<SharedFrameworkArchiveBlobRootUrl>$(CoreSetupBlobRootUrl)/Binaries/$(SharedFrameworkVersion)</SharedFrameworkArchiveBlobRootUrl>
<CoreSetupInstallerBlobRootUrl>$(CoreSetupBlobRootUrl)/Installers</CoreSetupInstallerBlobRootUrl>
<CoreSetupDownloadDirectory>$(IntermediateDirectory)/coreSetupDownload/$(SharedFrameworkVersion)</CoreSetupDownloadDirectory>
<CombinedSharedHostAndFrameworkArchive>$(CoreSetupDownloadDirectory)/combinedSharedHostAndFrameworkArchive</CombinedSharedHostAndFrameworkArchive>
</PropertyGroup>
<ItemGroup>
<_DownloadAndExtractItem Include="CombinedSharedHostAndFrameworkArchive"
Condition="!Exists('$(CombinedSharedHostAndFrameworkArchive)')">
<Url>$(SharedFrameworkArchiveBlobRootUrl)/$(CombinedFrameworkHostCompressedFileName)</Url>
<DownloadFileName>$(CombinedSharedHostAndFrameworkArchive)</DownloadFileName>
<ExtractDestintation>$(SharedFrameworkPublishDirectory)</ExtractDestintation>
</_DownloadAndExtractItem>
2016-06-29 23:21:46 +00:00
<_DownloadAndExtractItem Include="DownloadedSharedFrameworkInstallerFile"
Condition="!Exists('$(DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != ''">
2016-06-29 23:21:46 +00:00
<Url>$(CoreSetupInstallerBlobRootUrl)/$(SharedFrameworkVersion)/$(DownloadedSharedFrameworkInstallerFileName)</Url>
<DownloadFileName>$(DownloadedSharedFrameworkInstallerFile)</DownloadFileName>
<ExtractDestintation></ExtractDestintation>
</_DownloadAndExtractItem>
2016-06-29 23:21:46 +00:00
<_DownloadAndExtractItem Include="DownloadedSharedHostInstallerFile"
Condition="!Exists('$(DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != ''">
2016-06-29 23:21:46 +00:00
<Url>$(CoreSetupInstallerBlobRootUrl)/$(SharedHostVersion)/$(DownloadedSharedHostInstallerFileName)</Url>
<DownloadFileName>$(DownloadedSharedHostInstallerFile)</DownloadFileName>
<ExtractDestintation></ExtractDestintation>
</_DownloadAndExtractItem>
2016-06-29 23:21:46 +00:00
<_DownloadAndExtractItem Include="DownloadedHostFxrInstallerFile"
Condition="!Exists('$(DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != ''">
2016-06-29 23:21:46 +00:00
<Url>$(CoreSetupInstallerBlobRootUrl)/$(HostFxrVersion)/$(DownloadedHostFxrInstallerFileName)</Url>
<DownloadFileName>$(DownloadedHostFxrInstallerFile)</DownloadFileName>
<ExtractDestintation></ExtractDestintation>
</_DownloadAndExtractItem>
</ItemGroup>
</Target>
<Target Name="DownloadHostAndSharedFxArtifacts"
DependsOnTargets="SetupDownloadHostAndSharedFxInputsOutputs">
<DownloadFile Condition=" '@(_DownloadAndExtractItem)' != '' "
Uri="%(_DownloadAndExtractItem.Url)"
DestinationPath="%(_DownloadAndExtractItem.DownloadFileName)" />
<ExtractArchive Condition=" '%(_DownloadAndExtractItem.ExtractDestintation)' != '' "
InputFile="%(_DownloadAndExtractItem.DownloadFileName)"
DestinationDirectory="%(_DownloadAndExtractItem.ExtractDestintation)" />
</Target>
<Target Name="SetupRestorePackagesInputsOutputs">
<ItemGroup>
<RestorePackagesInput Include="$(RepoRoot)/src/**/project.json" />
<RestorePackagesInput Include="$(RepoRoot)/tools/**/project.json" />
</ItemGroup>
</Target>
<Target Name="RestorePackages"
DependsOnTargets="SetupRestorePackagesInputsOutputs;Init"
Inputs="@(RestorePackagesInput)"
Outputs="@(RestorePackagesInput->'%(RelativeDir)/project.lock.json')">
<DotNetRestore WorkingDirectory="$(RepoRoot)/src" ToolPath="$(DotNetPath)" />
<DotNetRestore WorkingDirectory="$(RepoRoot)/tools" ToolPath="$(DotNetPath)" />
</Target>
<Target Name="SetupZipTemplatesInputsOutputs">
<PropertyGroup>
<_DotNetNewFolder>$(RepoRoot)/src/dotnet/commands/dotnet-new</_DotNetNewFolder>
</PropertyGroup>
<ItemGroup>
<DotNetNewArchive Include="$([System.IO.Directory]::GetDirectories($(_DotNetNewFolder)))" />
<ZipTemplatesInput Include="$(_DotNetNewFolder)/**" Exclude="$(_DotNetNewFolder)/*.zip" />
<ZipTemplatesOutput Include="@(DotNetNewArchive->'%(RelativeDir)/$([System.IO.Path]::GetFileName('%(DotNetNewArchive.FullPath)')).zip')" />
</ItemGroup>
</Target>
<Target Name="ZipTemplates"
DependsOnTargets="SetupZipTemplatesInputsOutputs"
Inputs="@(ZipTemplatesInput)"
Outputs="@(ZipTemplatesOutput)">
<ArchiveDirectory InputDirectory="%(DotNetNewArchive.FullPath)"
FileName="$([System.IO.Path]::GetFileName(%(DotNetNewArchive.FullPath)))"
OutputDirectory="%(DotNetNewArchive.RelativeDir)"
ForceZipArchive="true" />
</Target>
</Project>