Address PR comments
This commit is contained in:
parent
d51bfd1bea
commit
50493d2dab
8 changed files with 69 additions and 67 deletions
15
build.proj
15
build.proj
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
<Project ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<BuildCommitHash>$(CommitHash)</BuildCommitHash>
|
||||
<BuildCommitCount>$(CommitCount)</BuildCommitCount>
|
||||
<BuildMsiVersion>$(MsiVersion)</BuildMsiVersion>
|
||||
<BuildVersionBadgeMoniker>$(VersionBadgeMoniker)</BuildVersionBadgeMoniker>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</BuildInfoPropsContent>
|
||||
</PropertyGroup>
|
||||
|
||||
<MakeDir Directories="$(GeneratedPropsDir)" />
|
||||
|
||||
<WriteLinesToFile File="$(BuildInfoProps)"
|
||||
Lines="$(BuildInfoPropsContent)" />
|
||||
</Target>
|
||||
</Project>
|
44
build/Microsoft.DotNet.Cli.GitCommitInfo.targets
Normal file
44
build/Microsoft.DotNet.Cli.GitCommitInfo.targets
Normal 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>
|
||||
<Project ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<CommitHash>$(GitInfoCommitHash)</CommitHash>
|
||||
<CommitCount>$(GitInfoCommitCount)</CommitCount>
|
||||
<MsiVersion>$(BuildInfoMsiVersion)</MsiVersion>
|
||||
<VersionBadgeMoniker>$(BuildInfoVersionBadgeMoniker)</VersionBadgeMoniker>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</GitCommitInfoPropsContent>
|
||||
</PropertyGroup>
|
||||
|
||||
<MakeDir Directories="$(GeneratedPropsDir)" />
|
||||
|
||||
<WriteLinesToFile File="$(GitCommitInfoProps)"
|
||||
Lines="$(GitCommitInfoPropsContent)"
|
||||
Condition=" '$(ShouldOverwriteThePropsFile)' == 'true' "/>
|
||||
</Target>
|
||||
</Project>
|
|
@ -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>
|
||||
<Project ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<HostRid>$(Rid)</HostRid>
|
||||
<HostArchitecture>$(Architecture)</HostArchitecture>
|
||||
<HostOSName>$(OSName)</HostOSName>
|
||||
<Rid>$(HostRid)</Rid>
|
||||
<Architecture>$(HostArchitecture)</Architecture>
|
||||
<OSName>$(HostOSName)</OSName>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</HostInfoPropsContent>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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" }
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue