nuget version

This commit is contained in:
Bryan Thornbury 2016-06-29 16:21:46 -07:00
parent c7d3f24be0
commit 5cfecec2e9
10 changed files with 340 additions and 104 deletions

View file

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}"
EndProject
@ -126,11 +126,12 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet-build3.Tests", "test
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4-BC0F-443B-8ADF-691321F10108}"
ProjectSection(SolutionItems) = preProject
build\Microsoft.DotNet.Cli.Monikers.props = build\Microsoft.DotNet.Cli.Monikers.props
build\Microsoft.DotNet.Cli.Package.targets = build\Microsoft.DotNet.Cli.Package.targets
build\Microsoft.DotNet.Cli.Prepare.targets = build\Microsoft.DotNet.Cli.Prepare.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{31A6D092-F50C-4D70-BA4D-97098189A953}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{FD7D515A-D10F-4F49-B8AE-21CF7ED071AE}"
ProjectSection(SolutionItems) = preProject
build\package\Microsoft.DotNet.Cli.Archive.targets = build\package\Microsoft.DotNet.Cli.Archive.targets
build\package\Microsoft.DotNet.Cli.Installer.DEB.targets = build\package\Microsoft.DotNet.Cli.Installer.DEB.targets
@ -978,6 +979,6 @@ Global
{4C3B06D5-B6D5-4E5B-A44F-3EBE52A1C759} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{35B19F22-B8C0-4849-9C35-3F809B7588B8} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
{49D7318E-D198-4E2B-BBEA-3A24D805F88D} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
{31A6D092-F50C-4D70-BA4D-97098189A953} = {89905EC4-BC0F-443B-8ADF-691321F10108}
{FD7D515A-D10F-4F49-B8AE-21CF7ED071AE} = {89905EC4-BC0F-443B-8ADF-691321F10108}
EndGlobalSection
EndGlobal

View file

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="BuildTheWholeCli" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="build/Microsoft.DotNet.Cli.Monikers.props" />
<PropertyGroup>
<!--
$(OS) is set to Unix/Windows_NT. This comes from an environment variable on Windows and MSBuild on Unix.

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SdkBrandName>Microsoft .NET Core 1.0.0 - SDK Preview 2</SdkBrandName>
<SharedFrameworkBrandName>Microsoft .NET Core 1.0.0 - Runtime</SharedFrameworkBrandName>
<SharedHostBrandName>Microsoft .NET Core 1.0.0 - Host</SharedHostBrandName>
<HostFxrBrandName>Microsoft .NET Core 1.0.0 - Host FX Resolver</HostFxrBrandName>
<SharedFrameworkNugetName>Microsoft.NETCore.App</SharedFrameworkNugetName>
</PropertyGroup>
</Project>

View file

