Skip to content

Commit 798b5f4

Browse files
committed
slightly better build outputs
1 parent fe84588 commit 798b5f4

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/FsAutoComplete/FsAutoComplete.fsproj

+27-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
2020
<IsPackable>true</IsPackable>
2121
<PackAsTool>true</PackAsTool>
22+
<PublishSingleFile>true</PublishSingleFile>
23+
<PublishSelfContained>true</PublishSelfContained>
24+
<DebugType>embedded</DebugType>
25+
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
2226
</PropertyGroup>
2327
<ItemGroup>
2428
<None
@@ -71,6 +75,11 @@
7175
$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
7276
</PropertyGroup>
7377

78+
<ItemGroup Label="Trimming Settings">
79+
<TrimmerRootAssembly Include="Serilog" />
80+
<TrimmerRootAssembly Include="Ionide.ProjInfo.ProjectSystem" />
81+
</ItemGroup>
82+
7483
<!-- workaround for not being able to have p2p dependencies in tool output dir
7584
https://github.com/nuget/home/issues/3891#issuecomment-377319939 -->
7685
<Target
@@ -83,17 +92,32 @@
8392

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

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

0 commit comments

Comments
 (0)