Address PR comments

This commit is contained in:
Justin Goshi 2017-02-08 14:02:29 -08:00
parent d51bfd1bea
commit 50493d2dab
8 changed files with 69 additions and 67 deletions

View file

@ -2,6 +2,16 @@
<Project ToolsVersion="14.0" DefaultTargets="BuildTheWholeCli" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="build/Microsoft.DotNet.Cli.Monikers.props" />
<ImportGroup Condition=" '$(GeneratingPropsFile)' == 'true' ">
<Import Condition=" Exists('$(GitCommitInfoProps)') "
Project="$(GitCommitInfoProps)" />
<Import Condition=" Exists('$(HostInfoProps)') "
Project="$(HostInfoProps)" />
</ImportGroup>
<ImportGroup Condition=" '$(GeneratingPropsFile)' != 'true' ">
<Import Project="$(GitCommitInfoProps)" />
<Import Project="$(HostInfoProps)" />
</ImportGroup>
<PropertyGroup>
<!--
@ -75,12 +85,12 @@
<Target Name="WriteDynamicPropsToStaticPropsFiles"
DependsOnTargets="BuildDotnetCliBuildFramework;
WriteBuildInfoProps;
WriteGitCommitInfoProps;
WriteHostInfoProps"/>
<Target DependsOnTargets="$(CLITargets)" Name="BuildTheWholeCli"></Target>
<Import Project="build/Microsoft.DotNet.Cli.BuildInfo.targets" />
<Import Project="build/Microsoft.DotNet.Cli.GitCommitInfo.targets" />
<Import Project="build/Microsoft.DotNet.Cli.HostInfo.targets" />
<Import Project="build/Microsoft.DotNet.Cli.Prepare.targets" />
<Import Project="build/Microsoft.DotNet.Cli.Compile.targets" />
@ -88,4 +98,5 @@
<Import Project="build/Microsoft.DotNet.Cli.Test.targets" />
<Import Project="build/Microsoft.DotNet.Cli.Publish.targets" />
<Import Project="build/Microsoft.DotNet.Cli.Run.targets" />
</Project>

View file

@ -1,40 +0,0 @@
<Project ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.tasks))\dir.tasks" />
<Target Name="WriteBuildInfoProps"
Condition=" !Exists('$(BuildInfoProps)') "
DependsOnTargets="BuildDotnetCliBuildFramework">
<GetCommitHash RepoRoot="$(RepoRoot)">
<Output TaskParameter="CommitHash" PropertyName="CommitHash" />
</GetCommitHash>
<GenerateBuildVersionInfo RepoRoot="$(RepoRoot)"
VersionMajor="$(VersionMajor)"
VersionMinor="$(VersionMinor)"
VersionPatch="$(VersionPatch)"
ReleaseSuffix="$(ReleaseSuffix)">
<Output TaskParameter="CommitCount" PropertyName="CommitCount" />
<Output TaskParameter="MsiVersion" PropertyName="MsiVersion" />
<Output TaskParameter="VersionBadgeMoniker" PropertyName="VersionBadgeMoniker" />
</GenerateBuildVersionInfo>
<PropertyGroup>
<BuildInfoPropsContent>
&lt;Project ToolsVersion=&quot;15.0&quot;&gt;
&lt;PropertyGroup&gt;
&lt;BuildCommitHash&gt;$(CommitHash)&lt;/BuildCommitHash&gt;
&lt;BuildCommitCount&gt;$(CommitCount)&lt;/BuildCommitCount&gt;
&lt;BuildMsiVersion&gt;$(MsiVersion)&lt;/BuildMsiVersion&gt;
&lt;BuildVersionBadgeMoniker&gt;$(VersionBadgeMoniker)&lt;/BuildVersionBadgeMoniker&gt;
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</BuildInfoPropsContent>
</PropertyGroup>
<MakeDir Directories="$(GeneratedPropsDir)" />
<WriteLinesToFile File="$(BuildInfoProps)"
Lines="$(BuildInfoPropsContent)" />
</Target>
</Project>

View file