@ -57,9 +57,9 @@
<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>
<SdkNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-preview3-$(CommitCount)</SdkNugetVersion>
<ProjectModelNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-rc4-$(CommitCount)</ProjectModelNugetVersion>
<DependencyModelAndInternalAbstractionsNugetVersion>$(VersionMajor).$(VersionMinor).1-beta-$(CommitCount)</DependencyModelAndInternalAbstractionsNugetVersion>
<ArchiveExtension Condition=" '$(OSName)' == 'win' ">.zip</ArchiveExtension>
<ArchiveExtension Condition=" '$(OSName)' != 'win' ">.tar.gz</ArchiveExtension>
@ -86,18 +86,16 @@
<ArtifactNameWithVersionCombinedFrameworkSdk>$(ArtifactNameCombinedFrameworkSdk)-$(ProductMonikerRid).$(SdkVersion)</ArtifactNameWithVersionCombinedFrameworkSdk>
<!-- Downloaded Installers + Archives -->
<SharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host-$(ProductMonikerRid).$(SharedHostVersion)$(InstallerExtension)</SharedHostInstallerFileName>
<SharedHostInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(SharedHostInstallerFileName)</SharedHostInstallerFile>
<DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host-$(ProductMonikerRid).$(SharedHostVersion)$(InstallerExtension)</DownloadedSharedHostInstallerFileName>
<DownloadedSharedHostInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedSharedHostInstallerFileName)</DownloadedSharedHostInstallerFile>
<HostFxrInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-hostfxr-$(ProductMonikerRid).$(HostFxrVersion)$(InstallerExtension)</HostFxrInstallerFileName>
<HostFxrInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(HostFxrInstallerFileName)</HostFxrInstallerFile>
<DownloadedHostFxrInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-hostfxr-$(ProductMonikerRid).$(HostFxrVersion)$(InstallerExtension)</DownloadedHostFxrInstallerFileName>
<DownloadedHostFxrInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedHostFxrInstallerFileName)</DownloadedHostFxrInstallerFile>
<SharedFrameworkInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-sharedframework-$(ProductMonikerRid).$(SharedFrameworkVersion)$(InstallerExtension)</SharedFrameworkInstallerFileName>
<SharedFrameworkInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(SharedFrameworkInstallerFileName)</SharedFrameworkInstallerFile>
<DownloadedSharedFrameworkInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-sharedframework-$(ProductMonikerRid).$(SharedFrameworkVersion)$(InstallerExtension)</DownloadedSharedFrameworkInstallerFileName>
<DownloadedSharedFrameworkInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedSharedFrameworkInstallerFileName)</DownloadedSharedFrameworkInstallerFile>
<CombinedFrameworkHostCompressedFileName>dotnet-$(ProductMonikerRid).$(SharedFrameworkVersion)$(ArchiveExtension)</CombinedFrameworkHostCompressedFileName>
<SdkBrandName>Microsoft .NET Core 1.0.0 - SDK Preview 2</SdkBrandName>
</PropertyGroup>
<CheckPrereqs />
@ -124,24 +122,24 @@
<ExtractDestintation>$(SharedFrameworkPublishDirectory)</ExtractDestintation>
</_DownloadAndExtractItem>
<_DownloadAndExtractItem Include="SharedFrameworkInstallerFile"
Condition="!Exists('$(SharedFrameworkInstallerFile)')">
<Url>$(CoreSetupInstallerBlobRootUrl)/$(SharedFrameworkVersion)/$(SharedFrameworkInstallerFileName)</Url>
<DownloadFileName>$(SharedFrameworkInstallerFile)</DownloadFileName>
<_DownloadAndExtractItem Include="DownloadedSharedFrameworkInstallerFile"
Condition="!Exists('$(DownloadedSharedFrameworkInstallerFile)')">
<Url>$(CoreSetupInstallerBlobRootUrl)/$(SharedFrameworkVersion)/$(DownloadedSharedFrameworkInstallerFileName)</Url>
<DownloadFileName>$(DownloadedSharedFrameworkInstallerFile)</DownloadFileName>
<ExtractDestintation></ExtractDestintation>
</_DownloadAndExtractItem>
<_DownloadAndExtractItem Include="SharedHostInstallerFile"
Condition="!Exists('$(SharedHostInstallerFile)')">
<Url>$(CoreSetupInstallerBlobRootUrl)/$(SharedHostVersion)/$(SharedHostInstallerFileName)</Url>
<DownloadFileName>$(SharedHostInstallerFile)</DownloadFileName>
<_DownloadAndExtractItem Include="DownloadedSharedHostInstallerFile"
Condition="!Exists('$(DownloadedSharedHostInstallerFile)')">
<Url>$(CoreSetupInstallerBlobRootUrl)/$(SharedHostVersion)/$(DownloadedSharedHostInstallerFileName)</Url>
<DownloadFileName>$(DownloadedSharedHostInstallerFile)</DownloadFileName>
<ExtractDestintation></ExtractDestintation>
</_DownloadAndExtractItem>
<_DownloadAndExtractItem Include="HostFxrInstallerFile"
Condition="!Exists('$(HostFxrInstallerFile)')">
<Url>$(CoreSetupInstallerBlobRootUrl)/$(HostFxrVersion)/$(HostFxrInstallerFileName)</Url>
<DownloadFileName>$(HostFxrInstallerFile)</DownloadFileName>
<_DownloadAndExtractItem Include="DownloadedHostFxrInstallerFile"
Condition="!Exists('$(DownloadedHostFxrInstallerFile)')">
<Url>$(CoreSetupInstallerBlobRootUrl)/$(HostFxrVersion)/$(DownloadedHostFxrInstallerFileName)</Url>
<DownloadFileName>$(DownloadedHostFxrInstallerFile)</DownloadFileName>
<ExtractDestintation></ExtractDestintation>
</_DownloadAndExtractItem>
</ItemGroup>

View file

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

View file

@ -26,11 +26,6 @@
<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 -->
@ -60,22 +55,22 @@
Inputs="$(WixDownloadSentinel)"
Outputs="$(WixDestinationPath)">
<!-- Setup sentinel to take advantage of incrementality -->
<MakeDir Directories="$(WixRoot)" />
<WriteLinesToFile
File="$(WixDownloadSentinel)"
Lines="$(WixVersion)"
Overwrite="true"
Encoding="Unicode"/>
<!-- 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" />
<DownloadFile
Uri="$(WixDownloadUrl)"
DestinationPath="$(WixDestinationPath)"
Overwrite="false" />
<ExtractArchive
InputFile="$(WixDestinationPath)"
DestinationDirectory="$(WixRoot)" />
<ExtractArchive
InputFile="$(WixDestinationPath)"
DestinationDirectory="$(WixRoot)" />
</Target>
@ -86,16 +81,16 @@
$(SdkGenerateMsiPowershellScript)"
Outputs="$(SdkInstallerFile)">
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateMsiPowershellScript)
'$(SdkLayoutOutputDirectory)'
'$(SdkInstallerFile)'
'$(WixRoot)'
'$(SdkBrandName)'
'$(MsiVersion)'
'$(SimpleVersion)'
'$(NugetVersion)'
'$(SdkInstallerUpgradeCode)'
'$(Architecture)'" />
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateMsiPowershellScript)
'$(SdkLayoutOutputDirectory)'
'$(SdkInstallerFile)'
'$(WixRoot)'
'$(SdkBrandName)'
'$(MsiVersion)'
'$(SimpleVersion)'
'$(NugetVersion)'
'$(SdkInstallerUpgradeCode)'
'$(Architecture)'" />
</Target>
<Target Name="GenerateSdkBundle"
@ -108,19 +103,19 @@
$(SdkGenerateBundlePowershellScript)"
Outputs="$(CombinedFrameworkSdkHostInstallerFile)">
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateBundlePowershellScript)
'$(SdkInstallerFile)'
'$(DownloadedSharedFrameworkInstallerFile)'
'$(DownloadedHostFxrInstallerFile)'
'$(DownloadedSharedHostInstallerFile)'
'$(CombinedFrameworkSdkHostInstallerFile)'
'$(WixRoot)'
'$(SdkBrandName)'
'$(MsiVersion)'
'$(SimpleVersion)'
'$(NugetVersion)'
'$(CombinedFrameworkSDKHostInstallerUpgradeCode)'
'$(Architecture)'" />
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateBundlePowershellScript)
'$(SdkInstallerFile)'
'$(DownloadedSharedFrameworkInstallerFile)'
'$(DownloadedHostFxrInstallerFile)'
'$(DownloadedSharedHostInstallerFile)'
'$(CombinedFrameworkSdkHostInstallerFile)'
'$(WixRoot)'
'$(SdkBrandName)'
'$(MsiVersion)'
'$(SimpleVersion)'
'$(NugetVersion)'
'$(CombinedFrameworkSDKHostInstallerUpgradeCode)'
'$(Architecture)'" />
</Target>
<Target Name="TestSdkMsi"
@ -129,15 +124,15 @@
DependsOnTargets="Init;MsiTargetsSetupInputOutputs;GenerateSdkMsi"
Condition=" '$(OS)' == 'Windows_NT'" >
<Exec Command ="powershell -NoProfile -NoLogo $(SdkTestMsiPowershellScript)
-InputMsi '$(SdkInstallerFile)'
-DotnetDir '$(OutputDirectory)'" />
<Exec Command ="powershell -NoProfile -NoLogo $(SdkTestMsiPowershellScript)
-InputMsi '$(SdkInstallerFile)'
-DotnetDir '$(OutputDirectory)'" />
<WriteLinesToFile
File="$(SdkMsiTestedSentinel)"
Lines="$(SdkVersion)"
Overwrite="true"
Encoding="Unicode"/>
<WriteLinesToFile
File="$(SdkMsiTestedSentinel)"
Lines="$(SdkVersion)"
Overwrite="true"
Encoding="Unicode"/>
</Target>
<Target Name="GenerateMsis"
@ -152,14 +147,14 @@
<!-- These targets are used in signing, don't remove them! -->
<Target Name="ExtractEngineFromSdkBundle">
<Exec Command="$(WixRoot)/insignia.exe
-ib $(CombinedFrameworkSdkHostInstallerFile)
-o $(CombinedFrameworkSdkHostBundleEngineName)" />
<Exec Command="$(WixRoot)/insignia.exe
-ib $(CombinedFrameworkSdkHostInstallerFile)
-o $(CombinedFrameworkSdkHostBundleEngineName)" />
</Target>
<Target Name="ReattachEngineToSdkBundle">
<Exec Command="$(WixRoot)/insignia.exe
-ab $(CombinedFrameworkSdkHostInstallerFile)
-o $(CombinedFrameworkSdkHostBundleEngineName)" />
<Exec Command="$(WixRoot)/insignia.exe
-ab $(CombinedFrameworkSdkHostInstallerFile)
-o $(CombinedFrameworkSdkHostBundleEngineName)" />
</Target>
</Project>

