diff --git a/gcc/Makefile b/gcc/Makefile index d9697be..d4644cd 100644 --- a/gcc/Makefile +++ b/gcc/Makefile @@ -8,9 +8,11 @@ YW_LIBS = sqlite-db \ yw-db \ yw-parse \ yw-extract \ - yw-model + yw-model \ + yw-graph -YW_APPS = yw-extract-app +YW_APPS = yw-extract-app \ + yw-graph-app YW_TESTS = sqlite-db-tests \ yw-config-tests \ @@ -18,7 +20,8 @@ YW_TESTS = sqlite-db-tests \ yw-db-tests \ yw-parse-tests \ yw-extract-tests \ - yw-model-tests + yw-model-tests \ + yw-graph-tests YW_BUILDS = $(YW_LIBS) $(YW_APPS) $(YW_TESTS) diff --git a/gcc/yw-graph-app/Makefile b/gcc/yw-graph-app/Makefile new file mode 100644 index 0000000..9231196 --- /dev/null +++ b/gcc/yw-graph-app/Makefile @@ -0,0 +1,8 @@ +include ../yw.setup.makefile +include ../cpp.setup.makefile +include ../app.setup.makefile + +APP = yw_graph +APP_SRC = $(wildcard $(YW_SRC_DIR)/yw-graph-app/*.cpp) + +include ../app.targets.makefile diff --git a/gcc/yw-graph-tests/Makefile b/gcc/yw-graph-tests/Makefile new file mode 100644 index 0000000..141cb5f --- /dev/null +++ b/gcc/yw-graph-tests/Makefile @@ -0,0 +1,7 @@ +include ../yw.setup.makefile +include ../cpp.setup.makefile +include ../tests.setup.makefile + +TESTS = $(wildcard $(YW_TEST_DIR)/yw-graph-tests/*.cpp) + +include ../test.targets.makefile diff --git a/gcc/yw-graph-tests/test_runner.cpp b/gcc/yw-graph-tests/test_runner.cpp new file mode 100644 index 0000000..f530d74 --- /dev/null +++ b/gcc/yw-graph-tests/test_runner.cpp @@ -0,0 +1,7 @@ +#include "CppUTest/CommandLineTestRunner.h" + +int main(int ac, char** av) +{ + MemoryLeakWarningPlugin::turnOffNewDeleteOverloads(); + return CommandLineTestRunner::RunAllTests(ac, av); +} \ No newline at end of file diff --git a/gcc/yw-graph/Makefile b/gcc/yw-graph/Makefile new file mode 100644 index 0000000..d347f89 --- /dev/null +++ b/gcc/yw-graph/Makefile @@ -0,0 +1,7 @@ +include ../yw.setup.makefile +include ../cpp.setup.makefile + +LIB_TARGET = libywgraph.a +LIB_SRC = $(wildcard $(YW_SRC_DIR)/yw-graph/*.cpp) + +include ../lib.targets.makefile diff --git a/gcc/yw.setup.makefile b/gcc/yw.setup.makefile index 754245b..a359978 100644 --- a/gcc/yw.setup.makefile +++ b/gcc/yw.setup.makefile @@ -4,23 +4,25 @@ YW_DIR = ../.. YW_SRC_DIR = $(YW_DIR)/src YW_GCC_DIR = $(YW_DIR)/gcc -YW_INCLUDES += -I$(YW_SRC_DIR)/sqlite-3.19.3 -YW_INCLUDES += -I$(YW_SRC_DIR)/yw-types -YW_INCLUDES += -I$(YW_SRC_DIR)/yw-config YW_INCLUDES += -I$(YW_SRC_DIR)/yw-cli -YW_INCLUDES += -I$(YW_SRC_DIR)/sqlite-db -YW_INCLUDES += -I$(YW_SRC_DIR)/yw-db -YW_INCLUDES += -I$(YW_SRC_DIR)/yw-parse -YW_INCLUDES += -I$(YW_SRC_DIR)/yw-extract +YW_INCLUDES += -I$(YW_SRC_DIR)/yw-graph YW_INCLUDES += -I$(YW_SRC_DIR)/yw-model +YW_INCLUDES += -I$(YW_SRC_DIR)/yw-extract +YW_INCLUDES += -I$(YW_SRC_DIR)/yw-parse +YW_INCLUDES += -I$(YW_SRC_DIR)/yw-db +YW_INCLUDES += -I$(YW_SRC_DIR)/sqlite-db +YW_INCLUDES += -I$(YW_SRC_DIR)/yw-config +YW_INCLUDES += -I$(YW_SRC_DIR)/yw-types +YW_INCLUDES += -I$(YW_SRC_DIR)/sqlite-3.19.3 -YW_LIBS += -lywconfig -L$(YW_GCC_DIR)/yw-config YW_LIBS += -lywcli -L$(YW_GCC_DIR)/yw-cli +YW_LIBS += -lywgraph -L$(YW_GCC_DIR)/yw-graph YW_LIBS += -lywmodel -L$(YW_GCC_DIR)/yw-model YW_LIBS += -lywextract -L$(YW_GCC_DIR)/yw-extract YW_LIBS += -lywparse -L$(YW_GCC_DIR)/yw-parse YW_LIBS += -lywdb -L$(YW_GCC_DIR)/yw-db YW_LIBS += -lsqlitedb -L$(YW_GCC_DIR)/sqlite-db +YW_LIBS += -lywconfig -L$(YW_GCC_DIR)/yw-config YW_LIBS += -lsqlite3 -L$(YW_GCC_DIR)/sqlite3 ANTLR_LIB += -lantlr4 -L$(YW_GCC_DIR)/antlr4-runtime diff --git a/msvc/yw.sln b/msvc/yw.sln index 6418bdb..10b891a 100644 --- a/msvc/yw.sln +++ b/msvc/yw.sln @@ -231,6 +231,22 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yw-cli-tests", "yw-cli-test ..\gcc\yw-cli-tests\test_runner.cpp = ..\gcc\yw-cli-tests\test_runner.cpp EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yw-graph", "yw-graph", "{FB1DBF02-D35F-41A4-AC9D-4B32AF832202}" + ProjectSection(SolutionItems) = preProject + ..\gcc\yw-graph\Makefile = ..\gcc\yw-graph\Makefile + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yw-graph-tests", "yw-graph-tests", "{030CC283-17BD-4E92-A6BE-D5CF949F5570}" + ProjectSection(SolutionItems) = preProject + ..\gcc\yw-graph-tests\Makefile = ..\gcc\yw-graph-tests\Makefile + ..\gcc\yw-graph-tests\test_runner.cpp = ..\gcc\yw-graph-tests\test_runner.cpp + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yw-graph-app", "yw-graph-app", "{C4AA4D95-423C-4BF5-9CDA-8C50DF668B36}" + ProjectSection(SolutionItems) = preProject + ..\gcc\yw-graph-app\Makefile = ..\gcc\yw-graph-app\Makefile + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -472,6 +488,9 @@ Global {35F9A935-896A-4707-BC10-6C782D0CFF15} = {67337B64-473B-4676-AF06-D1EDCE123B6D} {9265BA67-55E9-4668-B0A5-393C123F37D5} = {67337B64-473B-4676-AF06-D1EDCE123B6D} {F1EC2F6B-014F-4064-B2C5-F37172E156E9} = {67337B64-473B-4676-AF06-D1EDCE123B6D} + {FB1DBF02-D35F-41A4-AC9D-4B32AF832202} = {67337B64-473B-4676-AF06-D1EDCE123B6D} + {030CC283-17BD-4E92-A6BE-D5CF949F5570} = {67337B64-473B-4676-AF06-D1EDCE123B6D} + {C4AA4D95-423C-4BF5-9CDA-8C50DF668B36} = {67337B64-473B-4676-AF06-D1EDCE123B6D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9AEF8164-5EBC-432F-98B9-C7C5704935A3} diff --git a/src/yw-cli/command_line.h b/src/yw-cli/command_line.h index bdcf686..6e52303 100644 --- a/src/yw-cli/command_line.h +++ b/src/yw-cli/command_line.h @@ -19,12 +19,12 @@ namespace yw { CommandLine(std::string line); CommandLine(int argc, char** argv); - std::string getLine() { return line; } - std::string getProgram() { return program; } - std::vector getFlags() { return flags; } - nullable_string getCommand() { return command; } - std::vector getArguments() { return arguments; } - yw::config::Configuration getSettings() { return settings; } + std::string getLine() const { return line; } + std::string getProgram() const { return program; } + std::vector getFlags() const { return flags; } + nullable_string getCommand() const { return command; }; + std::vector getArguments() const { return arguments; } + yw::config::Configuration getSettings() const { return settings; } static std::string concatenate(int argc, char** argv); }; diff --git a/src/yw-graph/yw_graph_cli.cpp b/src/yw-graph/yw_graph_cli.cpp index 88e714e..2d0acc1 100644 --- a/src/yw-graph/yw_graph_cli.cpp +++ b/src/yw-graph/yw_graph_cli.cpp @@ -15,7 +15,7 @@ using namespace yw::model; namespace yw { namespace graph { - int cli(CommandLine& commandLine) + int cli(const CommandLine& commandLine) { YesWorkflowDB ywdb; diff --git a/src/yw-graph/yw_graph_cli.h b/src/yw-graph/yw_graph_cli.h index 002dc7f..a72898d 100644 --- a/src/yw-graph/yw_graph_cli.h +++ b/src/yw-graph/yw_graph_cli.h @@ -5,7 +5,7 @@ namespace yw { namespace graph { - int cli(yw::cli::CommandLine& commandLine); + int cli(const yw::cli::CommandLine& commandLine); void print_help(); } } \ No newline at end of file