浏览代码

Migrate from ILRepack to Costura

ILRepack was unable to sucessfully pack in Npgsql, whereas Costura could.
Nick Babcock 6 年之前
父节点
当前提交
14659adc60
共有 2 个文件被更改,包括 7 次插入5 次删除
  1. 4 0
      OhmGraphite/FodyWeavers.xml
  2. 3 5
      OhmGraphite/OhmGraphite.csproj

+ 4 - 0
OhmGraphite/FodyWeavers.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<Weavers>
+  <Costura ExcludeAssemblies='TargetExe|TargetExeTest' CreateTemporaryAssemblies='true' DisableCleanup='true'/>
+</Weavers>

+ 3 - 5
OhmGraphite/OhmGraphite.csproj

@@ -27,7 +27,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="ILRepack" Version="2.0.16" />
+    <PackageReference Include="Costura.Fody" Version="3.1.4" />
     <PackageReference Include="NLog.Config" Version="4.5.10" />
     <PackageReference Include="Npgsql" Version="4.0.3" />
     <PackageReference Include="prometheus-net" Version="2.1.3" />
@@ -43,9 +43,7 @@
     <Reference Include="System.Configuration" />
   </ItemGroup>
 
-  <Target Name="ILPack" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
-    <Exec Command="&quot;$(NuGetPackageRoot)ilrepack\2.0.15\tools\ILRepack.exe&quot; /lib:$(OutputPath) /out:$(BaseOutputPath)OhmGraphite.exe $(OutputPath)OhmGraphite.exe $(OutputPath)Topshelf.dll $(OutputPath)Topshelf.NLog.dll $(OutputPath)NLog.dll $(OutputPath)OpenHardwareMonitorLib.dll $(OutputPath)InfluxDB.LineProtocol.dll $(OutputPath)HidLibrary.dll $(OutputPath)protobuf-net.dll $(OutputPath)Prometheus.NetStandard.dll" />
-    <Copy SourceFiles="$(OutputPath)NLog.config;$(OutputPath)Npgsql.dll;$(OutputPath)System.Runtime.CompilerServices.Unsafe.dll;$(OutputPath)System.Threading.Tasks.Extensions.dll" DestinationFolder="$(BaseOutputPath)" />
-    <Zip Files="$(BaseOutputPath)OhmGraphite.exe;$(BaseOutputPath)OhmGraphite.exe.config;$(BaseOutputPath)NLog.config;$(BaseOutputPath)Npgsql.dll;$(BaseOutputPath)System.Runtime.CompilerServices.Unsafe.dll;$(BaseOutputPath)System.Threading.Tasks.Extensions.dll" WorkingDirectory="$(BaseOutputPath)" ZipFileName="$(BaseOutputPath)OhmGraphite-$(Major).$(Minor).$(Revision).zip" />
+  <Target Name="Pack" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
+    <Zip Files="$(OutputPath)OhmGraphite.exe;$(OutputPath)OhmGraphite.exe.config;$(OutputPath)NLog.config" WorkingDirectory="$(OutputPath)" ZipFileName="$(BaseOutputPath)OhmGraphite-$(Major).$(Minor).$(Revision).zip" />
   </Target>
 </Project>