Update Main.cpp

This commit is contained in:
Zihan Chen
2020-07-31 18:55:51 -07:00
parent e150858bd3
commit 948c7229c3
@@ -1,6 +1,7 @@
#include <VlppWorkflowCompiler.h>
#include "../W05_Lib/W05_Lib.h"
using namespace vl::console;
using namespace vl::collections;
using namespace vl::stream;
using namespace vl::parsing;
@@ -61,8 +62,8 @@ int wmain(int argc, const wchar_t* argv[])
// save the assembly to file
{
auto assembly = GenerateAssembly(&manager);
FilePath assemblyPath = FilePath(argv[0]).GetFolder() / L"WorkflowAssembly.bin";
Console::WriteLine(L"Writing the assembly to: " + assemblyPath.GetFullPath());
FileStream fileStream(assemblyPath.GetFullPath(), FileStream::WriteOnly);
assembly->Serialize(fileStream);
}
@@ -76,6 +77,7 @@ int wmain(int argc, const wchar_t* argv[])
cppFolder = cppFolder.GetFolder();
}
cppFolder = cppFolder / L"W05_StaticRun" / L"Generated";
Console::WriteLine(L"Writing C++ files to: " + cppFolder.GetFullPath());
auto cppInput = MakePtr<WfCppInput>(L"W05Script");
cppInput->comment = L"THIS FILE IS GENERATED BY W05_COMPILE";
@@ -88,10 +90,12 @@ int wmain(int argc, const wchar_t* argv[])
{
auto key = cppOutput->cppFiles.Keys()[i];
auto value = cppOutput->cppFiles.Values()[i];
Console::WriteLine(L" " + key);
File(cppFolder / key).WriteAllText(value, false, BomEncoder::Utf8);
}
}
}
Console::WriteLine(L"Finished!");
// stop reflection
DestroyGlobalTypeManager();