Skip to content

Commit

Permalink
Preparing for release
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed May 20, 2018
1 parent e3ddd13 commit 35ee291
Show file tree
Hide file tree
Showing 17 changed files with 220 additions and 129 deletions.
46 changes: 1 addition & 45 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
/Harmony/build
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
Expand All @@ -21,29 +19,23 @@
bld/
[Bb]in/
[Oo]bj/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
Expand All @@ -68,10 +60,8 @@ artifacts/
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
Expand All @@ -81,48 +71,36 @@ ipch/
*.sdf
*.cachefile
*.VC.db

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
Expand All @@ -132,20 +110,16 @@ DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml

# TODO: Un-comment the next line if you do not want to checkin
# your web deploy settings because they may include unencrypted
# passwords
#*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
Expand All @@ -157,25 +131,20 @@ publish/
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directory
AppPackages/
BundleArtifacts/

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
[Ss]tyle[Cc]op.*
Expand All @@ -187,56 +156,43 @@ ClientBin/
*.publishsettings
node_modules/
orleans.codegen.cs

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# LightSwitch generated files
GeneratedArtifacts/
ModelManifest.xml

# Paket dependency manager
.paket/paket.exe

# FAKE - F# Make
.fake/
26 changes: 16 additions & 10 deletions Harmony.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HarmonyTests", "HarmonyTest
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Debug-3.5|Any CPU = Debug-3.5|Any CPU
Debug-4.7.1|Any CPU = Debug-4.7.1|Any CPU
Release-3.5|Any CPU = Release-3.5|Any CPU
Release-4.7.1|Any CPU = Release-4.7.1|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Release|Any CPU.Build.0 = Release|Any CPU
{DEE74EFC-29A8-4704-8536-7DA38D3999F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEE74EFC-29A8-4704-8536-7DA38D3999F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEE74EFC-29A8-4704-8536-7DA38D3999F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEE74EFC-29A8-4704-8536-7DA38D3999F7}.Release|Any CPU.Build.0 = Release|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Debug-3.5|Any CPU.ActiveCfg = Debug-3.5|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Debug-3.5|Any CPU.Build.0 = Debug-3.5|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Debug-4.7.1|Any CPU.ActiveCfg = Debug-4.7.1|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Debug-4.7.1|Any CPU.Build.0 = Debug-4.7.1|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Release-3.5|Any CPU.ActiveCfg = Release-3.5|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Release-3.5|Any CPU.Build.0 = Release-3.5|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Release-4.7.1|Any CPU.ActiveCfg = Release-4.7.1|Any CPU
{69AEE16A-B6E7-4642-8081-3928B32455DF}.Release-4.7.1|Any CPU.Build.0 = Release-4.7.1|Any CPU
{DEE74EFC-29A8-4704-8536-7DA38D3999F7}.Debug-3.5|Any CPU.ActiveCfg = Debug-3.5|Any CPU
{DEE74EFC-29A8-4704-8536-7DA38D3999F7}.Debug-4.7.1|Any CPU.ActiveCfg = Debug-4.7.1|Any CPU
{DEE74EFC-29A8-4704-8536-7DA38D3999F7}.Release-3.5|Any CPU.ActiveCfg = Release-3.5|Any CPU
{DEE74EFC-29A8-4704-8536-7DA38D3999F7}.Release-4.7.1|Any CPU.ActiveCfg = Release-4.7.1|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 0 additions & 1 deletion Harmony/Attributes.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Reflection;

namespace Harmony
{
Expand Down
20 changes: 20 additions & 0 deletions Harmony/CodeInstruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ public CodeInstruction(CodeInstruction instruction)
labels = instruction.labels.ToArray().ToList();
}

public CodeInstruction Clone()
{
return new CodeInstruction(this) { labels = new List<Label>() };
}

public CodeInstruction Clone(OpCode opcode)
{
var instruction = new CodeInstruction(this) { labels = new List<Label>() };
instruction.opcode = opcode;
return instruction;
}

public CodeInstruction Clone(OpCode opcode, object operand)
{
var instruction = new CodeInstruction(this) { labels = new List<Label>() };
instruction.opcode = opcode;
instruction.operand = operand;
return instruction;
}

public override string ToString()
{
var list = new List<string>();
Expand Down
4 changes: 4 additions & 0 deletions Harmony/CodeTranspiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public static object ConvertInstruction(Type type, object op, out Dictionary<str
return elementTo;
}

// ShouldAddExceptionInfo is used to determine if CodeInstructions from an older Harmony version were duplicating
// exception information as well as to preserve the exception information from being dropped when piping through
// multiple transpilers with mixed Harmony versions.
//
public static bool ShouldAddExceptionInfo(object op, int opIndex, List<object> originalInstructions, List<object> newInstructions, Dictionary<object, Dictionary<string, object>> unassignedValues)
{
var originalIndex = originalInstructions.IndexOf(op);
Expand Down
99 changes: 69 additions & 30 deletions Harmony/Harmony.csproj
Original file line number Diff line number Diff line change
@@ -1,36 +1,75 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net35</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Product>Harmony</Product>
<Company>Andreas Pardeike</Company>
<Copyright>Copyright © 2016</Copyright>
<Description>A general non-destructive patch library for .NET and Mono modules</Description>
<PackageId>Harmony</PackageId>
<Authors>Andreas Pardeike</Authors>
<AssemblyName>0Harmony</AssemblyName>
<SignAssembly>false</SignAssembly>
<Version>1.1.0</Version>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>Harmony,Mono,Patch,Patching,Runtime,Detour,Detours,Aspect,Aspects</PackageTags>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Product>Harmony</Product>
<Company>Andreas Pardeike</Company>
<Copyright>Copyright © 2016</Copyright>
<Description>A general non-destructive patch library for .NET and Mono modules</Description>
<PackageId>Harmony</PackageId>
<Authors>Andreas Pardeike</Authors>
<AssemblyName>0Harmony</AssemblyName>
<SignAssembly>false</SignAssembly>
<Version>1.1.0</Version>
<PackageLicenseUrl>https://raw.githubusercontent.com/pardeike/Harmony/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/pardeike/Harmony</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>Harmony,Mono,Patch,Patching,Runtime,Detour,Detours,Aspect,Aspects</PackageTags>
<Configurations>Debug-3.5;Release-3.5;Debug-4.7.1;Release-4.7.1</Configurations>
<TargetFrameworks>net35;net471</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>DEBUG;TRACE;NET35</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.XML" />
<Reference Include="System.XML.Linq" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>NET35</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-3.5|AnyCPU'">
<DefineConstants>DEBUG;TRACE;NET35</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<TargetFramework>net35</TargetFramework>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<OutputPath>build\Debug\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-4.7.1|AnyCPU'">
<DefineConstants>DEBUG;TRACE;NET471</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<TargetFramework>net471</TargetFramework>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<OutputPath>build\Debug\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-3.5|AnyCPU'">
<DefineConstants>NET35</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
<TargetFramework>net35</TargetFramework>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<OutputPath>build\Release\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-4.7.1|AnyCPU'">
<DefineConstants>NET471</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
<TargetFramework>net471</TargetFramework>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<OutputPath>build\Release\</OutputPath>
</PropertyGroup>

</Project>
Loading

0 comments on commit 35ee291

Please sign in to comment.