From 6226e80ebee5d882a71efd339cd168eedf117bb5 Mon Sep 17 00:00:00 2001 From: "Denis Kuzmin [ github.com/3F ]" Date: Sat, 14 Jul 2018 20:53:45 +0300 Subject: [PATCH] MvsSln project has been added as an git submodule for more convenient support. --- .gitmodules | 3 +++ .vssbe | 27 +++++++++++++------------ DllExport.sln | 45 +++++++++++++++++++++++++++++++++++++++++- MvsSln | 1 + Readme.md | 28 +++++++++++++------------- Wizard/Wizard.csproj | 8 ++++---- Wizard/packages.config | 4 ---- packages_restore.cmd | 10 +++++++++- submodules.bat | 3 +++ 9 files changed, 92 insertions(+), 37 deletions(-) create mode 160000 MvsSln delete mode 100644 Wizard/packages.config diff --git a/.gitmodules b/.gitmodules index 2200a70..bd7cf0e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "GetNuTool"] path = GetNuTool url = https://github.com/3F/GetNuTool.git +[submodule "MvsSln"] + path = MvsSln + url = https://github.com/3F/MvsSln.git diff --git a/.vssbe b/.vssbe index 01388de..00a5615 100644 --- a/.vssbe +++ b/.vssbe @@ -91,7 +91,7 @@ "Mode": { "$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent", "Type": "Script", - "Command": "#[($(Configuration) == \"PublicRelease\") {\n #[$(cfgname = 'Release')]\n}\nelse{\n #[$(cfgname = $(Configuration))]\n}]\n\n#[$(dbin = \"bin/$(cfgname)/\")]\n\n$(revDeltaBase = \"2016/10/12\")\n$(revDeltaMin = $([System.Math]::Pow(10, 3)))\n$$(revDeltaMax = $([System.Math]::Pow(10, 5)))\n$(revDeltaMax = 65534) #[\" limit of AssemblyVersion (2^16 - 2) - i.e. 65534 max allowed \"]\n\n$(pDllExport = \"RGiesecke.DllExport\")\n$(pMeta = \"Metadata\")\n$(pNSBin = \"NSBin\")\n$(pConf = \"Configurator\")\n$(pWizard = \"Wizard\")\n$(pPeViewer = \"PeViewer\")\n$(pGetNuTool = \"GetNuTool\")\n$(pMSBuild = \"RGiesecke.DllExport.MSBuild\")\n$(odir = \"$(dbin)raw/\")\n\n#[IO delete.directory(\"$(dbin)\", true)]\n#[IO copy.directory(\"\", \"$(dbin)\", true)]", + "Command": "#[($(Configuration) == \"PublicRelease\") {\n #[$(cfgname = 'Release')]\n}\nelse{\n #[$(cfgname = $(Configuration))]\n}]\n\n#[$(dbin = \"bin/$(cfgname)/\")]\n\n$(revDeltaBase = \"2016/10/12\")\n$(revDeltaMin = $([System.Math]::Pow(10, 3)))\n$$(revDeltaMax = $([System.Math]::Pow(10, 5)))\n$(revDeltaMax = 65534) #[\" limit of AssemblyVersion (2^16 - 2) - i.e. 65534 max allowed \"]\n\n$(pDllExport = \"RGiesecke.DllExport\")\n$(pMeta = \"Metadata\")\n$(pNSBin = \"NSBin\")\n$(pMvsSln = \"MvsSln\")\n$(pConf = \"Configurator\")\n$(pWizard = \"Wizard\")\n$(pPeViewer = \"PeViewer\")\n$(pGetNuTool = \"GetNuTool\")\n$(pMSBuild = \"RGiesecke.DllExport.MSBuild\")\n$(odir = \"$(dbin)raw/\")\n\n#[IO delete.directory(\"$(dbin)\", true)]\n#[IO copy.directory(\"\", \"$(dbin)\", true)]", "Command__": [ "#[($(Configuration) == \"PublicRelease\") {", " #[$(cfgname = 'Release')]", @@ -110,6 +110,7 @@ "$(pDllExport = \"RGiesecke.DllExport\")", "$(pMeta = \"Metadata\")", "$(pNSBin = \"NSBin\")", + "$(pMvsSln = \"MvsSln\")", "$(pConf = \"Configurator\")", "$(pWizard = \"Wizard\")", "$(pPeViewer = \"PeViewer\")", @@ -125,7 +126,7 @@ { "Enabled": true, "Name": "ActSubmodules", - "Caption": "git submodules", + "Caption": "submodules and packages", "SupportMSBuild": true, "SupportSBEScripts": true, "IgnoreIfBuildFailed": false, @@ -145,16 +146,24 @@ "Mode": { "$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent", "Type": "Script", - "Command": "#[$(moduleGetNuTool = \"GetNuTool/gnt.sln\")]\n\n#[( #[IO exists.file(\"$(moduleGetNuTool)\")] )\n{ \n #[File scall(\"submodules.bat\", \"$(moduleGetNuTool)\", 400)]\n}\nelse{\n #[File call(\"submodules.bat\", \"$(moduleGetNuTool)\", 2000)]\n}]", + "Command": "#[$(moduleGetNuTool = \"GetNuTool/gnt.sln\")]\n\n#[( #[IO exists.file(\"$(moduleGetNuTool)\")] )\n{ \n ##[File scall(\"submodules.bat\", \"$(moduleGetNuTool)\", 400)]\n #[File call(\"submodules.bat\", \"$(moduleGetNuTool)\", 2000)]\n}\nelse{\n #[File call(\"submodules.bat\", \"$(moduleGetNuTool)\", 2000)]\n}]\n\n#[\" Packages \"]\n\n#[( !(#[IO exists.directory(\"packages\")]) || !(#[IO exists.directory(\"$(pMvsSln)/packages\")]) )\n{\n #[File call(\"packages_restore.cmd\", \"\", 2000)]\n}]", "Command__": [ "#[$(moduleGetNuTool = \"GetNuTool/gnt.sln\")]", "", "#[( #[IO exists.file(\"$(moduleGetNuTool)\")] )", "{ ", - " #[File scall(\"submodules.bat\", \"$(moduleGetNuTool)\", 400)]", + " ##[File scall(\"submodules.bat\", \"$(moduleGetNuTool)\", 400)]", + " #[File call(\"submodules.bat\", \"$(moduleGetNuTool)\", 2000)]", "}", "else{", " #[File call(\"submodules.bat\", \"$(moduleGetNuTool)\", 2000)]", + "}]", + "", + "#[\" Packages \"]", + "", + "#[( !(#[IO exists.directory(\"packages\")]) || !(#[IO exists.directory(\"$(pMvsSln)/packages\")]) )", + "{", + " #[File call(\"packages_restore.cmd\", \"\", 2000)]", "}]" ] } @@ -484,16 +493,8 @@ "Mode": { "$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent", "Type": "Script", - "Command": "#[( #[IO exists.directory(\"packages/ILAsm/bin\")] )\n{ \n #[File scall(\"packages_restore.cmd\", \"\", 400)]\n}\nelse{\n #[File call(\"packages_restore.cmd\", \"\", 2000)]\n}]\n\n#[IO copy.file({\n \"packages/ILAsm/bin/Win.x86/*.dll\",\n \"packages/ILAsm/bin/Win.x86/*.exe\",\n \"packages/ILAsm/*.txt\",\n \"packages/ILAsm/*.md\"\n }, \n \"$(odir)/tools/coreclr/\", true)]", + "Command": "#[IO copy.file({\n \"packages/ILAsm/bin/Win.x86/*.dll\",\n \"packages/ILAsm/bin/Win.x86/*.exe\",\n \"packages/ILAsm/*.txt\",\n \"packages/ILAsm/*.md\"\n }, \n \"$(odir)/tools/coreclr/\", true)]", "Command__": [ - "#[( #[IO exists.directory(\"packages/ILAsm/bin\")] )", - "{ ", - " #[File scall(\"packages_restore.cmd\", \"\", 400)]", - "}", - "else{", - " #[File call(\"packages_restore.cmd\", \"\", 2000)]", - "}]", - "", "#[IO copy.file({", " \"packages/ILAsm/bin/Win.x86/*.dll\",", " \"packages/ILAsm/bin/Win.x86/*.exe\",", diff --git a/DllExport.sln b/DllExport.sln index 9e03a95..21d8e4e 100644 --- a/DllExport.sln +++ b/DllExport.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27004.2002 +VisualStudioVersion = 15.0.26430.13 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGiesecke.DllExport", "RGiesecke.DllExport\RGiesecke.DllExport.csproj", "{AC6947C6-0637-429A-A5F1-54447A494E6D}" EndProject @@ -30,6 +30,29 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{44F550ED tools\net.r_eg.DllExport.targets = tools\net.r_eg.DllExport.targets EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MvsSln", "MvsSln", "{4862DD29-ED07-4342-9E4D-CDAE89433A88}" + ProjectSection(SolutionItems) = preProject + MvsSln\.gitignore = MvsSln\.gitignore + MvsSln\.version = MvsSln\.version + MvsSln\build.bat = MvsSln\build.bat + MvsSln\changelog.txt = MvsSln\changelog.txt + MvsSln\License.txt = MvsSln\License.txt + MvsSln\packages.config = MvsSln\packages.config + MvsSln\Readme.md = MvsSln\Readme.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".gnt", ".gnt", "{D221D332-2A57-44F9-B866-F7C00C29032D}" + ProjectSection(SolutionItems) = preProject + GetNuTool\.gitignore = GetNuTool\.gitignore + GetNuTool\.version = GetNuTool\.version + GetNuTool\build.bat = GetNuTool\build.bat + GetNuTool\changelog.txt = GetNuTool\changelog.txt + GetNuTool\LICENSE = GetNuTool\LICENSE + GetNuTool\logic.targets = GetNuTool\logic.targets + GetNuTool\packages.config = GetNuTool\packages.config + GetNuTool\Readme.md = GetNuTool\Readme.md + EndProjectSection +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{55898433-0EEF-4B38-B144-B2A40150E4F4}" ProjectSection(SolutionItems) = preProject .vssbe = .vssbe @@ -52,6 +75,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wizard", "Wizard\Wizard.csp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PeViewer", "PeViewer\PeViewer.csproj", "{BE8C8005-A6C6-41D0-9DB0-6B4B7BD1077F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvsSln", "MvsSln\MvsSln\MvsSln.csproj", "{F905DFB2-2E67-4FF7-9001-924F6F2D645D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvsSlnTest", "MvsSln\MvsSlnTest\MvsSlnTest.csproj", "{EC0CA220-39EC-41E5-B9D6-88D8F860F979}" + ProjectSection(ProjectDependencies) = postProject + {F905DFB2-2E67-4FF7-9001-924F6F2D645D} = {F905DFB2-2E67-4FF7-9001-924F6F2D645D} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -107,12 +137,25 @@ Global {BE8C8005-A6C6-41D0-9DB0-6B4B7BD1077F}.PublicRelease|Any CPU.Build.0 = Release|Any CPU {BE8C8005-A6C6-41D0-9DB0-6B4B7BD1077F}.Release|Any CPU.ActiveCfg = Release|Any CPU {BE8C8005-A6C6-41D0-9DB0-6B4B7BD1077F}.Release|Any CPU.Build.0 = Release|Any CPU + {F905DFB2-2E67-4FF7-9001-924F6F2D645D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F905DFB2-2E67-4FF7-9001-924F6F2D645D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F905DFB2-2E67-4FF7-9001-924F6F2D645D}.PublicRelease|Any CPU.ActiveCfg = Release|Any CPU + {F905DFB2-2E67-4FF7-9001-924F6F2D645D}.PublicRelease|Any CPU.Build.0 = Release|Any CPU + {F905DFB2-2E67-4FF7-9001-924F6F2D645D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F905DFB2-2E67-4FF7-9001-924F6F2D645D}.Release|Any CPU.Build.0 = Release|Any CPU + {EC0CA220-39EC-41E5-B9D6-88D8F860F979}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC0CA220-39EC-41E5-B9D6-88D8F860F979}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC0CA220-39EC-41E5-B9D6-88D8F860F979}.PublicRelease|Any CPU.ActiveCfg = Release|Any CPU + {EC0CA220-39EC-41E5-B9D6-88D8F860F979}.PublicRelease|Any CPU.Build.0 = Release|Any CPU + {EC0CA220-39EC-41E5-B9D6-88D8F860F979}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC0CA220-39EC-41E5-B9D6-88D8F860F979}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {44F550ED-6D5E-45CB-8FD0-CBB35051B8E1} = {E623294B-0FEA-4FA2-BA15-2750FE503F50} + {4862DD29-ED07-4342-9E4D-CDAE89433A88} = {E623294B-0FEA-4FA2-BA15-2750FE503F50} {55898433-0EEF-4B38-B144-B2A40150E4F4} = {E623294B-0FEA-4FA2-BA15-2750FE503F50} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/MvsSln b/MvsSln new file mode 160000 index 0000000..3a97c3a --- /dev/null +++ b/MvsSln @@ -0,0 +1 @@ +Subproject commit 3a97c3a4ef944f7952825191e6f98563a2195bad diff --git a/Readme.md b/Readme.md index b66d1f7..5e3dbf1 100644 --- a/Readme.md +++ b/Readme.md @@ -16,23 +16,22 @@ Copyright (c) 2016-2018 Denis Kuzmin :: github.com/3F [![MvsSln](https://img.shields.io/badge/MvsSln-v2.0.0-865FC5.svg)](https://github.com/3F/MvsSln) [![Conari](https://img.shields.io/badge/Conari-v1.3.0-8AA875.svg)](https://github.com/3F/Conari) - -**[Quick start:](https://github.com/3F/DllExport/wiki/Quick-start)** - [`DllExport`](https://3f.github.io/DllExport/releases/latest/manager/)` -action Configure` [[?](#how-to-get-dllexport)] -> *[How to (Screencast)](https://www.youtube.com/watch?v=sBWt-KdQtoc)* +> 1:[ ***[Quick start](https://www.youtube.com/watch?v=sBWt-KdQtoc)*** ] 2:[ [C++ ❤ C# 💕C++](https://www.youtube.com/watch?v=9Hyg3_WE9Ks) ] 3:[ [Complex types and Strings](https://www.youtube.com/watch?v=QXMj9-8XJnY) ] +> -> { **[Wiki](https://github.com/3F/DllExport/wiki)** } + -~~~---~~~ +`~~~---~~~` ```csharp [DllExport("Init", CallingConvention.Cdecl)] -public static int entrypoint(IntPtr L) +public static int entrypoint(IntPtr l) { // ... it will be called from Lua script - lua_pushcclosure(L, onProc, 0); - lua_setglobal(L, "onKeyDown"); + lua_pushcclosure(l, onProc, 0); + lua_setglobal(l, "onKeyDown"); return 0; } @@ -57,7 +56,7 @@ Where to look ? v1.2+ provides dynamic definitions of namespaces (ddNS feature), ```cpp Via Cecil or direct modification: - 000005B0 00 C4 7B 01 00 00 00 2F 00 12 05 .{..../... + 000005B0 00 C4 7B 01 00 00 00 2F 00 12 05 .Д{..../... 000005C0 00 00 02 00 00 00 00 00 00 00 00 00 00 00 26 00 ..............&. 000005D0 20 02 00 00 00 00 00 00 00 49 2E 77 61 6E 74 2E ........I.want. <<<- 000005E0 74 6F 2E 66 6C 79 00 00 00 00 00 00 00 00 00 00 to.fly.......... <<<- @@ -79,7 +78,7 @@ Our Wizard and embeddable manager: [Initially](https://github.com/3F/DllExport/issues/3) the original tool `UnmanagedExports` was distributed by Robert Giesecke as an closed-source tool **under the [MIT License](https://opensource.org/licenses/mit-license.php)**: * [Official page](https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports) - *posted Jul 9, 2009 [ updated Dec 19, 2012 ]* -* [Official NuGet Packages](https://www.nuget.org/packages/UnmanagedExports) +* [Official NuGet Packages](https://www.nuget.org/packages/UnmanagedExports) Now, we will be more open ! all details [here](https://github.com/3F/DllExport/issues/3) @@ -131,14 +130,14 @@ Read also my explanations from here: [about mscoree](https://github.com/3F/DllEx ### How to get DllExport -**v1.6+** have no official support of any standard NuGet clients. [[?](https://github.com/3F/DllExport/issues/38)] +**v1.6+** have no official support of any standard NuGet clients. [[?](https://github.com/3F/DllExport/wiki/DllExport-Manager-Q-A)] * [New Wizard and embeddable manager](https://www.youtube.com/watch?v=sBWt-KdQtoc) - * [Quick start](https://github.com/3F/DllExport/wiki/Quick-start) + * Wiki. [Quick start](https://github.com/3F/DllExport/wiki/Quick-start) -Get [DllExport.bat](https://3F.github.io/DllExport/releases/latest/manager/) (text-based script ~18 Kb without powershell and dotnet-cli) from any place. For example, you can still get it from packages via NuGet server ([how to](https://youtu.be/okPThdWDZMM?t=1m1s)) or it also can be embedded inside any other your scripts/project files/etc. +Get [DllExport.bat](https://3F.github.io/DllExport/releases/latest/manager/) from any place. For example, you can still get it from packages via NuGet server ([how to](https://youtu.be/okPThdWDZMM?t=1m1s)) or it also can be embedded inside any other your scripts/project files/etc. -DllExport.**bat** mainly is a wrapper that's based on [GetNuTool core](https://github.com/3F/GetNuTool). Finally it just aggregates calling to Wizard that's based on [MvsSln](https://github.com/3F/MvsSln). [[?](https://github.com/3F/DllExport/issues/63#issuecomment-354633464)] +*DllExport.bat was based on [GetNuTool core](https://github.com/3F/GetNuTool) that's Cross-Platform Embeddable Package Manager that requires only MSBuild. Finally it just aggregates calling to Wizard that was based on [MvsSln](https://github.com/3F/MvsSln). [[?](https://github.com/3F/DllExport/wiki/DllExport-Manager-Q-A#is-this-cross-platform-solution-)]* **Please note**: You do not need to call manually DllExport.bat after initial configuration. It still will be **automatically** for `-action Restore` command etc. @@ -174,6 +173,7 @@ Other variants: * (deprecated) NuGet Commandline: `nuget install DllExport` * [/releases](https://github.com/3F/DllExport/releases) [ [latest](https://github.com/3F/DllExport/releases/latest) ] * [Nightly builds](https://ci.appveyor.com/project/3Fs/dllexport/history) (`/artifacts` page). But remember: It can be unstable or not work at all. Use this for tests of latest changes. + * Artifacts [older than 6 months](https://www.appveyor.com/docs/packaging-artifacts/#artifacts-retention-policy) you can also find as `Pre-release` with mark `🎲 Nightly build` on [GitHub Releases](https://github.com/3F/DllExport/releases) page. ### How to Build diff --git a/Wizard/Wizard.csproj b/Wizard/Wizard.csproj index 92aa41e..69d0d2e 100644 --- a/Wizard/Wizard.csproj +++ b/Wizard/Wizard.csproj @@ -46,9 +46,6 @@ True - - ..\packages\MvsSln.2.0.0\lib\net40\MvsSln.dll - @@ -125,9 +122,12 @@ Always Designer - + + {f905dfb2-2e67-4ff7-9001-924f6f2d645d} + MvsSln + {311706a5-5ed2-4006-b794-055009d8a256} NSBin diff --git a/Wizard/packages.config b/Wizard/packages.config deleted file mode 100644 index daf295c..0000000 --- a/Wizard/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/packages_restore.cmd b/packages_restore.cmd index 99dda2c..c96e2d7 100644 --- a/packages_restore.cmd +++ b/packages_restore.cmd @@ -13,10 +13,18 @@ set _gntArgs=%* :found echo. -echo. [ Restoring of packages. Please wait ... ] +echo. [ Restoring packages. Please wait ... ] echo. +:: - +echo. +echo MvsSln ... +call %_gnt% %_gntArgs% /p:wpath="%cd%/MvsSln" /p:ngconfig="packages.config;MvsSlnTest/packages.config" /nologo /v:m /m:4 || goto err + +:: - +echo. +echo General ... call %_gnt% %_gntArgs% /p:wpath="%cd%" /p:ngconfig="packages.config;Wizard/packages.config;PeViewer/packages.config;NSBin/packages.config;RGiesecke.DllExport/packages.config;RGiesecke.DllExport.MSBuild/packages.config" /nologo /v:m /m:4 || goto err goto exit diff --git a/submodules.bat b/submodules.bat index 2a193da..f371105 100644 --- a/submodules.bat +++ b/submodules.bat @@ -25,6 +25,9 @@ echo. :: GetNuTool git submodule update --init --recursive GetNuTool || goto gitNotFound +:: MvsSln +git submodule update --init --recursive MvsSln || goto gitNotFound + :: TODO option for expensive coreclr exit /B 0