diff --git a/Tutorial/Console_Workflow/Console_Workflow.sln b/Tutorial/Console_Workflow/Console_Workflow.sln new file mode 100644 index 00000000..906628ed --- /dev/null +++ b/Tutorial/Console_Workflow/Console_Workflow.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.421 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "W01_RunningWorkflowScripts", "W01_RunningWorkflowScripts\W01_RunningWorkflowScripts.vcxproj", "{87541FF9-7C18-4C72-9E45-B9A3BD0D7FED}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lib", "Lib\Lib.vcxproj", "{6D6FE50E-FD92-46F1-8897-3045E14BE02B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {87541FF9-7C18-4C72-9E45-B9A3BD0D7FED}.Debug|x64.ActiveCfg = Debug|x64 + {87541FF9-7C18-4C72-9E45-B9A3BD0D7FED}.Debug|x64.Build.0 = Debug|x64 + {87541FF9-7C18-4C72-9E45-B9A3BD0D7FED}.Debug|x86.ActiveCfg = Debug|Win32 + {87541FF9-7C18-4C72-9E45-B9A3BD0D7FED}.Debug|x86.Build.0 = Debug|Win32 + {87541FF9-7C18-4C72-9E45-B9A3BD0D7FED}.Release|x64.ActiveCfg = Release|x64 + {87541FF9-7C18-4C72-9E45-B9A3BD0D7FED}.Release|x64.Build.0 = Release|x64 + {87541FF9-7C18-4C72-9E45-B9A3BD0D7FED}.Release|x86.ActiveCfg = Release|Win32 + {87541FF9-7C18-4C72-9E45-B9A3BD0D7FED}.Release|x86.Build.0 = Release|Win32 + {6D6FE50E-FD92-46F1-8897-3045E14BE02B}.Debug|x64.ActiveCfg = Debug|x64 + {6D6FE50E-FD92-46F1-8897-3045E14BE02B}.Debug|x64.Build.0 = Debug|x64 + {6D6FE50E-FD92-46F1-8897-3045E14BE02B}.Debug|x86.ActiveCfg = Debug|Win32 + {6D6FE50E-FD92-46F1-8897-3045E14BE02B}.Debug|x86.Build.0 = Debug|Win32 + {6D6FE50E-FD92-46F1-8897-3045E14BE02B}.Release|x64.ActiveCfg = Release|x64 + {6D6FE50E-FD92-46F1-8897-3045E14BE02B}.Release|x64.Build.0 = Release|x64 + {6D6FE50E-FD92-46F1-8897-3045E14BE02B}.Release|x86.ActiveCfg = Release|Win32 + {6D6FE50E-FD92-46F1-8897-3045E14BE02B}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4713731F-A486-4B5C-B6D6-92928DB5CEE5} + EndGlobalSection +EndGlobal diff --git a/Tutorial/Console_Workflow/Lib/Lib.vcxproj b/Tutorial/Console_Workflow/Lib/Lib.vcxproj new file mode 100644 index 00000000..864e4483 --- /dev/null +++ b/Tutorial/Console_Workflow/Lib/Lib.vcxproj @@ -0,0 +1,216 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {6D6FE50E-FD92-46F1-8897-3045E14BE02B} + Win32Proj + Lib + 10.0.17763.0 + + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + + + Level3 + Disabled + true + _DEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + + + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + Level3 + MaxSpeed + true + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + + + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + + + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + + + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + + + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + + + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + + + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + + + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + /bigobj %(AdditionalOptions) + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tutorial/Console_Workflow/Lib/Lib.vcxproj.filters b/Tutorial/Console_Workflow/Lib/Lib.vcxproj.filters new file mode 100644 index 00000000..1ea4f719 --- /dev/null +++ b/Tutorial/Console_Workflow/Lib/Lib.vcxproj.filters @@ -0,0 +1,69 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/Tutorial/Console_Workflow/W01_RunningWorkflowScripts/Main.cpp b/Tutorial/Console_Workflow/W01_RunningWorkflowScripts/Main.cpp new file mode 100644 index 00000000..4ee69ca3 --- /dev/null +++ b/Tutorial/Console_Workflow/W01_RunningWorkflowScripts/Main.cpp @@ -0,0 +1,52 @@ +#include + +using namespace vl; +using namespace vl::console; +using namespace vl::collections; +using namespace vl::parsing; +using namespace vl::reflection::description; +using namespace vl::workflow; +using namespace vl::workflow::emitter; +using namespace vl::workflow::runtime; + +const wchar_t ScriptCode[] = LR"Workflow( + +module sampleModule; + +func main(): string +{ + return "Hello, world!"; +} + +)Workflow"; + +int main() +{ + // start reflection + LoadPredefinedTypes(); + WfLoadLibraryTypes(); + GetGlobalTypeManager()->Load(); + + { + // prepare Workflow script code + List codes; + codes.Add(WString(ScriptCode, false)); + + // compile code and get assemblies + List> errors; + auto table = WfLoadTable(); + auto assembly = Compile(table, codes, errors); + CHECK_ERROR(assembly && errors.Count() == 0, L"Please check the 'errors' variable."); + + // initialize the assembly + auto globalContext = MakePtr(assembly); + LoadFunction(globalContext, L"")(); + + // call main + auto mainFunction = LoadFunction(globalContext, L"main"); + Console::WriteLine(mainFunction()); + } + + // stop reflection + DestroyGlobalTypeManager(); +} \ No newline at end of file diff --git a/Tutorial/Console_Workflow/W01_RunningWorkflowScripts/W01_RunningWorkflowScripts.vcxproj b/Tutorial/Console_Workflow/W01_RunningWorkflowScripts/W01_RunningWorkflowScripts.vcxproj new file mode 100644 index 00000000..c40459d2 --- /dev/null +++ b/Tutorial/Console_Workflow/W01_RunningWorkflowScripts/W01_RunningWorkflowScripts.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {87541FF9-7C18-4C72-9E45-B9A3BD0D7FED} + Win32Proj + W01RunningWorkflowScripts + 10.0.17763.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + true + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + false + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + false + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + true + Console + + + + + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + true + Console + + + + + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + true + true + true + Console + + + + + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + true + true + true + Console + + + + + {6d6fe50e-fd92-46f1-8897-3045e14be02b} + + + + + + + + + \ No newline at end of file diff --git a/Tutorial/Console_Workflow/W01_RunningWorkflowScripts/W01_RunningWorkflowScripts.vcxproj.filters b/Tutorial/Console_Workflow/W01_RunningWorkflowScripts/W01_RunningWorkflowScripts.vcxproj.filters new file mode 100644 index 00000000..e25ab333 --- /dev/null +++ b/Tutorial/Console_Workflow/W01_RunningWorkflowScripts/W01_RunningWorkflowScripts.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file