mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-08-17 17:31:44 +08:00
...
This commit is contained in:
@@ -21,8 +21,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "W05_DynamicRun", "W05_Dynam
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "W05_StaticRun", "W05_StaticRun\W05_StaticRun.vcxproj", "{9D3FAA11-10ED-44E0-B894-9F89D86D14A0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "W05_Lib", "W05_Lib\W05_Lib.vcxproj", "{2061D6EE-36D8-4D98-8221-14E86DA3C79B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@@ -95,14 +93,6 @@ Global
|
||||
{9D3FAA11-10ED-44E0-B894-9F89D86D14A0}.Release|x64.Build.0 = Release|x64
|
||||
{9D3FAA11-10ED-44E0-B894-9F89D86D14A0}.Release|x86.ActiveCfg = Release|Win32
|
||||
{9D3FAA11-10ED-44E0-B894-9F89D86D14A0}.Release|x86.Build.0 = Release|Win32
|
||||
{2061D6EE-36D8-4D98-8221-14E86DA3C79B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2061D6EE-36D8-4D98-8221-14E86DA3C79B}.Debug|x64.Build.0 = Debug|x64
|
||||
{2061D6EE-36D8-4D98-8221-14E86DA3C79B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{2061D6EE-36D8-4D98-8221-14E86DA3C79B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{2061D6EE-36D8-4D98-8221-14E86DA3C79B}.Release|x64.ActiveCfg = Release|x64
|
||||
{2061D6EE-36D8-4D98-8221-14E86DA3C79B}.Release|x64.Build.0 = Release|x64
|
||||
{2061D6EE-36D8-4D98-8221-14E86DA3C79B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{2061D6EE-36D8-4D98-8221-14E86DA3C79B}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -111,7 +101,6 @@ Global
|
||||
{6C22B120-73DA-4201-B664-962B69A4ADF6} = {C130C55A-3D7D-4A29-AF6F-056E8AFD7B84}
|
||||
{CF91D631-EEA0-4DDB-B12B-2A2DE63F5EB7} = {C130C55A-3D7D-4A29-AF6F-056E8AFD7B84}
|
||||
{9D3FAA11-10ED-44E0-B894-9F89D86D14A0} = {C130C55A-3D7D-4A29-AF6F-056E8AFD7B84}
|
||||
{2061D6EE-36D8-4D98-8221-14E86DA3C79B} = {C130C55A-3D7D-4A29-AF6F-056E8AFD7B84}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4713731F-A486-4B5C-B6D6-92928DB5CEE5}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
#include <VlppWorkflowCompiler.h>
|
||||
#include "../W05_Lib/W05_Lib.h"
|
||||
|
||||
using namespace vl::collections;
|
||||
using namespace vl::stream;
|
||||
using namespace vl::parsing;
|
||||
using namespace vl::filesystem;
|
||||
using namespace vl::reflection::description;
|
||||
using namespace vl::workflow;
|
||||
using namespace vl::workflow::analyzer;
|
||||
using namespace vl::workflow::emitter;
|
||||
using namespace vl::workflow::cppcodegen;
|
||||
|
||||
const wchar_t ScriptCode[] = LR"Workflow(
|
||||
|
||||
module sampleModule;
|
||||
|
||||
using myapi::*;
|
||||
|
||||
namespace myscript
|
||||
{
|
||||
class MyApp
|
||||
{
|
||||
new(){}
|
||||
|
||||
func CreateScripting(): IScripting^
|
||||
{
|
||||
return new IScripting^
|
||||
{
|
||||
override func Execute(name: string): void
|
||||
{
|
||||
App::Print($"Hello, $(name)!");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
)Workflow";
|
||||
|
||||
int wmain(int argc, const wchar_t* argv[])
|
||||
{
|
||||
// start reflection
|
||||
LoadPredefinedTypes();
|
||||
WfLoadLibraryTypes();
|
||||
LoadMyApiTypes();
|
||||
GetGlobalTypeManager()->Load();
|
||||
|
||||
{
|
||||
// compile code
|
||||
// this is required because we produce assembly and C++ code at the same time
|
||||
auto table = WfLoadTable();
|
||||
WfLexicalScopeManager manager(table);
|
||||
manager.AddModule(WString(ScriptCode, false));
|
||||
CHECK_ERROR(manager.errors.Count() == 0, L"Please check the 'manager.errors' variable.");
|
||||
manager.Rebuild(true);
|
||||
CHECK_ERROR(manager.errors.Count() == 0, L"Please check the 'manager.errors' variable.");
|
||||
|
||||
// save the assembly to file
|
||||
{
|
||||
auto assembly = GenerateAssembly(&manager);
|
||||
FilePath assemblyPath = FilePath(argv[0]).GetFolder() / L"WorkflowAssembly.bin";
|
||||
FileStream fileStream(assemblyPath.GetFullPath(), FileStream::WriteOnly);
|
||||
assembly->Serialize(fileStream);
|
||||
}
|
||||
|
||||
// generate C++ code
|
||||
{
|
||||
FilePath cppFolder = FilePath(argv[0]).GetFolder();
|
||||
while (cppFolder.GetName() != L"Console_Workflow")
|
||||
{
|
||||
// the loop exist because x64 binaries are stored in ../x64/Debug instead of ../Debug
|
||||
cppFolder = cppFolder.GetFolder();
|
||||
}
|
||||
cppFolder = cppFolder / L"W05_DynamicRun" / L"Generated";
|
||||
|
||||
auto cppInput = MakePtr<WfCppInput>(L"W05Script");
|
||||
cppInput->comment = L"THIS FILE IS GENERATED BY W05_COMPILE";
|
||||
cppInput->headerGuardPrefix = L"W05_SCRIPT_";
|
||||
cppInput->normalIncludes.Add(L"../../W05_Lib/W05_Lib.h");
|
||||
|
||||
auto cppOutput = GenerateCppFiles(cppInput, &manager);
|
||||
for (vint i = 0; i < cppOutput->cppFiles.Count(); i++)
|
||||
{
|
||||
auto key = cppOutput->cppFiles.Keys()[i];
|
||||
auto value = cppOutput->cppFiles.Values()[i];
|
||||
File(cppFolder / key).WriteAllText(value, false, BomEncoder::Utf8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// stop reflection
|
||||
DestroyGlobalTypeManager();
|
||||
}
|
||||
@@ -150,9 +150,13 @@
|
||||
<ProjectReference Include="..\Lib\Lib.vcxproj">
|
||||
<Project>{6d6fe50e-fd92-46f1-8897-3045e14be02b}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\W05_Lib\W05_Lib.vcxproj">
|
||||
<Project>{2061d6ee-36d8-4d98-8221-14e86da3c79b}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\W05_Lib\W05_Lib.cpp" />
|
||||
<ClCompile Include="Main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\W05_Lib\W05_Lib.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -14,4 +14,17 @@
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\W05_Lib\W05_Lib.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\W05_Lib\W05_Lib.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,98 @@
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
THIS FILE IS GENERATED BY W05_COMPILE
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#include "W05ScriptIncludes.h"
|
||||
/* CodePack:BeginIgnore() */
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
/* CodePack:ConditionOff(VCZH_DEBUG_NO_REFLECTION, W05ScriptReflection.h) */
|
||||
#include "W05ScriptReflection.h"
|
||||
#endif
|
||||
/* CodePack:EndIgnore() */
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses-equality"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
#endif
|
||||
|
||||
#define GLOBAL_SYMBOL ::vl_workflow_global::W05Script::
|
||||
#define GLOBAL_NAME ::vl_workflow_global::W05Script::Instance().
|
||||
#define GLOBAL_OBJ &::vl_workflow_global::W05Script::Instance()
|
||||
|
||||
/***********************************************************************
|
||||
Global Variables
|
||||
***********************************************************************/
|
||||
|
||||
BEGIN_GLOBAL_STORAGE_CLASS(vl_workflow_global_W05Script)
|
||||
vl_workflow_global::W05Script instance;
|
||||
INITIALIZE_GLOBAL_STORAGE_CLASS
|
||||
FINALIZE_GLOBAL_STORAGE_CLASS
|
||||
END_GLOBAL_STORAGE_CLASS(vl_workflow_global_W05Script)
|
||||
|
||||
namespace vl_workflow_global
|
||||
{
|
||||
/***********************************************************************
|
||||
Global Functions
|
||||
***********************************************************************/
|
||||
|
||||
W05Script& W05Script::Instance()
|
||||
{
|
||||
return Getvl_workflow_global_W05Script().instance;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Closures
|
||||
***********************************************************************/
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
__vwsnc1_W05Script_myscript_MyApp_CreateScripting__myapi_IScripting::__vwsnc1_W05Script_myscript_MyApp_CreateScripting__myapi_IScripting(::myscript::MyApp* __vwsnctorthis_0)
|
||||
:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
|
||||
{
|
||||
}
|
||||
|
||||
void __vwsnc1_W05Script_myscript_MyApp_CreateScripting__myapi_IScripting::Execute(const ::vl::WString& name)
|
||||
{
|
||||
::myapi::App::Print(((::vl::WString(L"Hello, ", false) + name) + ::vl::WString(L"!", false)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Class (::myscript::MyApp)
|
||||
***********************************************************************/
|
||||
|
||||
namespace myscript
|
||||
{
|
||||
MyApp::MyApp()
|
||||
{
|
||||
}
|
||||
|
||||
::vl::Ptr<::myapi::IScripting> MyApp::CreateScripting()
|
||||
{
|
||||
return ::vl::Ptr<::myapi::IScripting>(new ::vl_workflow_global::__vwsnc1_W05Script_myscript_MyApp_CreateScripting__myapi_IScripting(this));
|
||||
}
|
||||
|
||||
}
|
||||
#undef GLOBAL_SYMBOL
|
||||
#undef GLOBAL_NAME
|
||||
#undef GLOBAL_OBJ
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
@@ -0,0 +1,83 @@
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
THIS FILE IS GENERATED BY W05_COMPILE
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef W05_SCRIPT_W05SCRIPT
|
||||
#define W05_SCRIPT_W05SCRIPT
|
||||
|
||||
#include "../../W05_Lib/W05_Lib.h"
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses-equality"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
#endif
|
||||
|
||||
namespace vl_workflow_global
|
||||
{
|
||||
class __vwsnc1_W05Script_myscript_MyApp_CreateScripting__myapi_IScripting;
|
||||
}
|
||||
|
||||
namespace myscript
|
||||
{
|
||||
class MyApp;
|
||||
|
||||
class MyApp : public ::vl::Object, public ::vl::reflection::Description<MyApp>
|
||||
{
|
||||
friend class ::vl_workflow_global::__vwsnc1_W05Script_myscript_MyApp_CreateScripting__myapi_IScripting;
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MyApp>;
|
||||
#endif
|
||||
public:
|
||||
MyApp();
|
||||
::vl::Ptr<::myapi::IScripting> CreateScripting();
|
||||
};
|
||||
|
||||
}
|
||||
/***********************************************************************
|
||||
Global Variables and Functions
|
||||
***********************************************************************/
|
||||
|
||||
namespace vl_workflow_global
|
||||
{
|
||||
class W05Script
|
||||
{
|
||||
public:
|
||||
|
||||
static W05Script& Instance();
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
Closures
|
||||
***********************************************************************/
|
||||
|
||||
class __vwsnc1_W05Script_myscript_MyApp_CreateScripting__myapi_IScripting : public ::vl::Object, public virtual ::myapi::IScripting
|
||||
{
|
||||
public:
|
||||
::myscript::MyApp* __vwsnthis_0;
|
||||
|
||||
__vwsnc1_W05Script_myscript_MyApp_CreateScripting__myapi_IScripting(::myscript::MyApp* __vwsnctorthis_0);
|
||||
|
||||
void Execute(const ::vl::WString& name) override;
|
||||
};
|
||||
}
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
THIS FILE IS GENERATED BY W05_COMPILE
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef W05_SCRIPT_W05SCRIPTINCLUDES
|
||||
#define W05_SCRIPT_W05SCRIPTINCLUDES
|
||||
|
||||
#include "W05Script.h"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,78 @@
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
THIS FILE IS GENERATED BY W05_COMPILE
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#include "W05ScriptReflection.h"
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses-equality"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
Reflection
|
||||
***********************************************************************/
|
||||
|
||||
namespace vl
|
||||
{
|
||||
namespace reflection
|
||||
{
|
||||
namespace description
|
||||
{
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
IMPL_CPP_TYPE_INFO(myscript::MyApp)
|
||||
|
||||
#define _ ,
|
||||
BEGIN_CLASS_MEMBER(::myscript::MyApp)
|
||||
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
|
||||
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::myscript::MyApp>(), NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(CreateScripting, NO_PARAMETER)
|
||||
END_CLASS_MEMBER(::myscript::MyApp)
|
||||
|
||||
#undef _
|
||||
class W05ScriptTypeLoader : public Object, public ITypeLoader
|
||||
{
|
||||
public:
|
||||
void Load(ITypeManager* manager)
|
||||
{
|
||||
ADD_TYPE_INFO(::myscript::MyApp)
|
||||
}
|
||||
|
||||
void Unload(ITypeManager* manager)
|
||||
{
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
bool LoadW05ScriptTypes()
|
||||
{
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
if (auto manager = GetGlobalTypeManager())
|
||||
{
|
||||
return manager->AddTypeLoader(MakePtr<W05ScriptTypeLoader>());
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
@@ -0,0 +1,53 @@
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
THIS FILE IS GENERATED BY W05_COMPILE
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef W05_SCRIPT_W05SCRIPTREFLECTION
|
||||
#define W05_SCRIPT_W05SCRIPTREFLECTION
|
||||
|
||||
#include "W05ScriptIncludes.h"
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses-equality"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
Reflection
|
||||
***********************************************************************/
|
||||
|
||||
namespace vl
|
||||
{
|
||||
namespace reflection
|
||||
{
|
||||
namespace description
|
||||
{
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
DECL_TYPE_INFO(::myscript::MyApp)
|
||||
#endif
|
||||
|
||||
extern bool LoadW05ScriptTypes();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -189,6 +189,7 @@
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\W05_Lib\W05_Lib.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\Import\Vlpp.h" />
|
||||
@@ -198,11 +199,7 @@
|
||||
<ClInclude Include="..\..\..\Import\VlppRegex.h" />
|
||||
<ClInclude Include="..\..\..\Import\VlppWorkflowLibrary.h" />
|
||||
<ClInclude Include="..\..\..\Import\VlppWorkflowRuntime.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\W05_Lib\W05_Lib.vcxproj">
|
||||
<Project>{2061d6ee-36d8-4d98-8221-14e86da3c79b}</Project>
|
||||
</ProjectReference>
|
||||
<ClInclude Include="..\W05_Lib\W05_Lib.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
<ClCompile Include="..\..\..\Import\VlppWorkflowRuntime.cpp">
|
||||
<Filter>Import</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\W05_Lib\W05_Lib.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\Import\Vlpp.h">
|
||||
@@ -62,5 +65,8 @@
|
||||
<ClInclude Include="..\..\..\Import\VlppWorkflowRuntime.h">
|
||||
<Filter>Import</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\W05_Lib\W05_Lib.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,80 @@
|
||||
#include "W05_Lib.h"
|
||||
|
||||
using namespace vl::console;
|
||||
|
||||
namespace myapi
|
||||
{
|
||||
WString App::Get()
|
||||
{
|
||||
return Console::Read();
|
||||
}
|
||||
|
||||
WString App::Get(const WString& message)
|
||||
{
|
||||
Console::Write(message);
|
||||
return Console::Read();
|
||||
}
|
||||
|
||||
void App::Print(const WString& text)
|
||||
{
|
||||
Console::WriteLine(text);
|
||||
}
|
||||
}
|
||||
|
||||
namespace vl
|
||||
{
|
||||
namespace reflection
|
||||
{
|
||||
namespace description
|
||||
{
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
MYAPI_TYPELIST(IMPL_CPP_TYPE_INFO)
|
||||
|
||||
using namespace myapi;
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
BEGIN_INTERFACE_PROXY_SHAREDPTR(IScripting)
|
||||
void Execute(const WString& name)override
|
||||
{
|
||||
INVOKE_INTERFACE_PROXY(Execute, name);
|
||||
}
|
||||
END_INTERFACE_PROXY(IScripting)
|
||||
#pragma warning(pop)
|
||||
|
||||
#define _ ,
|
||||
|
||||
BEGIN_CLASS_MEMBER(App)
|
||||
CLASS_MEMBER_STATIC_METHOD_OVERLOAD(Get, NO_PARAMETER, WString(*)())
|
||||
CLASS_MEMBER_STATIC_METHOD_OVERLOAD(Get, { L"message" }, WString(*)(const WString&))
|
||||
CLASS_MEMBER_STATIC_METHOD(Print, { L"text" })
|
||||
END_CLASS_MEMBER(App)
|
||||
|
||||
BEGIN_INTERFACE_MEMBER(IScripting)
|
||||
CLASS_MEMBER_METHOD(Execute, { L"name" })
|
||||
END_INTERFACE_MEMBER(IScripting)
|
||||
|
||||
#undef _
|
||||
class MyApiTypeLoader : public Object, public ITypeLoader
|
||||
{
|
||||
public:
|
||||
void Load(ITypeManager* manager)
|
||||
{
|
||||
MYAPI_TYPELIST(ADD_TYPE_INFO)
|
||||
}
|
||||
|
||||
void Unload(ITypeManager* manager)
|
||||
{
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
void LoadMyApiTypes()
|
||||
{
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
GetGlobalTypeManager()->AddTypeLoader(new MyApiTypeLoader);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include <VlppReflection.h>
|
||||
|
||||
using namespace vl;
|
||||
using namespace vl::reflection;
|
||||
|
||||
namespace myapi
|
||||
{
|
||||
class App : public Object, public Description<App>
|
||||
{
|
||||
public:
|
||||
static WString Get();
|
||||
static WString Get(const WString& message);
|
||||
static void Print(const WString& text);
|
||||
};
|
||||
|
||||
class IScripting : public virtual IDescriptable, public Description<IScripting>
|
||||
{
|
||||
public:
|
||||
virtual void Execute(const WString& name) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
namespace vl
|
||||
{
|
||||
namespace reflection
|
||||
{
|
||||
namespace description
|
||||
{
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
|
||||
#define MYAPI_TYPELIST(F)\
|
||||
F(myapi::App)\
|
||||
F(myapi::IScripting)\
|
||||
|
||||
|
||||
MYAPI_TYPELIST(DECL_TYPE_INFO)
|
||||
#endif
|
||||
|
||||
extern void LoadMyApiTypes();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{2061D6EE-36D8-4D98-8221-14E86DA3C79B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>W05Lib</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -91,7 +91,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;VCZH_DEBUG_NO_REFLECTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -104,7 +104,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;VCZH_DEBUG_NO_REFLECTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -119,7 +119,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;VCZH_DEBUG_NO_REFLECTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -136,7 +136,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;VCZH_DEBUG_NO_REFLECTION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -152,6 +152,7 @@
|
||||
<ClInclude Include="..\..\..\Import\VlppReflection.h" />
|
||||
<ClInclude Include="..\..\..\Import\VlppRegex.h" />
|
||||
<ClInclude Include="..\..\..\Import\VlppWorkflowLibrary.h" />
|
||||
<ClInclude Include="..\W05_Lib\W05_Lib.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\Import\Vlpp.cpp">
|
||||
@@ -184,11 +185,7 @@
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\W05_Lib\W05_Lib.vcxproj">
|
||||
<Project>{2061d6ee-36d8-4d98-8221-14e86da3c79b}</Project>
|
||||
</ProjectReference>
|
||||
<ClCompile Include="..\W05_Lib\W05_Lib.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
<ClInclude Include="..\..\..\Import\VlppReflection.h">
|
||||
<Filter>Import</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\W05_Lib\W05_Lib.h">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\Import\VlppWorkflowLibrary.cpp">
|
||||
@@ -50,5 +53,8 @@
|
||||
<ClCompile Include="..\..\..\Import\VlppRegex.cpp">
|
||||
<Filter>Import</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\W05_Lib\W05_Lib.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user