-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
HelloWorld.csproj
73 lines (64 loc) · 3.13 KB
/
HelloWorld.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<!-- always set SelfContained when running to use Mono on desktop -->
<SelfContained>true</SelfContained>
<PublishTrimmed Condition="'$(SampleTrim)' == 'true'">true</PublishTrimmed>
<RunAOTCompilation Condition="'$(SampleUseAOT)' == 'true' or '$(SampleUseFullAOT)' == 'true'">true</RunAOTCompilation>
<SampleAOTMode Condition="'$(SampleAOTMode)' == '' and '$(SampleUseAOT)' == 'true'">normal</SampleAOTMode>
<SampleAOTMode Condition="'$(SampleAOTMode)' == '' and '$(SampleUseFullAOT)' == 'true'">full</SampleAOTMode>
<DynamicCodeSupport Condition="'$(SampleUseFullAOT)' == 'true'">false</DynamicCodeSupport>
</PropertyGroup>
<UsingTask TaskName="MonoAOTCompiler"
AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" />
<Target Name="AOTCompileApp" Condition="'$(RunAOTCompilation)' == 'true'" AfterTargets="CopyFilesToPublishDirectory">
<PropertyGroup>
<_AotOutputType>Library</_AotOutputType>
<_AotLibraryFormat>Dylib</_AotLibraryFormat>
<UseAotDataFile>false</UseAotDataFile>
</PropertyGroup>
<ItemGroup>
<AotInputAssemblies Include="$(PublishDir)\*.dll" />
</ItemGroup>
<MonoAOTCompiler
CompilerBinaryPath="@(MonoAotCrossCompiler->WithMetadataValue('RuntimeIdentifier','$(TargetOS)-$(TargetArchitecture.ToLowerInvariant())'))"
OutputType="$(_AotOutputType)"
LibraryFormat="$(_AotLibraryFormat)"
Assemblies="@(AotInputAssemblies)"
OutputDir="$(PublishDir)"
CollectTrimmingEligibleMethods="$(StripILCode)"
TrimmingEligibleMethodsOutputDirectory="$(TrimmingEligibleMethodsOutputDirectory)"
IntermediateOutputPath="$(IntermediateOutputPath)"
UseAotDataFile="$(UseAotDataFile)"
MibcProfilePath="$(MibcProfilePath)"
UseLLVM="$(MonoEnableLLVM)"
LLVMPath="$(MonoAotCrossDir)"
Mode="$(SampleAOTMode)"
>
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
</MonoAOTCompiler>
</Target>
<ItemGroup>
<ProjectReference Include="$(RepoTasksDir)AotCompilerTask\MonoAOTCompiler.csproj" ReferenceOutputAssembly="false" Condition="'$(RunAOTCompilation)' == 'true'" AdditionalProperties="Configuration=Debug"/>
</ItemGroup>
<UsingTask TaskName="ILStrip"
AssemblyFile="$(MonoTargetsTasksAssemblyPath)" />
<Target Name="StripILCode" Condition="'$(StripILCode)' == 'true'" AfterTargets="AOTCompileApp">
<PropertyGroup>
<TrimIndividualMethods>true</TrimIndividualMethods>
</PropertyGroup>
<ILStrip
TrimIndividualMethods="$(TrimIndividualMethods)"
Assemblies="@(BundleAssemblies)">
<Output TaskParameter="TrimmedAssemblies" ItemName="TrimmedAssemblies" />
</ILStrip>
<Copy
SourceFiles="@(TrimmedAssemblies->Metadata('TrimmedAssemblyFileName'))"
DestinationFiles="@(TrimmedAssemblies)"
OverwriteReadOnlyFiles="true"
/>
<Delete Files="@(TrimmedAssemblies->Metadata('TrimmedAssemblyFileName'))" />
</Target>
</Project>