# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ABIChecker", "src\ABIChecker\ABIChecker.csproj", "{CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{383212F6-53D3-4FB2-ACB6-086265479816}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenDummy", "src\GenDummy\GenDummy.csproj", "{1E1A1D65-0455-4F29-A97B-5343F34418B5}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ABIChecker", "src\ABIChecker\ABIChecker.csproj", "{901E26D0-F77D-45EB-AE9E-6B7EAA12D165}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenDummy.Tasks", "src\GenDummy.Tasks\GenDummy.Tasks.csproj", "{E9C95342-979E-4ACC-BB12-C7C85F7B84B2}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenDummy.CommandLine", "src\GenDummy.CommandLine\GenDummy.CommandLine.csproj", "{CF407C1F-1550-4ED0-AB5D-2733DCEE443F}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenDummy.CommandLine", "src\GenDummy.CommandLine\GenDummy.CommandLine.csproj", "{0A8A3694-C87C-4131-ACBF-216E778142BA}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenDummy", "src\GenDummy\GenDummy.csproj", "{86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator.Rewrite.NETCore", "src\Generator.Rewrite\Generator.Rewrite.NETCore.csproj", "{A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{E98F2935-7908-41D6-9906-D4E57DB0BB37}"
- ProjectSection(SolutionItems) = preProject
- scripts\add_module.sh = scripts\add_module.sh
- build-tools.sh = build-tools.sh
- scripts\module.csproj.template = scripts\module.csproj.template
- scripts\retry.sh = scripts\retry.sh
- scripts\timeout.sh = scripts\timeout.sh
- EndProjectSection
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenDummy.Tasks", "src\GenDummy.Tasks\GenDummy.Tasks.csproj", "{89BBD7BF-4061-4D4B-9687-7981CB1A260A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Debug|x64.ActiveCfg = Debug|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Debug|x64.Build.0 = Debug|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Debug|x86.ActiveCfg = Debug|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Debug|x86.Build.0 = Debug|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Release|Any CPU.Build.0 = Release|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Release|x64.ActiveCfg = Release|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Release|x64.Build.0 = Release|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Release|x86.ActiveCfg = Release|Any CPU
- {CBA86009-11E4-4DCC-A3D2-BF93040FE9B0}.Release|x86.Build.0 = Release|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Debug|x64.ActiveCfg = Debug|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Debug|x64.Build.0 = Debug|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Debug|x86.ActiveCfg = Debug|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Debug|x86.Build.0 = Debug|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Release|Any CPU.Build.0 = Release|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Release|x64.ActiveCfg = Release|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Release|x64.Build.0 = Release|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Release|x86.ActiveCfg = Release|Any CPU
- {1E1A1D65-0455-4F29-A97B-5343F34418B5}.Release|x86.Build.0 = Release|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Debug|x64.ActiveCfg = Debug|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Debug|x64.Build.0 = Debug|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Debug|x86.ActiveCfg = Debug|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Debug|x86.Build.0 = Debug|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Release|Any CPU.Build.0 = Release|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Release|x64.ActiveCfg = Release|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Release|x64.Build.0 = Release|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Release|x86.ActiveCfg = Release|Any CPU
- {E9C95342-979E-4ACC-BB12-C7C85F7B84B2}.Release|x86.Build.0 = Release|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Debug|x64.ActiveCfg = Debug|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Debug|x64.Build.0 = Debug|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Debug|x86.ActiveCfg = Debug|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Debug|x86.Build.0 = Debug|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Release|Any CPU.Build.0 = Release|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Release|x64.ActiveCfg = Release|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Release|x64.Build.0 = Release|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Release|x86.ActiveCfg = Release|Any CPU
- {0A8A3694-C87C-4131-ACBF-216E778142BA}.Release|x86.Build.0 = Release|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Debug|x64.Build.0 = Debug|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Debug|x86.Build.0 = Debug|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Release|Any CPU.Build.0 = Release|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Release|x64.ActiveCfg = Release|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Release|x64.Build.0 = Release|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Release|x86.ActiveCfg = Release|Any CPU
- {A8C3D620-CBA3-4CCE-A111-4FC68236ED4D}.Release|x86.Build.0 = Release|Any CPU
- EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {66FC1898-9E04-4FCD-B673-23168371658A}
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Debug|x64.Build.0 = Debug|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Debug|x86.Build.0 = Debug|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Release|Any CPU.Build.0 = Release|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Release|x64.ActiveCfg = Release|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Release|x64.Build.0 = Release|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Release|x86.ActiveCfg = Release|Any CPU
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165}.Release|x86.Build.0 = Release|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Debug|x64.Build.0 = Debug|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Debug|x86.Build.0 = Debug|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Release|x64.ActiveCfg = Release|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Release|x64.Build.0 = Release|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Release|x86.ActiveCfg = Release|Any CPU
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F}.Release|x86.Build.0 = Release|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Debug|x64.Build.0 = Debug|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Debug|x86.Build.0 = Debug|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Release|Any CPU.Build.0 = Release|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Release|x64.ActiveCfg = Release|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Release|x64.Build.0 = Release|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Release|x86.ActiveCfg = Release|Any CPU
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93}.Release|x86.Build.0 = Release|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Debug|x64.Build.0 = Debug|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Debug|x86.Build.0 = Debug|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Release|x64.ActiveCfg = Release|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Release|x64.Build.0 = Release|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Release|x86.ActiveCfg = Release|Any CPU
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {901E26D0-F77D-45EB-AE9E-6B7EAA12D165} = {383212F6-53D3-4FB2-ACB6-086265479816}
+ {CF407C1F-1550-4ED0-AB5D-2733DCEE443F} = {383212F6-53D3-4FB2-ACB6-086265479816}
+ {86EA601E-ED01-4B3C-BBFF-9DE194E0BB93} = {383212F6-53D3-4FB2-ACB6-086265479816}
+ {89BBD7BF-4061-4D4B-9687-7981CB1A260A} = {383212F6-53D3-4FB2-ACB6-086265479816}
EndGlobalSection
EndGlobal
"Microsoft.CSharp/4.0.1": {
"type": "package",
"serviceable": true,
- "sha512": "sha512-17h8b5mXa87XYKrrVqdgZ38JefSUqLChUQpXgSnpzsM0nDOhE40FTeNWOJ/YmySGV6tG6T8+hjz6vxbknHJr6A==",
+ "sha512": "sha512-bM7IkLhJmBFtocrseXxf1cywbbkf49VkjPUhTKhDt8rhJ2b3Umd1N1FZCcfZowKQgithC1SZa3ldWjzN0O49aw==",
"path": "microsoft.csharp/4.0.1",
"hashPath": "microsoft.csharp.4.0.1.nupkg.sha512"
},
"Newtonsoft.Json/9.0.1": {
"type": "package",
"serviceable": true,
- "sha512": "sha512-U82mHQSKaIk+lpSVCbWYKNavmNH1i5xrExDEquU1i6I5pV6UMOqRnJRSlKO3cMPfcpp0RgDY+8jUXHdQ4IfXvw==",
+ "sha512": "sha512-EZsVUqtnBHEhlJE22IjA3BU3JENwdgjwI5k/hBj7fn4pY4wRs8AU0F4m+NeEfcysrRiDXGj50SLlQTZxiqK+7g==",
"path": "newtonsoft.json/9.0.1",
"hashPath": "newtonsoft.json.9.0.1.nupkg.sha512"
},
+++ /dev/null
-{
- "runtimeTarget": {
- "name": ".NETCoreApp,Version=v2.0",
- "signature": "96fc3ca6f3f125daead68033f1e2c4aeaf13bd76"
- },
- "compilationOptions": {},
- "targets": {
- ".NETCoreApp,Version=v2.0": {
- "Generator.Rewrite/1.0.0": {
- "dependencies": {
- "CommandLineParser": "2.2.0",
- "Mono.Cecil": "0.10.0"
- },
- "runtime": {
- "Generator.Rewrite.dll": {}
- }
- },
- "CommandLineParser/2.2.0": {
- "dependencies": {
- "System.Collections": "4.0.11",
- "System.Console": "4.0.0-rc2-24027",
- "System.Diagnostics.Debug": "4.0.11",
- "System.Globalization": "4.0.11",
- "System.IO": "4.1.0",
- "System.Linq": "4.1.0",
- "System.Linq.Expressions": "4.0.11-rc2-24027",
- "System.Reflection": "4.1.0",
- "System.Reflection.Extensions": "4.0.1-rc2-24027",
- "System.Reflection.TypeExtensions": "4.1.0-rc2-24027",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Extensions": "4.1.0"
- },
- "runtime": {
- "lib/netstandard1.5/CommandLine.dll": {
- "assemblyVersion": "2.0.275.0",
- "fileVersion": "2.0.275.0"
- }
- }
- },
- "Microsoft.NETCore.Targets/1.0.1": {},
- "Mono.Cecil/0.10.0": {
- "dependencies": {
- "System.Collections": "4.0.11",
- "System.IO.FileSystem": "4.0.1",
- "System.IO.FileSystem.Primitives": "4.0.1",
- "System.Reflection": "4.1.0",
- "System.Runtime.Extensions": "4.1.0",
- "System.Security.Cryptography.Algorithms": "4.2.0",
- "System.Security.Cryptography.Csp": "4.0.0",
- "System.Threading": "4.0.11"
- },
- "runtime": {
- "lib/netstandard1.3/Mono.Cecil.Mdb.dll": {
- "assemblyVersion": "0.10.0.0",
- "fileVersion": "0.10.0.0"
- },
- "lib/netstandard1.3/Mono.Cecil.Pdb.dll": {
- "assemblyVersion": "0.10.0.0",
- "fileVersion": "0.10.0.0"
- },
- "lib/netstandard1.3/Mono.Cecil.Rocks.dll": {
- "assemblyVersion": "0.10.0.0",
- "fileVersion": "0.10.0.0"
- },
- "lib/netstandard1.3/Mono.Cecil.dll": {
- "assemblyVersion": "0.10.0.0",
- "fileVersion": "0.10.0.0"
- }
- }
- },
- "runtime.native.System.Security.Cryptography/4.0.0": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1"
- }
- },
- "System.Collections/4.0.11": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Collections.Concurrent/4.0.12": {
- "dependencies": {
- "System.Collections": "4.0.11",
- "System.Diagnostics.Debug": "4.0.11",
- "System.Diagnostics.Tracing": "4.1.0",
- "System.Globalization": "4.0.11",
- "System.Reflection": "4.1.0",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Extensions": "4.1.0",
- "System.Threading": "4.0.11",
- "System.Threading.Tasks": "4.0.11"
- }
- },
- "System.Console/4.0.0-rc2-24027": {
- "dependencies": {
- "System.IO": "4.1.0",
- "System.Runtime": "4.1.0",
- "System.Text.Encoding": "4.0.11"
- }
- },
- "System.Diagnostics.Debug/4.0.11": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Diagnostics.Tracing/4.1.0": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Globalization/4.0.11": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.IO/4.1.0": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0",
- "System.Text.Encoding": "4.0.11",
- "System.Threading.Tasks": "4.0.11"
- }
- },
- "System.IO.FileSystem/4.0.1": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.IO": "4.1.0",
- "System.IO.FileSystem.Primitives": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Handles": "4.0.1",
- "System.Text.Encoding": "4.0.11",
- "System.Threading.Tasks": "4.0.11"
- }
- },
- "System.IO.FileSystem.Primitives/4.0.1": {
- "dependencies": {
- "System.Runtime": "4.1.0"
- }
- },
- "System.Linq/4.1.0": {
- "dependencies": {
- "System.Collections": "4.0.11",
- "System.Diagnostics.Debug": "4.0.11",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Extensions": "4.1.0"
- }
- },
- "System.Linq.Expressions/4.0.11-rc2-24027": {
- "dependencies": {
- "System.Collections": "4.0.11",
- "System.Diagnostics.Debug": "4.0.11",
- "System.Globalization": "4.0.11",
- "System.IO": "4.1.0",
- "System.Linq": "4.1.0",
- "System.ObjectModel": "4.0.12-rc2-24027",
- "System.Reflection": "4.1.0",
- "System.Reflection.Emit": "4.0.1-rc2-24027",
- "System.Reflection.Emit.ILGeneration": "4.0.1-rc2-24027",
- "System.Reflection.Emit.Lightweight": "4.0.1-rc2-24027",
- "System.Reflection.Extensions": "4.0.1-rc2-24027",
- "System.Reflection.Primitives": "4.0.1",
- "System.Reflection.TypeExtensions": "4.1.0-rc2-24027",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Extensions": "4.1.0",
- "System.Threading": "4.0.11"
- }
- },
- "System.ObjectModel/4.0.12-rc2-24027": {
- "dependencies": {
- "System.Collections": "4.0.11",
- "System.Diagnostics.Debug": "4.0.11",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Threading": "4.0.11"
- }
- },
- "System.Reflection/4.1.0": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.IO": "4.1.0",
- "System.Reflection.Primitives": "4.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Reflection.Emit/4.0.1-rc2-24027": {
- "dependencies": {
- "System.IO": "4.1.0",
- "System.Reflection": "4.1.0",
- "System.Reflection.Emit.ILGeneration": "4.0.1-rc2-24027",
- "System.Reflection.Primitives": "4.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Reflection.Emit.ILGeneration/4.0.1-rc2-24027": {
- "dependencies": {
- "System.Reflection": "4.1.0",
- "System.Reflection.Primitives": "4.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Reflection.Emit.Lightweight/4.0.1-rc2-24027": {
- "dependencies": {
- "System.Reflection": "4.1.0",
- "System.Reflection.Emit.ILGeneration": "4.0.1-rc2-24027",
- "System.Reflection.Primitives": "4.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Reflection.Extensions/4.0.1-rc2-24027": {
- "dependencies": {
- "System.Reflection": "4.1.0",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Reflection.Primitives/4.0.1": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Reflection.TypeExtensions/4.1.0-rc2-24027": {
- "dependencies": {
- "System.Reflection": "4.1.0",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Resources.ResourceManager/4.0.1": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Globalization": "4.0.11",
- "System.Reflection": "4.1.0",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Runtime/4.1.0": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1"
- }
- },
- "System.Runtime.Extensions/4.1.0": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Runtime.Handles/4.0.1": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Runtime.InteropServices/4.1.0": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Reflection": "4.1.0",
- "System.Reflection.Primitives": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Handles": "4.0.1"
- }
- },
- "System.Runtime.Numerics/4.0.1": {
- "dependencies": {
- "System.Globalization": "4.0.11",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Extensions": "4.1.0"
- }
- },
- "System.Security.Cryptography.Algorithms/4.2.0": {
- "dependencies": {
- "System.Collections": "4.0.11",
- "System.IO": "4.1.0",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Extensions": "4.1.0",
- "System.Runtime.Handles": "4.0.1",
- "System.Runtime.InteropServices": "4.1.0",
- "System.Runtime.Numerics": "4.0.1",
- "System.Security.Cryptography.Encoding": "4.0.0",
- "System.Security.Cryptography.Primitives": "4.0.0",
- "System.Text.Encoding": "4.0.11",
- "runtime.native.System.Security.Cryptography": "4.0.0"
- },
- "runtimeTargets": {
- "runtime/unix/lib/_._": {
- "rid": "unix",
- "assetType": "runtime"
- },
- "runtime/win/lib/_._": {
- "rid": "win",
- "assetType": "runtime"
- }
- }
- },
- "System.Security.Cryptography.Csp/4.0.0": {
- "dependencies": {
- "System.IO": "4.1.0",
- "System.Reflection": "4.1.0",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Extensions": "4.1.0",
- "System.Runtime.Handles": "4.0.1",
- "System.Runtime.InteropServices": "4.1.0",
- "System.Security.Cryptography.Algorithms": "4.2.0",
- "System.Security.Cryptography.Encoding": "4.0.0",
- "System.Security.Cryptography.Primitives": "4.0.0",
- "System.Text.Encoding": "4.0.11",
- "System.Threading": "4.0.11"
- },
- "runtimeTargets": {
- "runtime/unix/lib/_._": {
- "rid": "unix",
- "assetType": "runtime"
- },
- "runtime/win/lib/_._": {
- "rid": "win",
- "assetType": "runtime"
- }
- }
- },
- "System.Security.Cryptography.Encoding/4.0.0": {
- "dependencies": {
- "System.Collections": "4.0.11",
- "System.Collections.Concurrent": "4.0.12",
- "System.Linq": "4.1.0",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Runtime.Extensions": "4.1.0",
- "System.Runtime.Handles": "4.0.1",
- "System.Runtime.InteropServices": "4.1.0",
- "System.Security.Cryptography.Primitives": "4.0.0",
- "System.Text.Encoding": "4.0.11",
- "runtime.native.System.Security.Cryptography": "4.0.0"
- },
- "runtimeTargets": {
- "runtime/unix/lib/_._": {
- "rid": "unix",
- "assetType": "runtime"
- },
- "runtime/win/lib/_._": {
- "rid": "win",
- "assetType": "runtime"
- }
- }
- },
- "System.Security.Cryptography.Primitives/4.0.0": {
- "dependencies": {
- "System.Diagnostics.Debug": "4.0.11",
- "System.Globalization": "4.0.11",
- "System.IO": "4.1.0",
- "System.Resources.ResourceManager": "4.0.1",
- "System.Runtime": "4.1.0",
- "System.Threading": "4.0.11",
- "System.Threading.Tasks": "4.0.11"
- }
- },
- "System.Text.Encoding/4.0.11": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0"
- }
- },
- "System.Threading/4.0.11": {
- "dependencies": {
- "System.Runtime": "4.1.0",
- "System.Threading.Tasks": "4.0.11"
- }
- },
- "System.Threading.Tasks/4.0.11": {
- "dependencies": {
- "Microsoft.NETCore.Targets": "1.0.1",
- "System.Runtime": "4.1.0"
- }
- }
- }
- },
- "libraries": {
- "Generator.Rewrite/1.0.0": {
- "type": "project",
- "serviceable": false,
- "sha512": ""
- },
- "CommandLineParser/2.2.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-oveEJkNGvZXAlLnUJUD0vOSwuZV1CBb35q3Oq6mRhGQSk6tiVJ4Bm9NIjh/pe8QHPbNUWnGzbjfTG3XEiTdl3w==",
- "path": "commandlineparser/2.2.0",
- "hashPath": "commandlineparser.2.2.0.nupkg.sha512"
- },
- "Microsoft.NETCore.Targets/1.0.1": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw==",
- "path": "microsoft.netcore.targets/1.0.1",
- "hashPath": "microsoft.netcore.targets.1.0.1.nupkg.sha512"
- },
- "Mono.Cecil/0.10.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-nHSF7wvyZRPAGXl49zgULPFubXHpsXlOH9RXFRUKb0TX0/tKkKljci6yBszVNI09PIDNQ8IP9WJTYvmBkMbbHw==",
- "path": "mono.cecil/0.10.0",
- "hashPath": "mono.cecil.0.10.0.nupkg.sha512"
- },
- "runtime.native.System.Security.Cryptography/4.0.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-2CQK0jmO6Eu7ZeMgD+LOFbNJSXHFVQbCJJkEyEwowh1SCgYnrn9W9RykMfpeeVGw7h4IBvYikzpGUlmZTUafJw==",
- "path": "runtime.native.system.security.cryptography/4.0.0",
- "hashPath": "runtime.native.system.security.cryptography.4.0.0.nupkg.sha512"
- },
- "System.Collections/4.0.11": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==",
- "path": "system.collections/4.0.11",
- "hashPath": "system.collections.4.0.11.nupkg.sha512"
- },
- "System.Collections.Concurrent/4.0.12": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==",
- "path": "system.collections.concurrent/4.0.12",
- "hashPath": "system.collections.concurrent.4.0.12.nupkg.sha512"
- },
- "System.Console/4.0.0-rc2-24027": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-ZkOW7ehVR6vnVTfttO0Z1uf3v7mT8cxQZbPHaGDyTt65qh4WzQOXgZYWqDNduyA1xWlvKh28XAhAkK0P39CcAA==",
- "path": "system.console/4.0.0-rc2-24027",
- "hashPath": "system.console.4.0.0-rc2-24027.nupkg.sha512"
- },
- "System.Diagnostics.Debug/4.0.11": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==",
- "path": "system.diagnostics.debug/4.0.11",
- "hashPath": "system.diagnostics.debug.4.0.11.nupkg.sha512"
- },
- "System.Diagnostics.Tracing/4.1.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==",
- "path": "system.diagnostics.tracing/4.1.0",
- "hashPath": "system.diagnostics.tracing.4.1.0.nupkg.sha512"
- },
- "System.Globalization/4.0.11": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==",
- "path": "system.globalization/4.0.11",
- "hashPath": "system.globalization.4.0.11.nupkg.sha512"
- },
- "System.IO/4.1.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==",
- "path": "system.io/4.1.0",
- "hashPath": "system.io.4.1.0.nupkg.sha512"
- },
- "System.IO.FileSystem/4.0.1": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==",
- "path": "system.io.filesystem/4.0.1",
- "hashPath": "system.io.filesystem.4.0.1.nupkg.sha512"
- },
- "System.IO.FileSystem.Primitives/4.0.1": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==",
- "path": "system.io.filesystem.primitives/4.0.1",
- "hashPath": "system.io.filesystem.primitives.4.0.1.nupkg.sha512"
- },
- "System.Linq/4.1.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-bQ0iYFOQI0nuTnt+NQADns6ucV4DUvMdwN6CbkB1yj8i7arTGiTN5eok1kQwdnnNWSDZfIUySQY+J3d5KjWn0g==",
- "path": "system.linq/4.1.0",
- "hashPath": "system.linq.4.1.0.nupkg.sha512"
- },
- "System.Linq.Expressions/4.0.11-rc2-24027": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-CfLNPBWzWdqfRGkdIXNWQ+2zSyaegOL4MAQSry0k6t8CQnPwJLywZLIZAV+cU47gi/7C2eM2I63r2eBZNJDovw==",
- "path": "system.linq.expressions/4.0.11-rc2-24027",
- "hashPath": "system.linq.expressions.4.0.11-rc2-24027.nupkg.sha512"
- },
- "System.ObjectModel/4.0.12-rc2-24027": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-8wgKzGVl3RlTMBYsWCjOizWpzH8mm7i0pv2vHwXbpV/rGptDDKzXHyTmdqFdBAfrnsnicwh79hNTc5zzKWKK1A==",
- "path": "system.objectmodel/4.0.12-rc2-24027",
- "hashPath": "system.objectmodel.4.0.12-rc2-24027.nupkg.sha512"
- },
- "System.Reflection/4.1.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==",
- "path": "system.reflection/4.1.0",
- "hashPath": "system.reflection.4.1.0.nupkg.sha512"
- },
- "System.Reflection.Emit/4.0.1-rc2-24027": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-C4kvi/Lpj5vgUtCygP0bbBnlYyuDZEU2ofdgGXa8AgV3FkmwNEqJ7zm3OhMFe/kMKRgEkJXkioFdkLHrJJLDTQ==",
- "path": "system.reflection.emit/4.0.1-rc2-24027",
- "hashPath": "system.reflection.emit.4.0.1-rc2-24027.nupkg.sha512"
- },
- "System.Reflection.Emit.ILGeneration/4.0.1-rc2-24027": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-s7puteOinRV3+sGWDLeuUbSSxwZHqHhXpLwoTlS4L0x7d58j868LbKPSPJVZAs6a/dGkyo02WHVDcEtCBjn8VQ==",
- "path": "system.reflection.emit.ilgeneration/4.0.1-rc2-24027",
- "hashPath": "system.reflection.emit.ilgeneration.4.0.1-rc2-24027.nupkg.sha512"
- },
- "System.Reflection.Emit.Lightweight/4.0.1-rc2-24027": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-kDuurD3Z1bYJrW0VqBEoHWLUCWYtto/SF/dajEj8sXftap3zkqBF+3IMb8l4EfRuzytlS2TlmFxiApbB9C8JEA==",
- "path": "system.reflection.emit.lightweight/4.0.1-rc2-24027",
- "hashPath": "system.reflection.emit.lightweight.4.0.1-rc2-24027.nupkg.sha512"
- },
- "System.Reflection.Extensions/4.0.1-rc2-24027": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-5N1tt+n0OHyaZ3Wb73FIfNsRrkFDW1I2fuAzojudgcZ0XcAHqLE0Wb9/JQ2eG6Lp89l2qntx4HvXcIDjVwvYuw==",
- "path": "system.reflection.extensions/4.0.1-rc2-24027",
- "hashPath": "system.reflection.extensions.4.0.1-rc2-24027.nupkg.sha512"
- },
- "System.Reflection.Primitives/4.0.1": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==",
- "path": "system.reflection.primitives/4.0.1",
- "hashPath": "system.reflection.primitives.4.0.1.nupkg.sha512"
- },
- "System.Reflection.TypeExtensions/4.1.0-rc2-24027": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-1t2V/qaXZjJ2krlf97bGEcqiNjriHZQv5mx3Mez2PJ2+gqJbu0vPWCSNTN8Y+miCuRm+Pwx0ZFAoCQHkij2xcQ==",
- "path": "system.reflection.typeextensions/4.1.0-rc2-24027",
- "hashPath": "system.reflection.typeextensions.4.1.0-rc2-24027.nupkg.sha512"
- },
- "System.Resources.ResourceManager/4.0.1": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==",
- "path": "system.resources.resourcemanager/4.0.1",
- "hashPath": "system.resources.resourcemanager.4.0.1.nupkg.sha512"
- },
- "System.Runtime/4.1.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==",
- "path": "system.runtime/4.1.0",
- "hashPath": "system.runtime.4.1.0.nupkg.sha512"
- },
- "System.Runtime.Extensions/4.1.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==",
- "path": "system.runtime.extensions/4.1.0",
- "hashPath": "system.runtime.extensions.4.1.0.nupkg.sha512"
- },
- "System.Runtime.Handles/4.0.1": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==",
- "path": "system.runtime.handles/4.0.1",
- "hashPath": "system.runtime.handles.4.0.1.nupkg.sha512"
- },
- "System.Runtime.InteropServices/4.1.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==",
- "path": "system.runtime.interopservices/4.1.0",
- "hashPath": "system.runtime.interopservices.4.1.0.nupkg.sha512"
- },
- "System.Runtime.Numerics/4.0.1": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-+XbKFuzdmLP3d1o9pdHu2nxjNr2OEPqGzKeegPLCUMM71a0t50A/rOcIRmGs9wR7a8KuHX6hYs/7/TymIGLNqg==",
- "path": "system.runtime.numerics/4.0.1",
- "hashPath": "system.runtime.numerics.4.0.1.nupkg.sha512"
- },
- "System.Security.Cryptography.Algorithms/4.2.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-8JQFxbLVdrtIOKMDN38Fn0GWnqYZw/oMlwOUG/qz1jqChvyZlnUmu+0s7wLx7JYua/nAXoESpHA3iw11QFWhXg==",
- "path": "system.security.cryptography.algorithms/4.2.0",
- "hashPath": "system.security.cryptography.algorithms.4.2.0.nupkg.sha512"
- },
- "System.Security.Cryptography.Csp/4.0.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-/i1Usuo4PgAqgbPNC0NjbO3jPW//BoBlTpcWFD1EHVbidH21y4c1ap5bbEMSGAXjAShhMH4abi/K8fILrnu4BQ==",
- "path": "system.security.cryptography.csp/4.0.0",
- "hashPath": "system.security.cryptography.csp.4.0.0.nupkg.sha512"
- },
- "System.Security.Cryptography.Encoding/4.0.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-FbKgE5MbxSQMPcSVRgwM6bXN3GtyAh04NkV8E5zKCBE26X0vYW0UtTa2FIgkH33WVqBVxRgxljlVYumWtU+HcQ==",
- "path": "system.security.cryptography.encoding/4.0.0",
- "hashPath": "system.security.cryptography.encoding.4.0.0.nupkg.sha512"
- },
- "System.Security.Cryptography.Primitives/4.0.0": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-Wkd7QryWYjkQclX0bngpntW5HSlMzeJU24UaLJQ7YTfI8ydAVAaU2J+HXLLABOVJlKTVvAeL0Aj39VeTe7L+oA==",
- "path": "system.security.cryptography.primitives/4.0.0",
- "hashPath": "system.security.cryptography.primitives.4.0.0.nupkg.sha512"
- },
- "System.Text.Encoding/4.0.11": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==",
- "path": "system.text.encoding/4.0.11",
- "hashPath": "system.text.encoding.4.0.11.nupkg.sha512"
- },
- "System.Threading/4.0.11": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==",
- "path": "system.threading/4.0.11",
- "hashPath": "system.threading.4.0.11.nupkg.sha512"
- },
- "System.Threading.Tasks/4.0.11": {
- "type": "package",
- "serviceable": true,
- "sha512": "sha512-k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==",
- "path": "system.threading.tasks/4.0.11",
- "hashPath": "system.threading.tasks.4.0.11.nupkg.sha512"
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-{
- "runtimeOptions": {
- "tfm": "netcoreapp2.0",
- "framework": {
- "name": "Microsoft.NETCore.App",
- "version": "2.0.0"
- }
- }
-}
\ No newline at end of file
dotnet publish -c $CONF Tools.sln
# Install
-APPS="GenDummy.Tasks ABIChecker Generator.Rewrite"
+APPS="GenDummy.Tasks ABIChecker"
for x in $APPS; do
mkdir -p $BINARY_DIR/$x
+++ /dev/null
-
-namespace OpenTK.Rewrite
-{
- internal class CountAttribute
- {
- public int Count;
- public string Parameter;
- public string Computed;
- }
-}
+++ /dev/null
-using System;
-using Mono.Cecil.Cil;
-
-namespace OpenTK.Rewrite
-{
- /// <summary>
- /// Acts as a unique identifier for a generated named variable that can be passed between methods. Replaces uses of
- /// variable names from Mono.Cecil.
- /// </summary>
- internal sealed class GeneratedVariableIdentifier
- {
- /// <summary>
- /// The <see cref="MethodBody"/> which the variable is in.
- /// </summary>
- public MethodBody Body { get; }
-
- /// <summary>
- /// The <see cref="VariableDefinition"/> which the variable idetifier maps to.
- /// </summary>
- public VariableDefinition Definition { get; }
-
- /// <summary>
- /// The name of the generated variable.
- /// </summary>
- public string Name { get; }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="GeneratedVariableIdentifier"/> class.
- /// </summary>
- /// <param name="body">The method body which the variable is in.</param>
- /// <param name="definition">The definition of the generated variable.</param>
- /// <param name="name">The name of the generated variable.</param>
- /// <exception cref="ArgumentException"></exception>
- public GeneratedVariableIdentifier(MethodBody body, VariableDefinition definition, string name)
- {
- if (body == null)
- {
- throw new ArgumentException("The body argument cannot be null.", nameof(body));
- }
-
- if (definition == null)
- {
- throw new ArgumentException("The definition argument cannot be null.", nameof(definition));
- }
-
- if (string.IsNullOrEmpty(name))
- {
- throw new ArgumentException("The name argument cannot be null or empty", nameof(name));
- }
-
- this.Body = body;
- this.Definition = definition;
- this.Name = name;
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <OutputType>exe</OutputType>
- <TargetFramework>netcoreapp2.0</TargetFramework>
- </PropertyGroup>
-
- <PropertyGroup>
- <AssemblyName>Generator.Rewrite</AssemblyName>
- <Deterministic>True</Deterministic>
- <DefineConstants>NET_CORE</DefineConstants>
- <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
- <NoWarn>$(NoWarn);NU1605</NoWarn>
- </PropertyGroup>
-
- <ItemGroup>
- <PackageReference Include="Mono.Cecil" Version="0.10.0" />
- <PackageReference Include="CommandLineParser" Version="2.2.0" />
- </ItemGroup>
-
-</Project>
+++ /dev/null
-using Mono.Cecil;
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace OpenTK.Rewrite
-{
- /// This is based on the Mono.Cecil BaseAssemblyResolver. But with
- /// additions to GetCorlib but with some extra code to check for -api
- /// directories which we're added by mono in the 4.4 release. Without this
- /// we can end up adding assembly references to mscorlib 4.0 even though
- /// OpenTK is compiled for 2.0.
- internal sealed class OpenTKAssemblyResolver : IAssemblyResolver
- {
- static readonly bool on_mono = Type.GetType("Mono.Runtime") != null;
-
- readonly List<string> directories;
-
- List<string> gac_paths;
-
- public OpenTKAssemblyResolver()
- {
- directories = new List<string>(2) { ".", "bin" };
- }
-
- AssemblyDefinition GetAssembly(string file, ReaderParameters parameters)
- {
- if (parameters.AssemblyResolver == null)
- parameters.AssemblyResolver = this;
-
- return ModuleDefinition.ReadModule(file, parameters).Assembly;
- }
-
- public AssemblyDefinition Resolve(AssemblyNameReference name)
- {
- return Resolve(name, new ReaderParameters());
- }
-
- public AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters)
- {
- var assembly = SearchDirectory(name, directories, parameters);
- if (assembly != null)
- return assembly;
-
- if (name.IsRetargetable)
- {
- // if the reference is retargetable, zero it
- name = new AssemblyNameReference(name.Name, new Version(0, 0, 0, 0))
- {
- PublicKeyToken = new byte[0],
- };
- }
-
- var framework_dir = Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName);
- var framework_dirs = on_mono
- ? new[] { framework_dir, Path.Combine(framework_dir, "Facades") }
- : new[] { framework_dir };
-
- if (IsZero(name.Version))
- {
- assembly = SearchDirectory(name, framework_dirs, parameters);
- if (assembly != null)
- return assembly;
- }
-
- if (name.Name == "mscorlib")
- {
- assembly = GetCorlib(name, parameters);
- if (assembly != null)
- return assembly;
- }
-
- assembly = GetAssemblyInGac(name, parameters);
- if (assembly != null)
- return assembly;
-
- assembly = SearchDirectory(name, framework_dirs, parameters);
- if (assembly != null)
- return assembly;
-
- throw new AssemblyResolutionException(name);
- }
-
- AssemblyDefinition SearchDirectory(AssemblyNameReference name, IEnumerable<string> directories, ReaderParameters parameters)
- {
- var extensions = name.IsWindowsRuntime ? new[] { ".winmd", ".dll" } : new[] { ".exe", ".dll" };
- foreach (var directory in directories)
- {
- foreach (var extension in extensions)
- {
- string file = Path.Combine(directory, name.Name + extension);
- if (!File.Exists(file))
- continue;
- try
- {
- var assembly = GetAssembly(file, parameters);
- if (assembly.Name.Version == name.Version || IsZero(name.Version))
- {
- return assembly;
- }
- }
- catch (System.BadImageFormatException)
- {
- continue;
- }
- }
- }
-
- return null;
- }
-
- static bool IsZero(Version version)
- {
- return version.Major == 0 && version.Minor == 0 && version.Build == 0 && version.Revision == 0;
- }
-
- AssemblyDefinition GetCorlib(AssemblyNameReference reference, ReaderParameters parameters)
- {
- var version = reference.Version;
- var corlib = typeof(object).Assembly.GetName();
-
- if (corlib.Version == version || IsZero(version))
- return GetAssembly(typeof(object).Module.FullyQualifiedName, parameters);
-
- var path = Directory.GetParent(
- Directory.GetParent(
- typeof(object).Module.FullyQualifiedName).FullName
- ).FullName;
-
- if (on_mono)
- {
- if (version.Major == 1)
- path = Path.Combine(path, "1.0");
- else if (version.Major == 2)
- {
- if (version.MajorRevision == 5)
- path = Path.Combine(path, "2.1");
- else
- path = Path.Combine(path, "2.0");
- }
- else if (version.Major == 4)
- path = Path.Combine(path, "4.0");
- else
- throw new NotSupportedException("Version not supported: " + version);
- }
- else
- {
- switch (version.Major)
- {
- case 1:
- if (version.MajorRevision == 3300)
- path = Path.Combine(path, "v1.0.3705");
- else
- path = Path.Combine(path, "v1.0.5000.0");
- break;
- case 2:
- path = Path.Combine(path, "v2.0.50727");
- break;
- case 4:
- path = Path.Combine(path, "v4.0.30319");
- break;
- default:
- throw new NotSupportedException("Version not supported: " + version);
- }
- }
-
- var file = Path.Combine(path, "mscorlib.dll");
- if (File.Exists(file))
- return GetAssembly(file, parameters);
- else if (on_mono && Directory.Exists(path + "-api"))
- {
- path = path + "-api";
- file = Path.Combine(path, "mscorlib.dll");
- if (File.Exists(file))
- return GetAssembly(file, parameters);
- }
-
- return null;
- }
-
- static List<string> GetGacPaths()
- {
- if (on_mono)
- return GetDefaultMonoGacPaths();
-
- var paths = new List<string>(2);
- var windir = Environment.GetEnvironmentVariable("WINDIR");
- if (windir == null)
- return paths;
-
- paths.Add(Path.Combine(windir, "assembly"));
- paths.Add(Path.Combine(windir, Path.Combine("Microsoft.NET", "assembly")));
- return paths;
- }
-
- static List<string> GetDefaultMonoGacPaths()
- {
- var paths = new List<string>(1);
- var gac = GetCurrentMonoGac();
- if (gac != null)
- paths.Add(gac);
-
- var gac_paths_env = Environment.GetEnvironmentVariable("MONO_GAC_PREFIX");
- if (string.IsNullOrEmpty(gac_paths_env))
- return paths;
-
- var prefixes = gac_paths_env.Split(Path.PathSeparator);
- foreach (var prefix in prefixes)
- {
- if (string.IsNullOrEmpty(prefix))
- continue;
-
- var gac_path = Path.Combine(Path.Combine(Path.Combine(prefix, "lib"), "mono"), "gac");
- if (Directory.Exists(gac_path) && !paths.Contains(gac))
- paths.Add(gac_path);
- }
-
- return paths;
- }
-
- static string GetCurrentMonoGac()
- {
- return Path.Combine(
- Directory.GetParent(
- Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)).FullName,
- "gac");
- }
-
- AssemblyDefinition GetAssemblyInGac(AssemblyNameReference reference, ReaderParameters parameters)
- {
- if (reference.PublicKeyToken == null || reference.PublicKeyToken.Length == 0)
- return null;
-
- if (gac_paths == null)
- gac_paths = GetGacPaths();
-
- if (on_mono)
- return GetAssemblyInMonoGac(reference, parameters);
-
- return GetAssemblyInNetGac(reference, parameters);
- }
-
- AssemblyDefinition GetAssemblyInMonoGac(AssemblyNameReference reference, ReaderParameters parameters)
- {
- for (int i = 0; i < gac_paths.Count; i++)
- {
- var gac_path = gac_paths[i];
- var file = GetAssemblyFile(reference, string.Empty, gac_path);
- if (File.Exists(file))
- {
- var assembly = GetAssembly(file, parameters);
- if (assembly.Name.Version == reference.Version || IsZero(reference.Version))
- {
- return assembly;
- }
- }
- }
-
- return null;
- }
-
- AssemblyDefinition GetAssemblyInNetGac(AssemblyNameReference reference, ReaderParameters parameters)
- {
- var gacs = new[] { "GAC_MSIL", "GAC_32", "GAC_64", "GAC" };
- var prefixes = new[] { string.Empty, "v4.0_" };
-
- for (int i = 0; i < 2; i++)
- {
- for (int j = 0; j < gacs.Length; j++)
- {
- var gac = Path.Combine(gac_paths[i], gacs[j]);
- var file = GetAssemblyFile(reference, prefixes[i], gac);
- if (Directory.Exists(gac) && File.Exists(file))
- {
- var assembly = GetAssembly(file, parameters);
- if (assembly.Name.Version == reference.Version || IsZero(reference.Version))
- {
- return assembly;
- }
- }
- }
- }
-
- return null;
- }
-
- static string GetAssemblyFile(AssemblyNameReference reference, string prefix, string gac)
- {
- var gac_folder = new System.Text.StringBuilder()
- .Append(prefix)
- .Append(reference.Version)
- .Append("__");
-
- for (int i = 0; i < reference.PublicKeyToken.Length; i++)
- gac_folder.Append(reference.PublicKeyToken[i].ToString("x2"));
-
- return Path.Combine(
- Path.Combine(
- Path.Combine(gac, reference.Name), gac_folder.ToString()),
- reference.Name + ".dll");
- }
-
- void IDisposable.Dispose() { }
- }
-}
+++ /dev/null
-using CommandLine;
-using CommandLine.Text;
-
-namespace OpenTK.Rewrite
-{
- /// <summary>
- /// A container class used by <see cref="CommandLine.Parser"/> to parse command line arguments.
- /// </summary>
- public class Options
- {
- /// <summary>
- /// Gets or sets the path to the target assembly that should be rewritten.
- /// </summary>
- [Option('a', "assembly", Required = true,
- HelpText = "The path to the target assembly that should be rewritten.")]
- public string TargetAssembly { get; set; }
-
- /// <summary>
- /// Get or sets the path to the strong name key which should be used to sign or resign the assembly.
- /// </summary>
- [Option('k', "signing-key",
- HelpText = "The path to the strong name key which should be used to sign or resign the assembly.")]
- public string StrongNameKey { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether calls to GL.GetError() are wrapped around each native call.
- /// </summary>
- [Option('d', "debug", Default = false,
- HelpText = "Enable calls to GL.GetError(), wrapped around each native call.")]
- public bool EnableDebugCalls { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether native calls are forced to use DllImport instead of GetProcAddress.
- /// </summary>
- [Option("dllimport", Default = false,
- HelpText = "Force native calls to use DllImport instead of GetProcAddress.")]
- public bool UseDLLImport { get; set; }
- }
-}
+++ /dev/null
-// OpenTK.Rewrite: IL rewriter for OpenTK.dll
-// Copyright (C) 2013 Stefanos Apostolopoulos
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using CommandLine;
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-using Mono.Cecil.Rocks;
-
-namespace OpenTK.Rewrite
-{
- // Replaces OpenTK.InteropHelper method instances
- // with the s IL instructions.
- internal class Program
- {
-#if NET_CORE
- private static readonly String CoreLibName = "netstandard";
-#else
- private static readonly String CoreLibName = "mscorlib";
-#endif
-
-
- private static Options Options;
-
- private static void Main(string[] args)
- {
- Parser.Default.ParseArguments<Options>(args)
- .WithParsed(result => Options = result)
- .WithNotParsed(error => Environment.Exit(-1));
-
- // Argument error checking
- if (!File.Exists(Options.TargetAssembly))
- {
- Console.Error.WriteLine($"Target assembly not found. \n" +
- $"Please check the given path ({Options.TargetAssembly}).");
- }
-
- if (!File.Exists(Path.ChangeExtension(Options.TargetAssembly, "pdb")))
- {
- Console.Error.WriteLine("Debugging symbols for target assembly not found. \n" +
- "Please make sure that debugging symbols are being generated.");
- }
-
- var program = new Program();
- program.Rewrite();
- }
-
- // mscorlib types
- private static AssemblyDefinition mscorlib;
-
- private static TypeDefinition TypeMarshal;
- private static TypeDefinition TypeVoid;
- private static TypeDefinition TypeIntPtr;
- private static TypeDefinition TypeInt32;
-
- // OpenTK.BindingsBase
- private static TypeDefinition TypeBindingsBase;
-
- private void Rewrite()
- {
- // Specify assembly read and write parameters
- // We want to keep a valid symbols file (pdb or mdb)
- var read_params = new ReaderParameters();
- var write_params = new WriterParameters();
-
-#if NET_CORE
- var defaultResolver = new DefaultAssemblyResolver();
- defaultResolver.AddSearchDirectory(Path.GetDirectoryName(Options.TargetAssembly));
- read_params.AssemblyResolver = defaultResolver;
-
-#else
- read_params.AssemblyResolver = new OpenTKAssemblyResolver();
-#endif
- read_params.ReadSymbols = true;
- read_params.ReadWrite = true;
- write_params.WriteSymbols = true;
-
-#if !NET_CORE
- if (!String.IsNullOrEmpty(Options.StrongNameKey) && File.Exists(Options.StrongNameKey))
- {
- string absoluteKeyFilePath = Path.GetFullPath(Options.StrongNameKey);
-
- using (var fs = new FileStream(absoluteKeyFilePath, FileMode.Open, FileAccess.Read))
- {
- var keypair = new System.Reflection.StrongNameKeyPair(fs);
- write_params.StrongNameKeyPair = keypair;
- }
- }
- else
- {
- Console.Error.WriteLine("No keyfile specified or keyfile missing.");
- }
-#endif
- // Load assembly and process all modules
- try
- {
- using (AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(Options.TargetAssembly, read_params))
- {
- var rewritten = assembly.CustomAttributes.FirstOrDefault(a => a.AttributeType.Name == "RewrittenAttribute");
- if (rewritten == null)
- {
- foreach (var module in assembly.Modules)
- {
- foreach (var reference in module.AssemblyReferences)
- {
- try
- {
- var resolved = module.AssemblyResolver.Resolve(reference);
- if (reference.Name == CoreLibName)
- {
- mscorlib = resolved;
- }
- }
- catch (Exception e)
- {
- Console.Error.WriteLine(e.ToString());
- }
- }
- }
-
- if (mscorlib == null)
- {
- Console.Error.WriteLine($"Failed to locate {CoreLibName}");
- return;
- }
- TypeMarshal = GetType(mscorlib.MainModule, "System.Runtime.InteropServices.Marshal");
- TypeVoid = GetType(mscorlib.MainModule, "System.Void");
- TypeIntPtr = GetType(mscorlib.MainModule, "System.IntPtr");
- TypeInt32 = GetType(mscorlib.MainModule, "System.Int32");
-
- TypeBindingsBase = assembly.Modules.Select(m => GetType(m, "OpenTK.BindingsBase")).First();
-
- foreach (var module in assembly.Modules)
- {
- foreach (var type in module.Types)
- {
- Rewrite(type);
- }
- }
- }
- else
- {
- Console.Error.WriteLine("Error: assembly has already been rewritten");
- }
-
- // Save rewritten assembly
- assembly.Write(write_params);
- }
- }
- catch (InvalidOperationException inex)
- {
- Console.WriteLine("Failed to load the assembly. It may already have been rewritten, and the debug symbols no longer match.");
- Console.WriteLine(inex);
- }
- }
-
- private void Rewrite(TypeDefinition type)
- {
- var entry_points = type.Fields.FirstOrDefault(f => f.Name == "EntryPoints");
- if (entry_points != null)
- {
- // Build list of entry point signatures (one per entry point)
- var entry_signatures = new List<MethodDefinition>();
- entry_signatures.AddRange(type.Methods
- .Where(t => t.CustomAttributes.Any(a => a.AttributeType.Name == "SlotAttribute")));
-
- Rewrite(type, entry_points, entry_signatures);
-
- RemoveNativeSignatures(type, entry_signatures);
- }
-
- if (type.Name == "RewrittenAttribute")
- {
- var rewritten_constructor = type.GetConstructors().First();
- var rewritten = new CustomAttribute(rewritten_constructor);
- rewritten.ConstructorArguments.Add(new CustomAttributeArgument(
- type.Module.ImportReference(GetType(mscorlib.MainModule, "System.Boolean")), true));
- type.Module.Assembly.CustomAttributes.Add(rewritten);
- }
- }
-
- private static TypeDefinition GetType(ModuleDefinition module, string ns, string name)
- {
- return GetType(module, ns + "." + name);
- }
-
- private static TypeDefinition GetType(ModuleDefinition module, string fullName)
- {
- TypeDefinition type = module.GetType(fullName);
- if (type == null && module.HasExportedTypes)
- {
- var exportedType = module.ExportedTypes.Where(t => t.FullName == fullName && t.IsForwarder).FirstOrDefault();
- type = exportedType.Resolve();
- }
- return type;
- }
-
- private static int GetSlot(MethodDefinition signature)
- {
- // Pretend there is no slots if we want to force everything to work through DllImport (Android & iOS)
- if (Options.UseDLLImport)
- {
- return -1;
- }
-
- var slot_attribute = signature.CustomAttributes
- .FirstOrDefault(a => a.AttributeType.Name == "SlotAttribute");
- int slot =
- slot_attribute != null ?
- (int)slot_attribute.ConstructorArguments[0].Value :
- -1;
-
- return slot;
- }
-
- private void Rewrite(TypeDefinition type, FieldDefinition entry_points,
- List<MethodDefinition> entry_signatures)
- {
- // Rewrite all wrapper methods
- var wrapper_signatures = new List<MethodDefinition>();
- wrapper_signatures.AddRange(type.Methods
- .Where(m => m.IsPublic && m.CustomAttributes.Any(a => a.AttributeType.Name == "AutoGeneratedAttribute")));
-
- foreach (var wrapper in wrapper_signatures)
- {
- var autogenerated = wrapper.CustomAttributes
- .Where(a => a.AttributeType.Name == "AutoGeneratedAttribute").ToList();
- if (autogenerated.Any())
- {
- var signature_name = (string)autogenerated.First()
- .Fields.First(f => f.Name == "EntryPoint").Argument.Value;
- var signature = entry_signatures.FirstOrDefault(s => s.Name == signature_name);
- int slot = GetSlot(signature);
-
- ProcessMethod(wrapper, signature, slot, entry_points);
- }
- }
-
- RemoveSupportingAttributes(type);
-
- if (type.NestedTypes.Count > 0)
- {
- foreach (var nested_type in type.NestedTypes)
- {
- Rewrite(nested_type, entry_points, entry_signatures);
- }
- }
- }
-
- private static void RemoveNativeSignatures(TypeDefinition type, IEnumerable<MethodDefinition> methods)
- {
- // Remove all DllImports for functions called through calli, since
- // their signatures are embedded directly into the calli callsite.
- // This reduces dll size by ~400KB.
- foreach (var m in methods.Where(s => GetSlot(s) != -1))
- {
- type.Methods.Remove(m);
- }
- }
-
- private static void RemoveSupportingAttributes(TypeDefinition type)
- {
- foreach (var method in type.Methods)
- {
- var attr = method.CustomAttributes;
- for (int i = 0; i < attr.Count; i++)
- {
- if (attr[i].AttributeType.Name == "AutoGeneratedAttribute")
- {
- attr.RemoveAt(i);
- i--;
- }
- }
-
- foreach (var parameter in method.Parameters)
- {
- var pattr = parameter.CustomAttributes;
- for (int i = 0; i < pattr.Count; i++)
- {
- if (pattr[i].AttributeType.Name == "CountAttribute")
- {
- pattr.RemoveAt(i);
- i--;
- }
- }
- }
- }
- }
-
- // Create body for method
- private static void ProcessMethod(MethodDefinition wrapper, MethodDefinition native, int slot,
- FieldDefinition entry_points)
- {
- var body = wrapper.Body;
- var il = body.GetILProcessor();
- var instructions = body.Instructions;
- instructions.Clear();
-
- // Declare pinned variables for every reference and array parameter
- // and push each parameter on the stack
-
- DebugVariables vars = null;
- if (Options.EnableDebugCalls)
- {
- vars = EmitDebugPrologue(wrapper, il);
- }
-
- // Patch convenience wrappers
- List<GeneratedVariableIdentifier> generatedVariables = new List<GeneratedVariableIdentifier>();
- if (wrapper.Parameters.Count == native.Parameters.Count)
- {
- generatedVariables = EmitParameters(wrapper, native, body, il);
- }
- else
- {
- int difference = native.Parameters.Count - wrapper.Parameters.Count;
- generatedVariables = EmitConvenienceWrapper(wrapper, native, difference, body, il);
- }
-
- if (slot == -1 || Options.UseDLLImport)
- {
- // issue DllImport call
- EmitCall(il, native);
- }
- else
- {
- // push the entry point address on the stack
- EmitEntryPoint(entry_points, il, slot);
-
- // issue calli
- EmitCalli(il, native);
- }
-
- if (wrapper.ReturnType.Name != "Void")
- {
- EmitReturnTypeWrapper(wrapper, native, body, il);
- }
-
- EmitParameterEpilogues(wrapper, native, body, il, generatedVariables);
-
- if (Options.EnableDebugCalls)
- {
- EmitDebugEpilogue(wrapper, il, vars);
- }
-
- // return
- il.Emit(OpCodes.Ret);
-
- if (body.Variables.Count > 0)
- {
- // Required for verifiable executables
- // (otherwise peverify complains bitterly)
- body.InitLocals = true;
- }
- body.OptimizeMacros();
- }
-
- private class DebugVariables
- {
- public TypeDefinition ErrorHelperType;
- public VariableDefinition ErrorHelperLocal;
- public MethodReference Get_CurrentContext;
- public MethodReference Set_ErrorChecking;
- public Instruction BeginTry;
- }
-
- private static DebugVariables EmitDebugPrologue(MethodDefinition wrapper, ILProcessor il)
- {
-
- DebugVariables vars = null;
- if (il.Body.Method.Name != "GetError")
- {
- // Pull out the namespace name, method fullname will look
- // something like "type namespace.class::method(type arg)"
- var module = il.Body.Method.FullName;
- module = module.Substring(module.IndexOf(' ') + 1);
- module = module.Substring(0, module.IndexOf("::", StringComparison.Ordinal));
- module = module.Substring(0, module.LastIndexOf('.'));
-
- // Only works for Graphics modules due to hardcoded use of
- // OpenTK.Graphics.GraphicsContext
- if (module == "OpenTK.Graphics.OpenGL4" ||
- module == "OpenTK.Graphics.OpenGL" ||
- module == "OpenTK.Graphics.ES10" ||
- module == "OpenTK.Graphics.ES11" ||
- module == "OpenTK.Graphics.ES20" ||
- module == "OpenTK.Graphics.ES30")
- {
- var errorHelperType = GetType(wrapper.Module, module, "ErrorHelper");
-
- if (errorHelperType != null)
- {
- vars = new DebugVariables();
- vars.ErrorHelperType = errorHelperType;
-
- // GraphicsContext type
- var graphicsContext = wrapper.Module.Types.First(
- type => type.FullName == "OpenTK.Graphics.GraphicsContext");
-
- // IGraphicsContext type
- var iGraphicsContext = wrapper.Module.Types.First(
- type => type.FullName == "OpenTK.Graphics.IGraphicsContext");
-
- // Get the constructor that takes a GraphicsContext parameter
- var ctor = vars.ErrorHelperType.GetConstructors().FirstOrDefault(
- c => c.Parameters.Count == 1 &&
- c.Parameters[0].ParameterType.FullName == iGraphicsContext.FullName);
-
- if (ctor == null)
- {
- throw new InvalidOperationException(
- String.Format(
- "{0} does needs a constructor taking {1}",
- errorHelperType,
- graphicsContext));
- }
-
- // GraphicsContext.CurrentContext property getter
- vars.Get_CurrentContext = graphicsContext.Methods.First(
- method => method.Name == "get_CurrentContext");
-
- vars.Set_ErrorChecking = graphicsContext.Methods.First(
- method => method.Name == "set_ErrorChecking");
-
- vars.ErrorHelperLocal = new VariableDefinition(vars.ErrorHelperType);
-
- // using (new ErrorHelper(GraphicsContext.CurrentContext)) { ...
- il.Body.Variables.Add(vars.ErrorHelperLocal);
- il.Emit(OpCodes.Ldloca, vars.ErrorHelperLocal);
- il.Emit(OpCodes.Call, vars.Get_CurrentContext);
- il.Emit(OpCodes.Call, ctor);
-
- vars.BeginTry = Instruction.Create(OpCodes.Nop);
- il.Append(vars.BeginTry);
-
- // Special case Begin to turn off error checking.
- if (il.Body.Method.Name == "Begin")
- {
- il.Emit(OpCodes.Call, vars.Get_CurrentContext);
- il.Emit(OpCodes.Ldc_I4_0);
- il.Emit(OpCodes.Conv_I1);
- il.Emit(OpCodes.Call, vars.Set_ErrorChecking);
- }
- }
- }
- }
-
- return vars;
- }
-
- private static void EmitDebugEpilogue(MethodDefinition wrapper, ILProcessor il, DebugVariables vars)
- {
- if (vars != null)
- {
- var disposeMethod = vars.ErrorHelperType.Methods.First(
- method => method.Name == "Dispose");
-
- // Store then reload the result from the call
- var resultLocal = new VariableDefinition(wrapper.ReturnType);
- if (resultLocal.VariableType.FullName != Program.TypeVoid.FullName)
- {
- il.Body.Variables.Add(resultLocal);
- il.Emit(OpCodes.Stloc, resultLocal);
- }
-
- // Special case End to turn on error checking.
- if (il.Body.Method.Name == "End")
- {
- il.Emit(OpCodes.Call, vars.Get_CurrentContext);
- il.Emit(OpCodes.Ldc_I4_1);
- il.Emit(OpCodes.Conv_I1);
- il.Emit(OpCodes.Call, vars.Set_ErrorChecking);
- }
-
- // We need a NOP to set up the finally handler range correctly.
- var nopInstruction = Instruction.Create(OpCodes.Nop);
- var loadInstruction = Instruction.Create(OpCodes.Ldloca, vars.ErrorHelperLocal);
- var disposeInstruction = Instruction.Create(OpCodes.Call, disposeMethod);
- var endFinallyInstruction = Instruction.Create(OpCodes.Endfinally);
- var endTryInstruction = Instruction.Create(OpCodes.Leave, nopInstruction);
-
- il.Append(endTryInstruction);
- il.Append(loadInstruction);
- il.Append(disposeInstruction);
- il.Append(endFinallyInstruction);
- il.Append(nopInstruction);
-
- var finallyHandler = new ExceptionHandler(ExceptionHandlerType.Finally);
- finallyHandler.TryStart = vars.BeginTry;
- finallyHandler.TryEnd = loadInstruction;
- finallyHandler.HandlerStart = loadInstruction;
- finallyHandler.HandlerEnd = nopInstruction;
-
- il.Body.ExceptionHandlers.Add(finallyHandler);
-
- if (resultLocal.VariableType.FullName != Program.TypeVoid.FullName)
- {
- il.Emit(OpCodes.Ldloc, resultLocal);
- }
- }
- }
-
- private static void EmitReturnTypeWrapper(MethodDefinition wrapper, MethodDefinition native, MethodBody body, ILProcessor il)
- {
- if (wrapper.Parameters.Count < native.Parameters.Count)
- {
- // Convenience wrapper. The result is stored in the last local variable
- il.Emit(OpCodes.Ldloc, body.Variables.Count - 1);
- }
- else if (wrapper.ReturnType != native.ReturnType)
- {
- if (wrapper.ReturnType.Name == "String")
- {
- // String return-type wrapper
- // return new string((sbyte*)((void*)GetString()));
-
- var intptr_to_voidpointer = wrapper.Module.ImportReference(GetType(mscorlib.MainModule, "System.IntPtr").GetMethods()
- .First(m =>
- {
- return
- m.Name == "op_Explicit" &&
- m.ReturnType.Name == "Void*";
- }));
-
- var string_constructor = wrapper.Module.ImportReference(GetType(mscorlib.MainModule, "System.String").GetConstructors()
- .First(m =>
- {
- var p = m.Parameters;
- return p.Count > 0 && p[0].ParameterType.Name == "SByte*";
- }));
-
- il.Emit(OpCodes.Call, intptr_to_voidpointer);
- il.Emit(OpCodes.Newobj, string_constructor);
- }
- else if (wrapper.ReturnType.Resolve().IsEnum)
- {
- // Nothing to do
- }
- else if (wrapper.ReturnType.Name == "Boolean" && native.ReturnType.Name == "Byte")
- {
- // Nothing to do
- // It appears that a byte with 1 = true (GL_TRUE) and 0 = false (GL_FALSE)
- // can be reinterpreted as a bool without a problem.
- // Todo: maybe we should return (value == 0 ? false : true) just to be
- // on the safe side?
- }
- else
- {
- Console.Error.WriteLine("Return wrapper for '{1}' not implemented yet ({0})", native.Name, wrapper.ReturnType.Name);
- }
- }
- else
- {
- // nothing to do, the native call leaves the return value
- // on the stack and we return that unmodified to the caller.
- }
- }
-
- private static void EmitParameterEpilogues(MethodDefinition wrapper, MethodDefinition native, MethodBody body, ILProcessor il,
- List<GeneratedVariableIdentifier> generatedVariables)
- {
- foreach (var p in wrapper.Parameters)
- {
- if (!p.ParameterType.IsArray && p.ParameterType.Name == "String&")
- {
- EmitStringOutEpilogue(wrapper, native, p, body, il, GetGeneratedVariable(generatedVariables, p.Name + "_string_ptr", body));
- }
-
- if (!p.ParameterType.IsArray && p.ParameterType.Name == "String")
- {
- EmitStringEpilogue(wrapper, p, body, il, GetGeneratedVariable(generatedVariables, p.Name + "_string_ptr", body));
- }
-
- if (p.ParameterType.IsArray && p.ParameterType.GetElementType().Name == "String")
- {
- EmitStringArrayEpilogue(wrapper, p, body, il, GetGeneratedVariable(generatedVariables, p.Name + "_string_array_ptr", body));
- }
- }
- }
-
- /// <summary>
- /// Retrieves a generated variable by searching the given list by the variable's name and associated method body.
- /// </summary>
- /// <param name="variableIdentifiers"></param>
- /// <param name="name"></param>
- /// <param name="body"></param>
- /// <returns></returns>
- private static GeneratedVariableIdentifier GetGeneratedVariable(IEnumerable<GeneratedVariableIdentifier> variableIdentifiers, string name, MethodBody body)
- {
- return variableIdentifiers.FirstOrDefault(v => v.Name == name && v.Body == body &&
- body.Variables.Contains(v.Definition));
- }
-
- private static GeneratedVariableIdentifier EmitStringOutParameter(MethodDefinition method, ParameterDefinition parameter, MethodBody body, ILProcessor il)
- {
- // void GetShaderInfoLog(..., out String foo)
- // IntPtr foo_string_ptr;
- // try {
- // foo_string_ptr = Marshal.AllocHGlobal(count + 1);
- // glGetShaderInfoLog(..., foo_string_ptr);
- // foo = MarshalPtrToString(foo_string_ptr);
- // }
- // finally {
- // Marshal.FreeHGlobal(foo_string_ptr);
- // }
-
- // Pop off the string parameter that would of just been loaded
- il.Emit(OpCodes.Pop);
-
- // Make sure we have imported Marshal::AllocHGlobal
- var alloc_hglobal = method.Module.ImportReference(TypeMarshal.Methods.First(m => m.Name == "AllocHGlobal"));
-
- // IntPtr ptr;
- var variableDefinition = new VariableDefinition(TypeIntPtr);
- body.Variables.Add(variableDefinition);
- int stringPtrIndex = body.Variables.Count - 1;
-
- GeneratedVariableIdentifier stringPtrVar = new GeneratedVariableIdentifier(body, variableDefinition, parameter.Name + "_string_ptr");
-
- // ptr = Marshal.AllocHGlobal(count + 1);
- var count = GetCountAttribute(parameter);
- if (count == null)
- {
- // We need a count attribute so we know what size to make the
- // string buffer. Currently every string out parameter has a
- // count attribute but this check is in place to make things
- // clearer if this case is ever hit.
- throw new InvalidOperationException(string.Format("{0}({1}) doesn't have a count attribute", method.Name, parameter.Name));
- }
-
- if (count.Count != 0)
- {
- // Fixed size
- il.Emit(OpCodes.Ldc_I4, count.Count);
- }
- else if (count.Parameter != null)
- {
- // Parameter sized
- var countVariable = EmitCountVariable(method, body, il, count.Parameter);
- il.Emit(OpCodes.Ldloc, countVariable.Index);
- }
- else if (count.Computed != null)
- {
- if (method.Name == "GetActiveVarying")
- {
- // GetActiveVaryingNV's name parameter has a count of "COMPSIZE(program,index,bufSize)" but really it should be bufSize.
- var countVariable = EmitCountVariable(method, body, il, "bufSize");
- il.Emit(OpCodes.Ldloc, countVariable.Index);
- }
- else
- {
- // Computed counts are hard and require manual reading of the specification for each one.
- throw new NotSupportedException(string.Format("{0}({1}) requires a computed count: {2}", method.Name, parameter.Name, count.Computed));
- }
- }
-
- il.Emit(OpCodes.Ldc_I4, 1);
- il.Emit(OpCodes.Add);
- il.Emit(OpCodes.Call, alloc_hglobal);
- il.Emit(OpCodes.Stloc, stringPtrIndex);
- il.Emit(OpCodes.Ldloc, stringPtrIndex);
-
- // We'll emit the try-finally block in the epilogue implementation,
- // because we haven't yet emitted all necessary instructions here.
-
- return stringPtrVar;
- }
-
- private static void EmitStringOutEpilogue(MethodDefinition wrapper, MethodDefinition native,
- ParameterDefinition parameter, MethodBody body, ILProcessor il, GeneratedVariableIdentifier generatedPtrVar)
- {
- if (generatedPtrVar == null)
- {
- throw new ArgumentNullException(nameof(generatedPtrVar));
- }
-
- // void GetShaderInfoLog(..., out String foo)
- // IntPtr foo_string_ptr;
- // try {
- // foo_string_ptr = Marshal.AllocHGlobal(count + 1);
- // glGetShaderInfoLog(..., foo_string_ptr);
- // foo = MarshalPtrToString(foo_string_ptr);
- // }
- // finally {
- // Marshal.FreeHGlobal(foo_string_ptr);
- // }
-
- // Make sure we have imported BindingsBase::MasrhalPtrToString and Marshal::FreeHGlobal
- var ptr_to_str = wrapper.Module.ImportReference(TypeBindingsBase.Methods.First(m => m.Name == "MarshalPtrToString"));
- var free_hglobal = wrapper.Module.ImportReference(TypeMarshal.Methods.First(m => m.Name == "FreeHGlobal"));
-
- var block = new ExceptionHandler(ExceptionHandlerType.Finally);
- block.TryStart = body.Instructions[0];
-
- il.Emit(OpCodes.Ldarg, parameter.Index);
- il.Emit(OpCodes.Ldloc, generatedPtrVar.Definition.Index);
- il.Emit(OpCodes.Call, ptr_to_str);
- il.Emit(OpCodes.Stind_Ref);
-
- block.TryEnd = body.Instructions.Last();
- block.HandlerStart = body.Instructions.Last();
-
- il.Emit(OpCodes.Ldloc, generatedPtrVar.Definition.Index);
- il.Emit(OpCodes.Call, free_hglobal);
-
- block.HandlerEnd = body.Instructions.Last();
- }
-
- private static GeneratedVariableIdentifier EmitStringParameter(MethodDefinition wrapper, ParameterDefinition parameter, MethodBody body,
- ILProcessor il)
- {
- // string marshaling:
- // IntPtr ptr = MarshalStringToPtr(str);
- // try { calli }
- // finally { Marshal.FreeHGlobal(ptr); }
- var marshal_str_to_ptr = wrapper.Module.ImportReference(TypeBindingsBase.Methods.First(m => m.Name == "MarshalStringToPtr"));
-
- // IntPtr ptr;
- var variableDefinition = new VariableDefinition(TypeIntPtr);
- body.Variables.Add(variableDefinition);
- int generatedPointerVarIndex = body.Variables.Count - 1;
-
- GeneratedVariableIdentifier stringPtrVar = new GeneratedVariableIdentifier(body, variableDefinition, parameter.Name + "_string_ptr");
-
- // ptr = Marshal.StringToHGlobalAnsi(str);
- il.Emit(OpCodes.Call, marshal_str_to_ptr);
- il.Emit(OpCodes.Stloc, generatedPointerVarIndex);
- il.Emit(OpCodes.Ldloc, generatedPointerVarIndex);
-
- // The finally block will be emitted in the function epilogue
- return stringPtrVar;
- }
-
- private static void EmitStringEpilogue(MethodDefinition wrapper, ParameterDefinition parameter, MethodBody body,
- ILProcessor il, GeneratedVariableIdentifier generatedPtrVar)
- {
- var free = wrapper.Module.ImportReference(TypeBindingsBase.Methods.First(m => m.Name == "FreeStringPtr"));
-
- // FreeStringPtr(ptr)
- il.Emit(OpCodes.Ldloc, generatedPtrVar.Definition.Index);
- il.Emit(OpCodes.Call, free);
- }
-
- private static GeneratedVariableIdentifier EmitStringArrayParameter(MethodDefinition wrapper, ParameterDefinition parameter, MethodBody body,
- ILProcessor il)
- {
- // string[] masrhaling:
- // IntPtr ptr = MarshalStringArrayToPtr(strings);
- // try { calli }
- // finally { FreeStringArrayPtr(ptr); }
- var marshal_str_array_to_ptr = wrapper.Module.ImportReference(TypeBindingsBase.Methods.First(m => m.Name == "MarshalStringArrayToPtr"));
-
- // IntPtr ptr;
- var variableDefinition = new VariableDefinition(TypeIntPtr);
- body.Variables.Add(variableDefinition);
- int generatedPointerVarIndex = body.Variables.Count - 1;
-
- GeneratedVariableIdentifier stringArrayPtrVar = new GeneratedVariableIdentifier(body, variableDefinition, parameter.Name + "_string_array_ptr");
-
- // ptr = MarshalStringArrayToPtr(strings);
- il.Emit(OpCodes.Call, marshal_str_array_to_ptr);
- il.Emit(OpCodes.Stloc, generatedPointerVarIndex);
- il.Emit(OpCodes.Ldloc, generatedPointerVarIndex);
-
- // The finally block will be emitted in the function epilogue
-
- return stringArrayPtrVar;
- }
-
- private static void EmitStringArrayEpilogue(MethodDefinition wrapper, ParameterDefinition parameter, MethodBody body,
- ILProcessor il, GeneratedVariableIdentifier generatedPtrVar)
- {
- if (generatedPtrVar == null)
- {
- throw new ArgumentNullException(nameof(generatedPtrVar));
- }
-
- // Note: only works for string vectors (1d arrays).
- // We do not (and will probably never) support 2d or higher string arrays
- var free = wrapper.Module.ImportReference(TypeBindingsBase.Methods.First(m => m.Name == "FreeStringArrayPtr"));
-
- // FreeStringArrayPtr(string_array_ptr, string_array.Length)
-
- // load string_array_ptr
- il.Emit(OpCodes.Ldloc, generatedPtrVar.Definition.Index);
-
- // load string_array.Length
- il.Emit(OpCodes.Ldarg, parameter.Index);
- il.Emit(OpCodes.Ldlen);
- il.Emit(OpCodes.Conv_I4);
-
- // call FreeStringArrayPtr
- il.Emit(OpCodes.Call, free);
- }
-
- private static List<GeneratedVariableIdentifier> EmitConvenienceWrapper(MethodDefinition wrapper,
- MethodDefinition native, int difference, MethodBody body, ILProcessor il)
- {
- if (wrapper.Parameters.Count > 2)
- {
- // Todo: emit all parameters bar the last two
- throw new NotImplementedException();
- }
-
-
- List<GeneratedVariableIdentifier> generatedVariables = new List<GeneratedVariableIdentifier>();
- if (wrapper.ReturnType.Name != "Void")
- {
- if (difference == 2)
- {
- // Convert sized out-array/reference to return value, for example:
- // void GenTextures(int n, int[] textures) -> int GenTexture()
- // {
- // const int n = 1;
- // int buffers;
- // calli GenTextures(n, &textures);
- // return result;
- // }
- body.Variables.Add(new VariableDefinition(wrapper.ReturnType));
- il.Emit(OpCodes.Ldc_I4, 1); // const int n = 1
- il.Emit(OpCodes.Ldloca, body.Variables.Count - 1); // &buffers
- }
- else if (difference == 1)
- {
- // Convert unsized out-array/reference to return value, for example:
- // void GetBoolean(GetPName pname, out bool data) -> bool GetBoolean(GetPName pname)
- // {
- // bool result;
- // GetBooleanv(pname, &result);
- // return result;
- // }
- body.Variables.Add(new VariableDefinition(wrapper.ReturnType));
-
- generatedVariables = EmitParameters(wrapper, native, body, il);
- il.Emit(OpCodes.Ldloca, body.Variables.Count - 1);
- }
- else
- {
- Console.Error.WriteLine("Unknown wrapper type for ({0})", native.Name);
- }
- }
- else
- {
- if (difference == 1)
- {
- // Convert in-array/reference to single element, for example:
- // void DeleteTextures(int n, ref int textures) -> void DeleteTexture(int texture)
- // {
- // const int n = 1;
- // calli DeleteTextures(n, &textures);
- // }
- il.Emit(OpCodes.Ldc_I4, 1); // const int n = 1
- il.Emit(OpCodes.Ldarga, wrapper.Parameters.Last()); // &textures
- }
- else
- {
- Console.Error.WriteLine("Unknown wrapper type for ({0})", native.Name);
- }
- }
-
- return generatedVariables;
- }
-
- private static object GetAttributeField(CustomAttribute attribute, string name)
- {
- try
- {
- var field = attribute.Fields.First(f => f.Name == name);
- return field.Argument.Value;
- }
- catch (InvalidOperationException)
- {
- return null;
- }
- }
-
- private static CountAttribute GetCountAttribute(ParameterDefinition parameter)
- {
- var attribute = parameter.CustomAttributes
- .FirstOrDefault(a => a.AttributeType.Name == "CountAttribute");
-
- CountAttribute count = null;
- if (attribute != null)
- {
- count = new CountAttribute();
- count.Count = (int)(GetAttributeField(attribute, "Count") ?? 0);
- count.Parameter = (string)(GetAttributeField(attribute, "Parameter"));
- count.Computed = (string)(GetAttributeField(attribute, "Computed"));
- }
- return count;
- }
-
-
- private static VariableDefinition EmitCountVariable(MethodDefinition method, MethodBody body, ILProcessor il, string countParameter)
- {
- var countVariable = new VariableDefinition(TypeInt32);
- body.Variables.Add(countVariable);
-
- // Parameter will either by a simple name, a dereference of a name
- // like "*name" or an expression like "name*5"
- var parameter = method.Parameters.FirstOrDefault(
- param => param.Name == countParameter);
- if (parameter != null)
- {
- il.Emit(OpCodes.Ldarg, parameter.Index);
- il.Emit(OpCodes.Stloc, countVariable.Index);
- }
- else if (countParameter[0] == '*')
- {
- var pointerParam = method.Parameters.FirstOrDefault(
- param => param.Name == countParameter.Substring(1));
-
- il.Emit(OpCodes.Ldarg, pointerParam.Index);
- il.Emit(OpCodes.Ldind_I4);
- }
- else
- {
- var operands = countParameter.Split('*');
- parameter = method.Parameters.FirstOrDefault(
- param => param.Name == operands[0]);
- var scale = int.Parse(operands[1]);
-
- il.Emit(OpCodes.Ldarg, parameter.Index);
- il.Emit(OpCodes.Ldc_I4, scale);
- il.Emit(OpCodes.Mul);
- il.Emit(OpCodes.Stloc, countVariable.Index);
- }
- return countVariable;
- }
-
- private static List<GeneratedVariableIdentifier> EmitParameters(MethodDefinition method, MethodDefinition native, MethodBody body, ILProcessor il)
- {
- List<GeneratedVariableIdentifier> generatedVariables = new List<GeneratedVariableIdentifier>();
- for (int i = 0; i < method.Parameters.Count; i++)
- {
- var parameter = method.Parameters[i];
- var p = method.Module.ImportReference(method.Parameters[i].ParameterType);
- il.Emit(OpCodes.Ldarg, i);
-
- if (p.Name.Contains("Int32") && native.Parameters[i].ParameterType.Name.Contains("IntPtr"))
- {
- // This is a convenience Int32 overload for an IntPtr (size_t) parameter.
- // We need to convert the loaded argument to IntPtr.
- il.Emit(OpCodes.Conv_I);
- }
- else if (p.Name == "String&" && !p.IsArray)
- {
- generatedVariables.Add(EmitStringOutParameter(method, parameter, body, il));
- }
- else if (p.Name == "String" && !p.IsArray)
- {
- generatedVariables.Add(EmitStringParameter(method, parameter, body, il));
- }
- else if (p.IsByReference)
- {
- body.Variables.Add(new VariableDefinition(new PinnedType(p)));
- var index = body.Variables.Count - 1;
- il.Emit(OpCodes.Stloc, index);
- il.Emit(OpCodes.Ldloc, index);
- il.Emit(OpCodes.Conv_I);
- }
- else if (p.IsArray)
- {
- if (p.Name != "String[]")
- {
- // .Net treats 1d arrays differently than higher rank arrays.
- // 1d arrays are directly supported by instructions such as ldlen and ldelema.
- // Higher rank arrays must be accessed through System.Array methods such as get_Length.
- // 1d array:
- // check array is not null
- // check ldlen array > 0
- // ldc.i4.0
- // ldelema
- // 2d array:
- // check array is not null
- // check array.get_Length() > 0
- // ldc.i4.0
- // ldc.i4.0
- // call instance T& T[0..., 0...]::Address(int32, int32)
- // Mono treats everything as a 1d array.
- // Interestingly, the .Net approach works on both Mono and .Net.
- // The Mono approach fails when using high-rank arrays on .Net.
- // We should report a bug to http://bugzilla.xamarin.com
-
- // Pin the array and pass the address
- // of its first element.
- var array = (ArrayType)p;
- var element_type = p.GetElementType();
- body.Variables.Add(new VariableDefinition(new PinnedType(new ByReferenceType(element_type))));
- int pinned_index = body.Variables.Count - 1;
-
- var empty = il.Create(OpCodes.Ldc_I4, 0);
- var pin = il.Create(OpCodes.Ldarg, i);
- var end = il.Create(OpCodes.Stloc, pinned_index);
-
- // if (array == null) goto empty
- il.Emit(OpCodes.Brfalse, empty);
-
- // else if (array.Length != 0) goto pin
- il.Emit(OpCodes.Ldarg, i);
- if (array.Rank == 1)
- {
- il.Emit(OpCodes.Ldlen);
- il.Emit(OpCodes.Conv_I4);
- }
- else
- {
- var get_length = method.Module.ImportReference(
- GetType(mscorlib.MainModule, "System.Array").Methods.First(m => m.Name == "get_Length"));
- il.Emit(OpCodes.Callvirt, get_length);
- }
- il.Emit(OpCodes.Brtrue, pin);
-
- // empty: IntPtr ptr = IntPtr.Zero
- il.Append(empty);
- il.Emit(OpCodes.Conv_U);
- il.Emit(OpCodes.Br, end);
-
- // pin: &array[0]
- il.Append(pin);
- if (array.Rank == 1)
- {
- // 1d array (vector), address is taken by ldelema
- il.Emit(OpCodes.Ldc_I4, 0);
- il.Emit(OpCodes.Ldelema, element_type);
- }
- else
- {
- // 2d-3d array, address must be taken as follows:
- // call instance T& T[0..., 0..., 0...]::Address(int, int, int)
- ByReferenceType t_ref = array.ElementType.MakeByReferenceType();
- MethodReference get_address = new MethodReference("Address", t_ref, array);
- for (int r = 0; r < array.Rank; r++)
- {
- get_address.Parameters.Add(new ParameterDefinition(TypeInt32));
- }
- get_address.HasThis = true;
-
- // emit the get_address call
- for (int r = 0; r < array.Rank; r++)
- {
- il.Emit(OpCodes.Ldc_I4, 0);
- }
- il.Emit(OpCodes.Call, get_address);
- }
-
- // end: fixed (IntPtr ptr = &array[0])
- il.Append(end);
- il.Emit(OpCodes.Ldloc, pinned_index);
- il.Emit(OpCodes.Conv_I);
- }
- else
- {
- generatedVariables.Add(EmitStringArrayParameter(method, parameter, body, il));
- }
- }
- }
-
- return generatedVariables;
- }
-
- private static void EmitEntryPoint(FieldDefinition entry_points, ILProcessor il, int slot)
- {
- il.Emit(OpCodes.Ldsfld, entry_points);
- il.Emit(OpCodes.Ldc_I4, slot);
- il.Emit(OpCodes.Ldelem_I);
- }
-
- private static void EmitCalli(ILProcessor il, MethodReference reference)
- {
- var signature = new CallSite(reference.ReturnType)
- {
- CallingConvention = MethodCallingConvention.StdCall,
- };
-
- foreach (var p in reference.Parameters)
- {
- signature.Parameters.Add(p);
- }
-
- // Since the last parameter is always the entry point address,
- // we do not need any special preparation before emiting calli.
- il.Emit(OpCodes.Calli, signature);
- }
-
- private static void EmitCall(ILProcessor il, MethodReference reference)
- {
- il.Emit(OpCodes.Call, reference);
- }
- }
-}
+++ /dev/null
-// <auto-generated/>
-using System;
-using System.Reflection;
-
-[assembly: AssemblyTitleAttribute("Generator.Rewrite")]
-[assembly: AssemblyProductAttribute("OpenTK")]
-[assembly: AssemblyDescriptionAttribute("A set of fast, low-level C# bindings for OpenGL, OpenGL ES and OpenAL.")]
-[assembly: AssemblyVersionAttribute("3.0.0")]
-[assembly: AssemblyFileVersionAttribute("3.0.0")]
-[assembly: CLSCompliantAttribute(true)]
-[assembly: AssemblyCopyrightAttribute("Copyright (c) 2006 - 2016 Stefanos Apostolopoulos <stapostol@gmail.com> for the Open Toolkit library.")]
-namespace System {
- internal static class AssemblyVersionInformation {
- internal const System.String AssemblyTitle = "Generator.Rewrite";
- internal const System.String AssemblyProduct = "OpenTK";
- internal const System.String AssemblyDescription = "A set of fast, low-level C# bindings for OpenGL, OpenGL ES and OpenAL.";
- internal const System.String AssemblyVersion = "3.0.0";
- internal const System.String AssemblyFileVersion = "3.0.0";
- internal const System.Boolean CLSCompliant = true;
- internal const System.String AssemblyCopyright = "Copyright (c) 2006 - 2016 Stefanos Apostolopoulos <stapostol@gmail.com> for the Open Toolkit library.";
- }
-}