Skip to content

Commit

Permalink
Add sample project to reproduce jbevain#856
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-englert committed Jun 15, 2022
1 parent f7b64f7 commit aa506a9
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Integration/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
14 changes: 14 additions & 0 deletions Integration/Patcher/Patcher.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Mono.Cecil.csproj" />
<ProjectReference Include="..\..\symbols\mdb\Mono.Cecil.Mdb.csproj" />
<ProjectReference Include="..\..\symbols\pdb\Mono.Cecil.Pdb.csproj" />
</ItemGroup>

</Project>
20 changes: 20 additions & 0 deletions Integration/Patcher/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Mono.Cecil;

namespace Patcher {
class Program {
static void Main (string [] args)
{
// System.Diagnostics.Debugger.Launch ();

var fileName = args [0];

var m = ModuleDefinition.ReadModule (fileName, new ReaderParameters { InMemory = true });

m.ReadSymbols ();

m.Types.Add (new TypeDefinition ("Namespace", "NewType", TypeAttributes.Abstract));

m.Write (fileName, new WriterParameters { WriteSymbols = true });
}
}
}
33 changes: 33 additions & 0 deletions Integration/Testee/Testee.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Patcher\Patcher.csproj" />
</ItemGroup>

<Target Name="PatchTargetFile" AfterTargets="Build">
<Message Text="PatchTargetFile" Importance="High" />
<Copy SourceFiles="$(TargetPath)" DestinationFiles="$(TargetPath).backup" />
<Exec Command='"$(TargetDir)Patcher.exe" "$(TargetPath)"' />

</Target>

</Project>
13 changes: 13 additions & 0 deletions Integration/Testee/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Xunit;

namespace Testee
{
public class UnitTest1
{
[Fact]
public void Test1()
{

}
}
}
22 changes: 20 additions & 2 deletions Mono.Cecil.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28516.95
# Visual Studio Version 17
VisualStudioVersion = 17.3.32519.111
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.Cecil", "Mono.Cecil.csproj", "{16C3FA32-4775-497F-8794-DD5AF13CFE22}"
EndProject
Expand All @@ -19,6 +19,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.Cecil.Rocks", "rocks\M
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.Cecil.Rocks.Tests", "rocks\Test\Mono.Cecil.Rocks.Tests.csproj", "{EF768F7A-3C08-45EE-8A7E-BB5A81BADB7B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Integration", "Integration", "{BB9A0547-6491-4D99-9438-DBD2333BFADF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testee", "Integration\Testee\Testee.csproj", "{1BC4B56A-35CE-42E0-8291-7D5A891AC184}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Patcher", "Integration\Patcher\Patcher.csproj", "{59EB1974-93F6-4CEC-B6E3-36E6350FC605}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -57,10 +63,22 @@ Global
{EF768F7A-3C08-45EE-8A7E-BB5A81BADB7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF768F7A-3C08-45EE-8A7E-BB5A81BADB7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF768F7A-3C08-45EE-8A7E-BB5A81BADB7B}.Release|Any CPU.Build.0 = Release|Any CPU
{1BC4B56A-35CE-42E0-8291-7D5A891AC184}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1BC4B56A-35CE-42E0-8291-7D5A891AC184}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1BC4B56A-35CE-42E0-8291-7D5A891AC184}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1BC4B56A-35CE-42E0-8291-7D5A891AC184}.Release|Any CPU.Build.0 = Release|Any CPU
{59EB1974-93F6-4CEC-B6E3-36E6350FC605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59EB1974-93F6-4CEC-B6E3-36E6350FC605}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59EB1974-93F6-4CEC-B6E3-36E6350FC605}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59EB1974-93F6-4CEC-B6E3-36E6350FC605}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1BC4B56A-35CE-42E0-8291-7D5A891AC184} = {BB9A0547-6491-4D99-9438-DBD2333BFADF}
{59EB1974-93F6-4CEC-B6E3-36E6350FC605} = {BB9A0547-6491-4D99-9438-DBD2333BFADF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {97A7013A-E1DE-4D11-93C5-212D0A7E85C9}
EndGlobalSection
Expand Down

0 comments on commit aa506a9

Please # to comment.