Skip to content

Commit c0311bf

Browse files
radicalAndreyAkinshin
authored andcommitted
MonoAOTLLVMCsProj.txt: Add auto-imports for extension props/targets
Automatically import any `$projectName.Mono.props`, and `$projectName.Mono.targets` files, if found. - This allows the actual project to control settings for the generated project, eg, for modifying the build to add a property like `SelfContained=true`. Wasm projects have the same extension mechanism in `src/BenchmarkDotNet/Templates/WasmCsProj.txt` .
1 parent 142a89e commit c0311bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/BenchmarkDotNet/Templates/MonoAOTLLVMCsProj.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk" DefaultTarget="Publish">
22
<PropertyGroup>
3+
<OriginalCSProjPath>$CSPROJPATH$</OriginalCSProjPath>
4+
<MonoPropsPath>$([System.IO.Path]::ChangeExtension('$(OriginalCSProjPath)', '.Mono.props'))</MonoPropsPath>
5+
<MonoTargetsPath>$([System.IO.Path]::ChangeExtension('$(OriginalCSProjPath)', '.Mono.targets'))</MonoTargetsPath>
36
<OutputType>Exe</OutputType>
47
<OutputPath>bin</OutputPath>
58
<TargetFramework>$TFM$</TargetFramework>
@@ -13,6 +16,8 @@
1316
<StartupObject>BenchmarkDotNet.Autogenerated.UniqueProgramName</StartupObject>
1417
</PropertyGroup>
1518

19+
<Import Project="$(MonoPropsPath)" Condition="Exists($(MonoPropsPath))" />
20+
1621
<ItemGroup>
1722
<PackageReference Include="Microsoft.NET.Runtime.MonoAOTCompiler.Task" version="6.0.0-*" GeneratePathProperty="true" />
1823
</ItemGroup>
@@ -75,4 +80,5 @@
7580

7681
</Target>
7782

83+
<Import Project="$(MonoTargetsPath)" Condition="Exists($(MonoTargetsPath))" />
7884
</Project>

0 commit comments

Comments
 (0)