Skip to content

Commit

Permalink
slightly better build outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed Mar 31, 2024
1 parent fe84588 commit 607bfcc
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/FsAutoComplete/FsAutoComplete.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<PublishTrimmed>true</PublishTrimmed>
<PublishSingleFile>true</PublishSingleFile>
<PublishSelfContained>true</PublishSelfContained>
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<None
Expand Down Expand Up @@ -83,17 +87,32 @@

<Target Name="BuildAllStandloneApplications">
<ItemGroup>
<!-- Make MSBuild Items out of the RIDs so we can batch across them -->
<_RIDS Include="$(RuntimeIdentifiers)" />
<!-- Make MSBuild Items out of the TFMs so we can batch across them. Create NUM_RIDS items
per-TFM because we want to build each TFM for all supported platforms. -->
<_TFMS
Include="$(TargetFrameworks)"
RID="%(_RIDS.Identity)" />
<!-- Turn the _TFMS items into requests to build this project (fsautocomplete.fsproj) with
different parameters. This pattern is often used to to parallel builds of the same project in
MSBuild logic. -->
<_RIDSpecificFSACBuild
Include="$(MSBuildThisFile)"
AdditionalProperties="RuntimeIdentifier=%(_RIDS.Identity)" />
AdditionalProperties="RuntimeIdentifier=%(_TFMS.RID);TargetFramework=%(_TFMS.Identity)" />
</ItemGroup>

<!-- Ask MSBuild to build all of the requests we just made. The MSBuild Task recognizes the
AdditionalProperties metadata and will apply that to each specific build, we can specify the things
that are common to all of the builds here. Unsetting RuntimeIdentifiers and TargetFrameworks
ensures that the SDK targets detect that these are single-RID/single-TFM builds accurately, and
since we're pretty certain there are no data dependencies here we can have the builds operate in
parallel. -->
<MSBuild
Projects="@(_RIDSpecificFSACBuild)"
Targets="Publish"
Properties="Configuration=Release;PublishSingleFile=true;PublishTrimmed=true;"
RemoveProperties="RuntimeIdentifiers"
Properties="Configuration=Release;SelfContained=true"
RemoveProperties="RuntimeIdentifiers;TargetFrameworks"
BuildInParallel="true" />
</Target>

Expand Down

0 comments on commit 607bfcc

Please sign in to comment.