Skip to content

Commit

Permalink
Try to guess a reasonble default for Tool RID
Browse files Browse the repository at this point in the history
This helps with cases where folks invoke msbuild directly without going
through build.sh or build.cmd.  On Windows it's very easy to guess but
on "Unix" it's harder so right now we assume that the Target OS and Host
OS are the same (of course, this could be overridden).
  • Loading branch information
ellismg committed Oct 28, 2015
1 parent 01e8af2 commit 4887791
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ build_managed_corefx()
__buildproj=$__scriptpath/build.proj
__buildlog=$__scriptpath/msbuild.log

MONO29679=1 ReferenceAssemblyRoot=$__referenceassemblyroot mono $__msbuildpath "$__buildproj" /nologo /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$__buildlog" /t:Build /p:OSGroup=$__BuildOS /p:UseRoslynCompiler=true /p:COMPUTERNAME=$(hostname) /p:USERNAME=$(id -un) /p:TestNugetRuntimeId=$__TestNugetRuntimeId "$@"
MONO29679=1 ReferenceAssemblyRoot=$__referenceassemblyroot mono $__msbuildpath "$__buildproj" /nologo /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$__buildlog" /t:Build /p:OSGroup=$__BuildOS /p:UseRoslynCompiler=true /p:COMPUTERNAME=$(hostname) /p:USERNAME=$(id -un) /p:TestNugetRuntimeId=$__TestNugetRuntimeId /p:ToolNugetRuntimeId=$__TestNugetRuntimeId "$@"
BUILDERRORLEVEL=$?

echo
Expand Down
11 changes: 11 additions & 0 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@
<TestNugetRuntimeId Condition="'$(OSGroup)'=='FreeBSD'">ubuntu.14.04-x64</TestNugetRuntimeId>
</PropertyGroup>

<!-- Provide defaults for ToolNugetRuntimeId -->
<PropertyGroup Condition="'$(ToolNugetRuntimeId)'== ''">
<ToolNugetRuntimeId Condition="'$(OsEnvironment)'=='Windows_NT'">win7-x64</ToolNugetRuntimeId>

<!-- This is a bit of a hack because inside MSBuild we have no real concept of the host distro, so we'll assume
that if you are building on not windows, your host OS is the same as your target. If that's not
the case, you'll have to provide your own ToolNugetRuntimeId, which is not the end of the world (build.sh will
do this for you, for example). -->
<ToolNugetRuntimeId Condition="'$(OsEnvironment)'=='Unix'">$(TestNugetRuntimeId)</ToolNugetRuntimeId>
</PropertyGroup>

<!-- Set up Default symbol and optimization for Configuration -->
<PropertyGroup Condition="'$(ConfigurationGroup)' == 'Debug'">
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
Expand Down

0 comments on commit 4887791

Please sign in to comment.