@ -0,0 +1,44 @@
<Project ToolsVersion="15.0">
<Target Name="WriteGitCommitInfoProps"
Condition=" !Exists('$(GitCommitInfoProps)') "
DependsOnTargets="BuildDotnetCliBuildFramework">
<GetCommitHash RepoRoot="$(RepoRoot)">
<Output TaskParameter="CommitHash" PropertyName="GitInfoCommitHash" />
</GetCommitHash>
<GenerateBuildVersionInfo RepoRoot="$(RepoRoot)"
VersionMajor="$(VersionMajor)"
VersionMinor="$(VersionMinor)"
VersionPatch="$(VersionPatch)"
ReleaseSuffix="$(ReleaseSuffix)">
<Output TaskParameter="CommitCount" PropertyName="GitInfoCommitCount" />
<Output TaskParameter="MsiVersion" PropertyName="BuildInfoMsiVersion" />
<Output TaskParameter="VersionBadgeMoniker" PropertyName="BuildInfoVersionBadgeMoniker" />
</GenerateBuildVersionInfo>
<PropertyGroup>
<ShouldOverWriteThePropsFile
Condition=" '$(CommitHash)' != '$(GitInfoCommitHash)' Or
'$(CommitCount)' != '$(GitInfoCommitCount)' Or
'$(MsiVersion)' != '$(BuildInfoMsiVersion)' Or
'$(VersionBadgeMoniker)' != '$(BuildInfoVersionBadgeMoniker)' ">true</ShouldOverWriteThePropsFile>
<GitCommitInfoPropsContent>
&lt;Project ToolsVersion=&quot;15.0&quot;&gt;
&lt;PropertyGroup&gt;
&lt;CommitHash&gt;$(GitInfoCommitHash)&lt;/CommitHash&gt;
&lt;CommitCount&gt;$(GitInfoCommitCount)&lt;/CommitCount&gt;
&lt;MsiVersion&gt;$(BuildInfoMsiVersion)&lt;/MsiVersion&gt;
&lt;VersionBadgeMoniker&gt;$(BuildInfoVersionBadgeMoniker)&lt;/VersionBadgeMoniker&gt;
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</GitCommitInfoPropsContent>
</PropertyGroup>
<MakeDir Directories="$(GeneratedPropsDir)" />
<WriteLinesToFile File="$(GitCommitInfoProps)"
Lines="$(GitCommitInfoPropsContent)"
Condition=" '$(ShouldOverwriteThePropsFile)' == 'true' "/>
</Target>
</Project>

View file

@ -1,23 +1,21 @@
<Project ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.tasks))\dir.tasks" />
<Target Name="WriteHostInfoProps"
Condition=" !Exists('$(HostInfoProps)') "
DependsOnTargets="BuildDotnetCliBuildFramework">
<GetCurrentRuntimeInformation>
<Output TaskParameter="Rid" PropertyName="Rid" />
<Output TaskParameter="Architecture" PropertyName="Architecture" />
<Output TaskParameter="OSName" PropertyName="OSName" />
<!-- Current Runtime Information -->
<GetCurrentRuntimeInformation OverrideRid="$(OverrideRid)">
<Output TaskParameter="Rid" PropertyName="HostRid" />
<Output TaskParameter="Architecture" PropertyName="HostArchitecture" />
<Output TaskParameter="OSName" PropertyName="HostOSName" />
</GetCurrentRuntimeInformation>
<PropertyGroup>
<HostInfoPropsContent>
&lt;Project ToolsVersion=&quot;15.0&quot;&gt;
&lt;PropertyGroup&gt;
&lt;HostRid&gt;$(Rid)&lt;/HostRid&gt;
&lt;HostArchitecture&gt;$(Architecture)&lt;/HostArchitecture&gt;
&lt;HostOSName&gt;$(OSName)&lt;/HostOSName&gt;
&lt;Rid&gt;$(HostRid)&lt;/Rid&gt;
&lt;Architecture&gt;$(HostArchitecture)&lt;/Architecture&gt;
&lt;OSName&gt;$(HostOSName)&lt;/OSName&gt;
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</HostInfoPropsContent>

View file

@ -18,13 +18,6 @@
<Target Name="InitializeCommonProps"
DependsOnTargets="BuildDotnetCliBuildFramework" >
<!-- Current Runtime Information -->
<GetCurrentRuntimeInformation OverrideRid="$(OverrideRid)">
<Output TaskParameter="Rid" PropertyName="Rid" />
<Output TaskParameter="Architecture" PropertyName="Architecture" />
<Output TaskParameter="OSName" PropertyName="OSName" />
</GetCurrentRuntimeInformation>
<!-- Common Properties -->
<PropertyGroup>
<IsDesktopAvailable>False</IsDesktopAvailable>

View file

@ -1,17 +1,13 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Condition=" Exists('obj/Microsoft.DotNet.Cli.BuildInfo.props') "
Project="obj/Microsoft.DotNet.Cli.BuildInfo.props" />
<Import Condition=" Exists('obj/Microsoft.DotNet.Cli.HostInfo.props') "
Project="obj/Microsoft.DotNet.Cli.HostInfo.props" />
<Import Project="build/Microsoft.DotNet.Cli.DependencyVersions.props" />
<!-- NuGet Information -->
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<GeneratedPropsDir>$(RepoRoot)/obj</GeneratedPropsDir>
<GeneratedPropsDir>$(RepoRoot)/artifacts/obj</GeneratedPropsDir>
<BuildInfoProps>$(GeneratedPropsDir)/BuildInfo.props</BuildInfoProps>
<GitCommitInfoProps>$(GeneratedPropsDir)/GitCommitInfo.props</GitCommitInfoProps>
<HostInfoProps>$(GeneratedPropsDir)/HostInfo.props</HostInfoProps>
<NuGetPackagesDir>$(NUGET_PACKAGES)</NuGetPackagesDir>

View file

@ -114,7 +114,7 @@ if ($NoBuild)
}
else
{
dotnet msbuild build.proj /p:Architecture=$Architecture /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild build.proj /m /v:diag /p:Architecture=$Architecture $ExtraParameters
if($LASTEXITCODE -ne 0) { throw "Failed to build" }
}

View file

@ -179,7 +179,7 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
echo "${args[@]}"
if [ $BUILD -eq 1 ]; then
dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild build.proj /m /v:diag /p:Architecture=$ARCHITECTURE "${args[@]}"
else
echo "Not building due to --nobuild"