Skip to content

Commit 5225acf

Browse files
committed
Embed Mono.Cecil to avoid assembly matching problem.
1 parent 47a7bc2 commit 5225acf

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

build.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pushd %~dp0
44

55
tools\nuget\NuGet.exe update -self
66
tools\nuget\NuGet.exe install FAKE -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 4.12
7+
tools\nuget\NuGet.exe install ILRepack -ConfigFile tools\nuget\Nuget.Config -OutputDirectory packages -ExcludeVersion -Version 2.0.9
78

89
set encoding=utf-8
910
packages\FAKE\tools\FAKE.exe build.fsx %*

build.fsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ Target "Build" (fun _ ->
2929
)
3030

3131
Target "Package" (fun _ ->
32+
// pack IncrementalCompiler.exe with dependent module dlls to packed one
33+
let errorCode = Shell.Exec("./packages/ILRepack/tools/ILRepack.exe",
34+
"/wildcards /out:UselessAttributeStripper.packed.exe UselessAttributeStripper.exe *.dll",
35+
"./src/UselessAttributeStripper/bin/Release")
36+
// copy & zip
3237
let workDir = binDir @@ "work"
3338
CreateDir workDir
34-
"./src/UselessAttributeStripper/bin/Release/UselessAttributeStripper.exe" |> CopyFile workDir
39+
"./src/UselessAttributeStripper/bin/Release/UselessAttributeStripper.packed.exe" |> CopyFile (workDir @@ "UselessAttributeStripper.exe")
3540
"./src/InstallScript/setup.py" |> CopyFile workDir
3641
!! (workDir @@ "**") |> Zip workDir (binDir @@ "UselessAttributeStripper.zip")
3742
)
-271 KB
Binary file not shown.

src/UselessAttributeStripper/UselessAttributeStripper.csproj

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,21 @@
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
3434
<ItemGroup>
35-
<Reference Include="Mono.Cecil">
36-
<HintPath>.\Mono.Cecil.dll</HintPath>
35+
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
36+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net40\Mono.Cecil.dll</HintPath>
37+
<Private>True</Private>
38+
</Reference>
39+
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
40+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
41+
<Private>True</Private>
42+
</Reference>
43+
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
44+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
45+
<Private>True</Private>
46+
</Reference>
47+
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
48+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
49+
<Private>True</Private>
3750
</Reference>
3851
<Reference Include="System" />
3952
<Reference Include="System.XML" />
@@ -45,6 +58,9 @@
4558
<Compile Include="Program.cs" />
4659
<Compile Include="Properties\AssemblyInfo.cs" />
4760
</ItemGroup>
61+
<ItemGroup>
62+
<None Include="packages.config" />
63+
</ItemGroup>
4864
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
4965
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
5066
Other similar extension points exist, see Microsoft.Common.targets.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net40" />
4+
</packages>

0 commit comments

Comments
 (0)