View file

@ -1,10 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="PkgTargets" AssemblyFile="$(CLIBuildDll)" />
<UsingTask TaskName="ReplaceFileContents" AssemblyFile="$(CLIBuildDll)" />
<Target Name="SetupPkgInputsOutputs">
<PropertyGroup>
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
<PkgIntermediateDirectory>$(IntermediateDirectory)/pkgs/$(SdkVersion)</PkgIntermediateDirectory>
<Target Name="GeneratePkgs" >
<PkgTargets />
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
<CombinedFrameworkSdkHostInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostInstallerFile>
<!-- Properties for pkg build -->
<SharedHostComponentId>com.microsoft.dotnet.sharedhost.component.osx.x64</SharedHostComponentId>
<HostFxrComponentId>com.microsoft.dotnet.hostfxr.component.osx.x64</HostFxrComponentId>
<SharedFrameworkComponentId>com.microsoft.dotnet.sharedframework.$(SharedFrameworkNugetName).$(SharedFrameworkVersion).component.osx.x64</SharedFrameworkComponentId>
<SdkComponentId>com.microsoft.dotnet.dev.$(SdkVersion).component.osx.x64</SdkComponentId>
<SdkProductArchiveId>com.microsoft.dotnet.dev.$(SdkVersion).osx.x64</SdkProductArchiveId>
<PkgInstallDirectory>/usr/local/share/dotnet</PkgInstallDirectory>
<SdkPkgSourcesRootDirectory>$(RepoRoot)/packaging/osx/clisdk</SdkPkgSourcesRootDirectory>
<SdkPkgScriptsDirectory>$(SdkPkgSourcesRootDirectory)/scripts</SdkPkgScriptsDirectory>
<SdkProductArchiveResourcesDirectory>$(SdkPkgSourcesRootDirectory)/resources</SdkProductArchiveResourcesDirectory>
<SdkProductArchiveDistributionTemplateFile>$(SdkPkgSourcesRootDirectory)/Distribution-Template</SdkProductArchiveDistributionTemplateFile>
<SdkProductArchiveDistributionFile>$(PkgIntermediateDirectory)/CLI-SDK-Formatted-Distribution-Template.xml</SdkProductArchiveDistributionFile>
<SdkPkgIntermediatePath>$(PkgIntermediateDirectory)/$(SdkComponentId).pkg</SdkPkgIntermediatePath>
<SharedFrameworkPkgIntermediatePath>$(PkgIntermediateDirectory)/$(SharedFrameworkComponentId).pkg</SharedFrameworkPkgIntermediatePath>
<SharedHostPkgIntermediatePath>$(PkgIntermediateDirectory)/$(SharedHostComponentId).pkg</SharedHostPkgIntermediatePath>
<HostFxrPkgIntermediatePath>$(PkgIntermediateDirectory)/$(HostFxrComponentId).pkg</HostFxrPkgIntermediatePath>
</PropertyGroup>
<ItemGroup>
<DistributionTemplateReplacement Include="{SharedFxComponentId}">
<ReplacementString>$(SharedFrameworkComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{SharedHostComponentId}">
<ReplacementString>$(SharedHostComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{HostFxrComponentId}">
<ReplacementString>$(HostFxrComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{CLISdkComponentId}">
<ReplacementString>$(SdkComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{CLISdkNugetVersion}">
<ReplacementString>$(SdkVersion)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{CLISdkBrandName}">
<ReplacementString>$(SdkBrandName)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{SharedFxBrandName}">
<ReplacementString>$(SharedFrameworkBrandName)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{SharedHostBrandName}">
<ReplacementString>$(SharedHostBrandName)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{HostFxrBrandName}">
<ReplacementString>$(HostFxrBrandName)</ReplacementString>
</DistributionTemplateReplacement>
</ItemGroup>
<!-- Consumed By Publish -->
<ItemGroup>
<GeneratedInstallers Include="$(SdkInstallerFile);$(CombinedFrameworkSdkHostInstallerFile)" />
</ItemGroup>
</Target>
<Target Name="GenerateSdkPkg"
Inputs="$(SdkLayoutOutputDirectory);"
Outputs="$(SdkInstallerFile)"
DependsOnTargets="Init;Layout;SetupPkgInputsOutputs"
Condition=" '%(OSName)' == 'osx' ">
<Exec Command="pkgbuild
--root '$(SdkLayoutOutputDirectory)'
--identifier '$(SdkComponentId)'
--version '$(SdkVersion)'
--install-location '$(PkgInstallDirectory)'
--scripts '$(SdkPkgScriptsDirectory)'
'$(SdkInstallerFile)'" />
</Target>
<Target Name="GenerateSdkProductArchive"
Inputs="$(SdkInstallerFile);
$(DownloadedSharedFrameworkInstallerFile);
$(DownloadedHostFxrInstallerFile);
$(DownloadedSharedHostInstallerFile);
$(SdkProductArchiveDistributionTemplateFile);
$(ResourcesPath)"
Outputs="$(CombinedFrameworkSdkHostInstallerFile)"
DependsOnTargets="GenerateSdkPkg"
Condition=" '%(OSName)' == 'osx' ">
<!-- Move ProductArchive pkg components into place with component ids in the filenames -->
<Copy
SourceFiles="$(SdkInstallerFile);
$(DownloadedSharedFrameworkInstallerFile);
$(DownloadedHostFxrInstallerFile);
$(DownloadedSharedHostInstallerFile);"
DestinationFiles="$(SdkPkgIntermediatePath);
$(SharedFrameworkPkgIntermediatePath);
$(HostFxrPkgIntermediatePath);
$(SharedHostPkgIntermediatePath);"
Overwrite="true" />
<!-- Fill out parameters in the Distribution Template -->
<ReplaceFileContents
InputFile="$(SdkProductArchiveDistributionTemplateFile)"
DestinationFile="$(SdkProductArchiveDistributionFile)"
ReplacementPatterns="@(DistributionTemplateReplacement -> '%(Identity)')"
ReplacementStrings="@(DistributionTemplateReplacement -> '%(ReplacementString)')" />
<Exec Command="productbuild
--version '$(SdkVersion)'
--identifier '$(SdkProductArchiveId)'
--package-path '$(PkgIntermediateDirectory)'
--resources '$(ResourcesPath)'
--distribution '$(SdkProductArchiveDistributionFile)'
'$(CombinedFrameworkSdkHostInstallerFile)'" />
</Target>
<Target Name="GeneratePkgs"
DependsOnTargets="Init;
Layout;
SetupPkgInputsOutputs;
GenerateSdkPkg;
GenerateSdkProductArchive"
Condition=" '%(OSName)' == 'osx' " />
</Project>

View file

@ -15,6 +15,27 @@
<CombinedFrameworkSdkInput Include="$(OutputDirectory)/sdk/**/*" />
</ItemGroup>
<MakeRelative
Path1="$(OutputDirectory)"
Path2="%(SdkLayoutInput.Identity)" >
<Output TaskParameter="RelativePath" ItemName="SdkRelativeOutputFiles" />
</MakeRelative>
<MakeRelative
Path1="$(OutputDirectory)"
Path2="%(SdkDebugLayoutInput.Identity)" >
<Output TaskParameter="RelativePath" ItemName="SdkDebugRelativeOutputFiles" />
</MakeRelative>
<MakeRelative
Path1="$(OutputDirectory)"
Path2="%(CombinedHostHostFxrFrameworkSdkInput.Identity)" >
<Output TaskParameter="RelativePath" ItemName="CombinedHostHostFxrFrameworkSdkRelativeOutputFiles" />
</MakeRelative>
<MakeRelative
Path1="$(OutputDirectory)"
Path2="%(CombinedFrameworkSdkInput.Identity)" >
<Output TaskParameter="RelativePath" ItemName="CombinedFrameworkSdkOutputFiles" />
</MakeRelative>
<PropertyGroup>
<SdkLayoutOutputDirectory>$(LayoutDirectory)/$(ArtifactNameSdk)</SdkLayoutOutputDirectory>
<SdkDebugLayoutOutputDirectory>$(LayoutDirectory)/$(ArtifactNameSdkDebug)</SdkDebugLayoutOutputDirectory>
@ -26,28 +47,28 @@
<ItemGroup>
<LayoutDefinition Include="SdkName">
<InputFiles>@(SdkLayoutInput)</InputFiles>
<OutputFiles>@(SdkLayoutInput -> '$(SdkLayoutOutputDirectory)/$([MSBuild]::MakeRelative($(OutputDirectory), '%(Identity)'))')</OutputFiles>
<OutputFiles>@(SdkRelativeOutputFiles -> '$(SdkLayoutOutputDirectory)/%(Identity)')</OutputFiles>
<NameWithVersion>$(ArtifactNameWithVersionSdk)</NameWithVersion>
<Name>$(ArtifactNameSdk)</Name>
</LayoutDefinition>
<LayoutDefinition Include="SdkDebug">
<InputFiles>@(SdkDebugLayoutInput)</InputFiles>
<OutputFiles>@(SdkDebugLayoutInput -> '$(SdkDebugLayoutOutputDirectory)/$([MSBuild]::MakeRelative($(SymbolsOutputDirectory), '%(Identity)'))')</OutputFiles>
<OutputFiles>@(SdkDebugRelativeOutputFiles -> '$(SdkDebugLayoutOutputDirectory)/%(Identity)')</OutputFiles>
<NameWithVersion>$(ArtifactNameWithVersionSdkDebug)</NameWithVersion>
<Name>$(ArtifactNameSdkDebug)</Name>
</LayoutDefinition>
<LayoutDefinition Include="CombinedHostHostFxrFrameworkSdk">
<InputFiles>@(CombinedHostHostFxrFrameworkSdkInput)</InputFiles>
<OutputFiles>@(CombinedHostHostFxrFrameworkSdkInput -> '$(CombinedHostHostFxrFrameworkSdkOutputDirectory)/$([MSBuild]::MakeRelative($(OutputDirectory), '%(Identity)'))')</OutputFiles>
<OutputFiles>@(CombinedHostHostFxrFrameworkSdkRelativeOutputFiles -> '$(CombinedHostHostFxrFrameworkSdkOutputDirectory)/%(Identity)')</OutputFiles>
<NameWithVersion>$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)</NameWithVersion>
<Name>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)</Name>
</LayoutDefinition>
<LayoutDefinition Include="CombinedFrameworkSdk">
<InputFiles>@(CombinedFrameworkSdkInput)</InputFiles>
<OutputFiles>@(CombinedFrameworkSdkInput -> '$(CombinedFrameworkSdkOutputDirectory)/$([MSBuild]::MakeRelative($(OutputDirectory), '%(Identity)'))')</OutputFiles>
<OutputFiles>@(CombinedFrameworkSdkOutputFiles -> '$(CombinedFrameworkSdkOutputDirectory)/%(Identity)')</OutputFiles>
<NameWithVersion>$(ArtifactNameWithVersionCombinedFrameworkSdk)</NameWithVersion>
<Name>$(ArtifactNameCombinedFrameworkSdk)</Name>
</LayoutDefinition>
@ -56,7 +77,7 @@
</Target>
<Target Name="Layout"
DependsOnTargets="Init;SetupLayoutInputsOutputs"
DependsOnTargets="Init;dotn"
Inputs="@(LayoutDefinition -> '%(InputFiles)')"
Outputs="@(LayoutDefinition -> '%(OutputFiles)')" >

View file

@ -13,39 +13,39 @@
<ItemGroup>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.Cli.Utils" >
<ProjectName>Microsoft.DotNet.Cli.Utils</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
<Version>$(SdkNugetVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.Compiler.Common">
<ProjectName>Microsoft.DotNet.Compiler.Common</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
<Version>$(SdkNugetVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.Files">
<ProjectName>Microsoft.DotNet.Files</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
<Version>$(SdkNugetVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.InternalAbstractions">
<ProjectName>Microsoft.DotNet.InternalAbstractions</ProjectName>
<Version>$(DependencyModelAndInternalAbstractionsProjectJsonVersion)</Version>
<Version>$(DependencyModelAndInternalAbstractionsNugetVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.ProjectModel">
<ProjectName>Microsoft.DotNet.ProjectModel</ProjectName>
<Version>$(ProjectModelProjectJsonVersion)</Version>
<Version>$(ProjectModelNugetVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.ProjectModel.Loader">
<ProjectName>Microsoft.DotNet.ProjectModel.Loader</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
<Version>$(SdkNugetVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.DotNet.ProjectModel.Workspaces">
<ProjectName>Microsoft.DotNet.ProjectModel.Workspaces</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
<Version>$(SdkNugetVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.Extensions.DependencyModel">
<ProjectName>Microsoft.Extensions.DependencyModel</ProjectName>
<Version>$(DependencyModelAndInternalAbstractionsProjectJsonVersion)</Version>
<Version>$(DependencyModelAndInternalAbstractionsNugetVersion)</Version>
</ProjectsToPack>
<ProjectsToPack Include="$(ProjectsSrcDirectory)/Microsoft.Extensions.Testing.Abstractions">
<ProjectName>Microsoft.Extensions.Testing.Abstractions</ProjectName>
<Version>$(SdkProjectJsonVersion)</Version>
<Version>$(SdkNugetVersion)</Version>
</ProjectsToPack>
<ProjectPackTargetInputs Include="$(PackagingBuildBasePath)/src/%(ProjectsToPack.ProjectName)/**/netstandard*/%(ProjectName).dll" />

View file

@ -0,0 +1,79 @@
using System;
using System.IO;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
namespace Microsoft.DotNet.Cli.Build
{
/// <summary>
/// Reads contents of an input file, and searches for each ReplacementPattern passed in.
/// When a ReplacementPattern is matched it will replace it with the string of the corresponding (by index)
/// item in ReplacementStrings.
///
/// For example, if 2 ReplacementPatterns are passed in, 2 ReplacementStrings must also passed in and the first
/// pattern will be replaced with the first string, and the second pattern replaced with the second string.
///
/// ReplacementPattern could easily be a regex, but it isn't needed for current use cases, so leaving this
/// as just a string that will be replaced.
/// </summary>
public class ReplaceFileContents : Task
{
[Required]
public string InputFile { get; set; }
[Required]
public string DestinationFile { get; set; }
[Required]
public ITaskItem[] ReplacementPatterns { get; set; }
[Required]
public ITaskItem[] ReplacementStrings { get; set; }
public override bool Execute()
{
if (ReplacementPatterns.Length != ReplacementStrings.Length)
{
throw new Exception($"Expected {nameof(ReplacementPatterns)} (length {ReplacementPatterns.Length}) and {nameof(ReplacementStrings)} (length {ReplacementStrings.Length}) to have the same length.");
}
if (!File.Exists(InputFile))
{
throw new FileNotFoundException($"Expected file {InputFile} was not found.");
}
string inputFileText = File.ReadAllText(InputFile);
string outputFileText = ReplacePatterns(inputFileText);
WriteOutputFile(outputFileText);
return true;
}
public string ReplacePatterns(string inputFileText)
{
var outText = inputFileText;
for (int i=0; i<ReplacementPatterns.Length; ++i)
{
var replacementPattern = ReplacementPatterns[i].ItemSpec;
var replacementString = ReplacementStrings[i].ItemSpec;
outText = outText.Replace(replacementPattern, replacementString);
}
return outText;
}
public void WriteOutputFile(string outputFileText)
{
var destinationDirectory = Path.GetDirectoryName(DestinationFile);
if (!Directory.Exists(destinationDirectory))
{
Directory.CreateDirectory(destinationDirectory);
}
File.WriteAllText(DestinationFile, outputFileText);
}
}
}