From 43f18e50d39a79a689370f0269e681673a6d8b41 Mon Sep 17 00:00:00 2001 From: Pepe Rivera Date: Thu, 2 May 2019 17:12:12 -0700 Subject: [PATCH] Conditional include logic --- .gitignore | 1 + src/CalcViewModel/CalcViewModel.vcxproj | 12 +++++++++++- src/CalcViewModel/CalcViewModel.vcxproj.filters | 3 +++ src/CalcViewModel/DataLoaders/CurrencyHttpClient.cpp | 5 +++++ ...taLoaderConstants.h => DataLoaderMockConstants.h} | 0 5 files changed, 20 insertions(+), 1 deletion(-) rename src/CalcViewModel/DataLoaders/{DataLoaderConstants.h => DataLoaderMockConstants.h} (100%) diff --git a/.gitignore b/.gitignore index 1088272d..415b87da 100644 --- a/.gitignore +++ b/.gitignore @@ -290,6 +290,7 @@ __pycache__/ # Calculator specific Generated Files/ src/GraphControl/GraphingImplOverrides.props +src/CalcViewModel/DataLoaders/DataLoaderConstants.h !/build/config/TRexDefs/** !src/Calculator/TemporaryKey.pfx !src/CalculatorUnitTests/CalculatorUnitTests_TemporaryKey.pfx \ No newline at end of file diff --git a/src/CalcViewModel/CalcViewModel.vcxproj b/src/CalcViewModel/CalcViewModel.vcxproj index 8d1f8a20..f51a5e4a 100644 --- a/src/CalcViewModel/CalcViewModel.vcxproj +++ b/src/CalcViewModel/CalcViewModel.vcxproj @@ -344,7 +344,6 @@ - @@ -409,6 +408,17 @@ {311e866d-8b93-4609-a691-265941fee101} + + + /DUSE_MOCK_DATA %(AdditionalOptions) + + + + + + + + diff --git a/src/CalcViewModel/CalcViewModel.vcxproj.filters b/src/CalcViewModel/CalcViewModel.vcxproj.filters index 4f43baf3..bd0d75f6 100644 --- a/src/CalcViewModel/CalcViewModel.vcxproj.filters +++ b/src/CalcViewModel/CalcViewModel.vcxproj.filters @@ -213,6 +213,9 @@ Common + + DataLoaders + DataLoaders diff --git a/src/CalcViewModel/DataLoaders/CurrencyHttpClient.cpp b/src/CalcViewModel/DataLoaders/CurrencyHttpClient.cpp index 9af30e01..28087037 100644 --- a/src/CalcViewModel/DataLoaders/CurrencyHttpClient.cpp +++ b/src/CalcViewModel/DataLoaders/CurrencyHttpClient.cpp @@ -3,7 +3,12 @@ #include "pch.h" #include "CurrencyHttpClient.h" + +#ifdef USE_MOCK_DATA +#include "DataLoaderMockConstants.h" +#else #include "DataLoaderConstants.h" +#endif using namespace CalculatorApp::DataLoaders; using namespace Platform; diff --git a/src/CalcViewModel/DataLoaders/DataLoaderConstants.h b/src/CalcViewModel/DataLoaders/DataLoaderMockConstants.h similarity index 100% rename from src/CalcViewModel/DataLoaders/DataLoaderConstants.h rename to src/CalcViewModel/DataLoaders/DataLoaderMockConstants.h