Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b27a59

Browse files
author
ArthurHub
committed
* build demo app into a single exe (embed dll using ILMerge)
1 parent 14016d5 commit 6b27a59

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

Build/build.xml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929

3030
<Message Importance="high" Text="====================== Build demo..."/>
3131
<CallTarget Targets="BuildDemo"/>
32-
32+
3333
<Message Importance="high" Text="====================== Build libraries..."/>
3434
<CallTarget Targets="BuildLibrary"/>
35-
35+
3636
<Message Importance="high" Text="====================== Get current version..."/>
3737
<GetAssemblyIdentity AssemblyFiles="$(OutputBinRoot)\NET20\HtmlRenderer.dll">
3838
<Output TaskParameter="Assemblies" ItemName="AsmInfo" />
3939
</GetAssemblyIdentity>
40-
40+
4141
<Message Importance="high" Text="====================== Build demo..."/>
42-
<CallTarget Targets="BuildDemo"/>
42+
<CallTarget Targets="BuildDemo" />
4343

4444
<Message Importance="high" Text="====================== Copy source..."/>
4545
<CallTarget Targets="CopySource"/>
@@ -56,9 +56,7 @@
5656
<Error Condition="!Exists('$(OutputBinRoot)\NET40\HtmlRenderer.dll')" Text="Validation failed (.NET 4.0)!" />
5757
<Error Condition="!Exists('$(OutputBinRoot)\NET45\HtmlRenderer.dll')" Text="Validation failed (.NET 4.5)!" />
5858
<Error Condition="!Exists('$(OutputSourceRoot)\HtmlRenderer.sln')" Text="Validation failed (Source)!" />
59-
<Error Condition="!Exists('$(OutputRoot)\HtmlRendererDemo.exe')" Text="Validation failed (Demo)!" />
60-
<Error Condition="!Exists('$(OutputRoot)\HtmlRenderer.dll')" Text="Validation failed (Demo)!" />
61-
<Error Condition="!Exists('$(OutputRoot)\HtmlRenderer.dll')" Text="Validation failed (Demo)!" />
59+
<Error Condition="!Exists('$(OutputRoot)\HtmlRendererDemo.WinForms.exe')" Text="Validation failed (Demo)!" />
6260
<Error Condition="!Exists('$(OutputRoot)\HtmlRenderer %(AsmInfo.Version).zip')" Text="Validation failed (zip)!" />
6361

6462
<Message Importance="high" Text="====================== SUCCESS!"/>
@@ -90,13 +88,21 @@
9088
</CreateProperty>
9189
</Target>
9290

93-
<!--Build the demo application and delete the pdbs-->
91+
<!--Build the demo application, merge to single exe and delete the rest of the files-->
9492
<Target Name="BuildDemo">
9593
<MSBuild Properties="$(BuildProperties);$(DemoBuildOutputPath);$(BuildWarn)" UseResultsCache="true" Targets="Rebuild" Projects="$(DemoRoot)\HtmlRenderer.Demo.csproj" />
94+
95+
<GetAssemblyIdentity AssemblyFiles="$(OutputRoot)\HtmlRenderer.dll">
96+
<Output TaskParameter="Assemblies" ItemName="AsmInfo" />
97+
</GetAssemblyIdentity>
98+
99+
<Exec Command="ILMerge.exe $(OutputRoot)\HtmlRendererDemo.exe $(OutputRoot)\HtmlRenderer.dll /out:$(OutputRoot)\HtmlRendererDemo.WinForms.exe /ver:%(AsmInfo.Version)" />
100+
96101
<ItemGroup>
97-
<files Include="$(OutputRoot)\*.*" Exclude="$(OutputRoot)\*.exe;$(OutputRoot)\*.dll;"/>
102+
<files Include="$(OutputRoot)\*.*" Exclude="$(OutputRoot)\HtmlRendererDemo.WinForms.exe"/>
98103
</ItemGroup>
99104
<Delete Files="@(files)"/>
105+
100106
</Target>
101107

102108
<!--Copy all the source and remove the bin and obj folders-->

0 commit comments

Comments
 (0)