Skip to content

Commit

Permalink
Fix resolving IBCMerge's path in build.cmd (dotnet#27513)
Browse files Browse the repository at this point in the history
* Resolve IBCMerge's path via NuGetPackageRoot since we never actually restore ibcmerge.csproj directly.

* Additional fixes to get IBCMerge working again.

* Update src/.nuget/optdata/ibcmerge.csproj

Co-Authored-By: Elinor Fung <47805090+elinor-fung@users.noreply.github.com>
  • Loading branch information
jkoritzinsky and elinor-fung committed Oct 29, 2019
1 parent eae780c commit ff7c12c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/.nuget/optdata/ibcmerge.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.IBCMerge" Version="$(MicrosoftDotNetIBCMergeVersion)" GeneratePathProperty="True" />
<PackageReference Include="Microsoft.DotNet.IBCMerge" Version="$(MicrosoftDotNetIBCMergeVersion)" />
</ItemGroup>

<!-- -->
Expand All @@ -23,10 +23,14 @@
<!-- Error if IbcMergePackagePathOutputFile is not set. -->
<Error Condition="'$(IbcMergePackagePathOutputFile)'==''" Text="IbcMergePackagePathOutputFile must be passed as a property." />

<PropertyGroup>
<IbcMergePath>$(NuGetPackageRoot)microsoft.dotnet.ibcmerge\$(MicrosoftDotNetIBCMergeVersion)</IbcMergePath>
</PropertyGroup>

<!-- Cleanup old path file -->
<Delete Files="$(IbcMergePackagePathOutputFile)" Condition="Exists('$(IbcMergePackagePathOutputFile)')" />
<WriteLinesToFile File="$(IbcMergePackagePathOutputFile)" Lines="$(PkgMicrosoft_DotNet_IBCMerge)" Overwrite="true"/>
<Message Text="MicrosoftDotNetIBCMergePath: $(PkgMicrosoft_DotNet_IBCMerge) written to: $(IbcMergePackagePathOutputFile)" Importance="High" />
<WriteLinesToFile File="$(IbcMergePackagePathOutputFile)" Lines="$(IbcMergePath)" Overwrite="true"/>
<Message Text="MicrosoftDotNetIBCMergePath: $(IbcMergePath) written to: $(IbcMergePackagePathOutputFile)" Importance="High" />
</Target>

</Project>
4 changes: 2 additions & 2 deletions src/.nuget/optdata/optdata.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<!-- Cleanup old version file -->
<Delete Files="$(IbcDataPackagePathOutputFile)" Condition="Exists('$(IbcDataPackagePathOutputFile)')" />

<WriteLinesToFile File="$(IbcDataPackagePathOutputFile)" Lines="$(IbcPackagePath)" Condition="Exists('$(IbcDataPackagePathOutputFile)')" Overwrite="true"/>
<WriteLinesToFile File="$(IbcDataPackagePathOutputFile)" Lines="" Condition="!Exists('$(IbcDataPackagePathOutputFile)')" Overwrite="true"/>
<WriteLinesToFile File="$(IbcDataPackagePathOutputFile)" Lines="$(IbcPackagePath)" Condition="'$(OptimizationDataSupported)' == 'True'" Overwrite="true"/>
<WriteLinesToFile File="$(IbcDataPackagePathOutputFile)" Lines="" Condition="'$(OptimizationDataSupported)' != 'True'" Overwrite="true"/>
<Message Text="optimizationIBCCoreCLRVersion: $(IbcPackagePath) written to: $(IbcDataPackagePathOutputFile)" Importance="High" />
</Target>

Expand Down

0 comments on commit ff7c12c

Please sign in to comment.