Browse Source

Added VS2019 ILMerge script

TalAloni 4 years ago
parent
commit
b2b4f259c1
2 changed files with 15 additions and 0 deletions
  1. 11 0
      ISCSIConsole/ILMerge/ILMerge.bat
  2. 4 0
      ISCSIConsole/ISCSIConsole.csproj

+ 11 - 0
ISCSIConsole/ILMerge/ILMerge.bat

@@ -0,0 +1,11 @@
+IF ["%programfiles(x86)%"]==[""] SET ilmergePath="%programfiles%\Microsoft\ILMerge"
+IF NOT ["%programfiles(x86)%"]==[""] SET ilmergePath="%programfiles(x86)%\Microsoft\ILMerge"
+
+set TargetFramework=%1
+if %TargetFramework%==net20 set TargetPlaform=2.0
+if %TargetFramework%==net40 set TargetPlaform=4.0
+if %TargetFramework%==net472 set TargetPlaform=4.0
+set binaryPath=%CD%\..\bin\Release\%TargetFramework%
+set outputPath=%CD%\..\bin\ILMerge\%TargetFramework%
+IF NOT EXIST "%outputPath%" MKDIR "%outputPath%"
+%ilmergePath%\ilmerge /targetplatform=%TargetPlaform% /ndebug /target:winexe /out:"%outputPath%\ISCSIConsole.exe" "%binaryPath%\ISCSIConsole.exe" "%binaryPath%\DiskAccessLibrary.FileSystems.Abstractions.dll" "%binaryPath%\DiskAccessLibrary.dll" "%binaryPath%\DiskAccessLibrary.Win32.dll" "%binaryPath%\ISCSI.dll"

+ 4 - 0
ISCSIConsole/ISCSIConsole.csproj

@@ -18,4 +18,8 @@
     <ProjectReference Include="..\ISCSI\ISCSI.csproj" />
   </ItemGroup>
 
+  <Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Release' And '$(TargetFramework)' != 'netcoreapp3.1'">
+      <Exec Command="&quot;$(ProjectDir)ILMerge\ILMerge.bat&quot; $(TargetFramework)" WorkingDirectory="$(ProjectDir)ILMerge" />
+  </Target>
+
 </Project>