From 1006d6907540e5c68ecf4dce5820fbbee9dde555 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Mon, 14 Sep 2020 20:48:45 +0100 Subject: [PATCH 1/2] fix autowrap excel --- excel/dub.sdl | 1 + excel/source/autowrap/excel/package.d | 66 +++++++++++++-------------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/excel/dub.sdl b/excel/dub.sdl index 7892f27f..0bf38083 100644 --- a/excel/dub.sdl +++ b/excel/dub.sdl @@ -5,3 +5,4 @@ license "BSD" targetType "sourceLibrary" dependency "excel-d" version=">=0.5.5" +dependency "autowrap:common" path="../common" diff --git a/excel/source/autowrap/excel/package.d b/excel/source/autowrap/excel/package.d index e4ac2712..806f74d9 100644 --- a/excel/source/autowrap/excel/package.d +++ b/excel/source/autowrap/excel/package.d @@ -1,33 +1,33 @@ -module autowrap.excel; - - -public import autowrap.types: Modules, Module, isModule, - LibraryName, PreModuleInitCode, PostModuleInitCode, RootNamespace; - - -string wrapDlang( - autowrap.types.LibraryName libraryName, - Modules modules, - RootNamespace _ = RootNamespace(), // ignored in this backend - PreModuleInitCode preModuleInitCode = PreModuleInitCode(), // ignored in this backend - PostModuleInitCode postModuleInitCode = PostModuleInitCode(), // ignored in this backend - )() - @safe pure -{ - import std.algorithm: map; - import std.array: join; - - mixin(`return wrapAll!(`, modules.value.map!(a => `"` ~ a.name ~ `"`).join(`, `), `;`); -} - - -string wrapAll(Modules...)(in string mainModule = __MODULE__) { - if(!__ctfe) return ""; - - import xlld: wrapAll_ = wrapAll; - import std.typecons: Yes; - - return - "import xlld;\n" ~ - wrapAll_!Modules(Yes.onlyExports, mainModule); -} +module autowrap.excel; + + +public import autowrap.types: Modules, Module, isModule, + LibraryName, PreModuleInitCode, PostModuleInitCode, RootNamespace; + + +string wrapDlang( + autowrap.types.LibraryName libraryName, + Modules modules, + RootNamespace _ = RootNamespace(), // ignored in this backend + PreModuleInitCode preModuleInitCode = PreModuleInitCode(), // ignored in this backend + PostModuleInitCode postModuleInitCode = PostModuleInitCode(), // ignored in this backend + )() + @safe pure +{ + import std.algorithm: map; + import std.array: join; + + mixin(`return wrapAll!(`, modules.value.map!(a => `"` ~ a.name ~ `"`).join(`, `), `;`); +} + + +string wrapAll(Modules...)(in string mainModule = __MODULE__) { + if(!__ctfe) return ""; + + import xlld: wrapAll_ = wrapAll; + import std.typecons: Yes; + + return + "import xlld;\n" ~ + wrapAll_!Modules(Yes.onlyExports, Yes.pascalCase, mainModule); +} From 49ad87ea4a0e180329bcbe715955eac797d2237a Mon Sep 17 00:00:00 2001 From: John Colvin Date: Mon, 14 Sep 2020 20:53:15 +0100 Subject: [PATCH 2/2] insist on new enough excel-d --- excel/dub.sdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/excel/dub.sdl b/excel/dub.sdl index 0bf38083..92354cc4 100644 --- a/excel/dub.sdl +++ b/excel/dub.sdl @@ -4,5 +4,5 @@ authors "Atila Neves" license "BSD" targetType "sourceLibrary" -dependency "excel-d" version=">=0.5.5" +dependency "excel-d" version=">=0.5.8" dependency "autowrap:common" path="../common"