Skip to content

Commit 1e39a6b

Browse files
Renaming DependencyCommands to ProfilesCommands
1 parent 03d7398 commit 1e39a6b

File tree

10 files changed

+34
-34
lines changed

10 files changed

+34
-34
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ add_library(runcpp2 STATIC
123123
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/Profile.cpp"
124124
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencyInfo.cpp"
125125
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencyLinkProperty.cpp"
126-
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencyCommands.cpp"
127126
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencySource.cpp"
128127
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/FileProperties.cpp"
129128
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/FlagsOverrideInfo.cpp"
129+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/ProfilesCommands.cpp"
130130
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/ProfilesFlagsOverride.cpp"
131131
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/ScriptInfo.cpp"
132132
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/ProfilesCompilesFiles.cpp"

Include/runcpp2/Data/DependencyInfo.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "runcpp2/Data/DependencyLibraryType.hpp"
55
#include "runcpp2/Data/DependencySource.hpp"
66
#include "runcpp2/Data/DependencyLinkProperty.hpp"
7-
#include "runcpp2/Data/DependencyCommands.hpp"
7+
#include "runcpp2/Data/ProfilesCommands.hpp"
88
#include "runcpp2/Data/ParseCommon.hpp"
99
#include "runcpp2/Data/FilesToCopyInfo.hpp"
1010
#include "runcpp2/YamlLib.hpp"
@@ -26,9 +26,9 @@ namespace runcpp2
2626
std::vector<std::string> IncludePaths;
2727
std::vector<std::string> AbsoluteIncludePaths;
2828
std::unordered_map<PlatformName, DependencyLinkProperty> LinkProperties;
29-
std::unordered_map<PlatformName, DependencyCommands> Setup;
30-
std::unordered_map<PlatformName, DependencyCommands> Cleanup;
31-
std::unordered_map<PlatformName, DependencyCommands> Build;
29+
std::unordered_map<PlatformName, ProfilesCommands> Setup;
30+
std::unordered_map<PlatformName, ProfilesCommands> Cleanup;
31+
std::unordered_map<PlatformName, ProfilesCommands> Build;
3232
std::unordered_map<PlatformName, FilesToCopyInfo> FilesToCopy;
3333

3434
bool ParseYAML_Node(ryml::ConstNodeRef& node);

Include/runcpp2/Data/DependencyCommands.hpp renamed to Include/runcpp2/Data/ProfilesCommands.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef RUNCPP2_DATA_DEPENDENCY_COMMANDS_HPP
2-
#define RUNCPP2_DATA_DEPENDENCY_COMMANDS_HPP
1+
#ifndef RUNCPP2_DATA_PROFILES_COMMANDS_HPP
2+
#define RUNCPP2_DATA_PROFILES_COMMANDS_HPP
33

44
#include "runcpp2/Data/ParseCommon.hpp"
55
#include "runcpp2/YamlLib.hpp"
@@ -12,15 +12,15 @@ namespace runcpp2
1212
{
1313
namespace Data
1414
{
15-
class DependencyCommands
15+
class ProfilesCommands
1616
{
1717
public:
1818
//TODO: Allow specifying command can fail
1919
std::unordered_map<ProfileName, std::vector<std::string>> CommandSteps;
2020

2121
bool ParseYAML_Node(ryml::ConstNodeRef& node);
2222
std::string ToString(std::string indentation) const;
23-
bool Equals(const DependencyCommands& other) const;
23+
bool Equals(const ProfilesCommands& other) const;
2424
};
2525
}
2626
}

Src/Tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ endfunction()
2121
create_data_test(FilePropertiesTest)
2222
create_data_test(FlagsOverrideInfoTest)
2323
create_data_test(DependencySourceTest)
24-
create_data_test(DependencyCommandsTest)
2524
create_data_test(FilesToCopyInfoTest)
25+
create_data_test(ProfilesCommandsTest)
2626
create_data_test(ProfilesCompilesFilesTest)
2727
create_data_test(ProfilesDefinesTest)
2828
create_data_test(DependencyLinkPropertyTest)
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "runcpp2/Data/DependencyCommands.hpp"
1+
#include "runcpp2/Data/ProfilesCommands.hpp"
22
#include "ssTest.hpp"
33
#include "runcpp2/YamlLib.hpp"
44
#include "runcpp2/runcpp2.hpp"
@@ -9,7 +9,7 @@ int main(int argc, char** argv)
99

1010
ssTEST_INIT_TEST_GROUP();
1111

12-
ssTEST("DependencyCommands Should Parse Valid YAML")
12+
ssTEST("ProfilesCommands Should Parse Valid YAML")
1313
{
1414
ssTEST_OUTPUT_SETUP
1515
(
@@ -27,40 +27,40 @@ int main(int argc, char** argv)
2727
ryml::Tree tree = ryml::parse_in_arena(c4::to_csubstr(yamlStr));
2828
ryml::ConstNodeRef root = tree.rootref();
2929

30-
runcpp2::Data::DependencyCommands dependencyCommands;
30+
runcpp2::Data::ProfilesCommands profilesCommands;
3131
);
3232

3333
ssTEST_OUTPUT_EXECUTION
3434
(
3535
ryml::ConstNodeRef nodeRef = root;
36-
bool parseResult = dependencyCommands.ParseYAML_Node(nodeRef);
36+
bool parseResult = profilesCommands.ParseYAML_Node(nodeRef);
3737
);
3838

3939
ssTEST_OUTPUT_ASSERT("ParseYAML_Node should succeed", parseResult);
4040

4141
//Verify parsed values
4242
ssTEST_OUTPUT_ASSERT( "MSVC commands count",
43-
dependencyCommands.CommandSteps.at("MSVC").size() == 3);
43+
profilesCommands.CommandSteps.at("MSVC").size() == 3);
4444
ssTEST_OUTPUT_ASSERT( "GCC commands count",
45-
dependencyCommands.CommandSteps.at("GCC").size() == 3);
45+
profilesCommands.CommandSteps.at("GCC").size() == 3);
4646
ssTEST_OUTPUT_ASSERT( "MSVC first command",
47-
dependencyCommands.CommandSteps.at("MSVC").at(0) == "mkdir build");
47+
profilesCommands.CommandSteps.at("MSVC").at(0) == "mkdir build");
4848
ssTEST_OUTPUT_ASSERT( "GCC last command",
49-
dependencyCommands.CommandSteps.at("GCC").at(2) == "make install");
49+
profilesCommands.CommandSteps.at("GCC").at(2) == "make install");
5050

5151
//Test ToString() and Equals()
5252
ssTEST_OUTPUT_EXECUTION
5353
(
54-
std::string yamlOutput = dependencyCommands.ToString("");
54+
std::string yamlOutput = profilesCommands.ToString("");
5555
ryml::Tree outputTree = ryml::parse_in_arena(ryml::to_csubstr(yamlOutput));
5656

57-
runcpp2::Data::DependencyCommands parsedOutput;
57+
runcpp2::Data::ProfilesCommands parsedOutput;
5858
nodeRef = outputTree.rootref();
5959
parsedOutput.ParseYAML_Node(nodeRef);
6060
);
6161

6262
ssTEST_OUTPUT_ASSERT( "Parsed output should equal original",
63-
dependencyCommands.Equals(parsedOutput));
63+
profilesCommands.Equals(parsedOutput));
6464
};
6565

6666
ssTEST_END_TEST_GROUP();

Src/Tests/RunAllTests.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ CALL :RUN_TEST "%~dp0\%MODE%BuildsManagerTest.exe"
4141
CALL :RUN_TEST "%~dp0\%MODE%FilePropertiesTest.exe"
4242
CALL :RUN_TEST "%~dp0\%MODE%FlagsOverrideInfoTest.exe"
4343
CALL :RUN_TEST "%~dp0\%MODE%DependencySourceTest.exe"
44-
CALL :RUN_TEST "%~dp0\%MODE%DependencyCommandsTest.exe"
44+
CALL :RUN_TEST "%~dp0\%MODE%ProfilesCommandsTest.exe"
4545
CALL :RUN_TEST "%~dp0\%MODE%FilesToCopyInfoTest.exe"
4646
CALL :RUN_TEST "%~dp0\%MODE%ProfilesCompilesFilesTest.exe"
4747
CALL :RUN_TEST "%~dp0\%MODE%ProfilesDefinesTest.exe"

Src/Tests/RunAllTests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runTest ./BuildsManagerTest
1717
runTest ./FilePropertiesTest
1818
runTest ./FlagsOverrideInfoTest
1919
runTest ./DependencySourceTest
20-
runTest ./DependencyCommandsTest
20+
runTest ./ProfilesCommandsTest
2121
runTest ./FilesToCopyInfoTest
2222
runTest ./ProfilesCompilesFilesTest
2323
runTest ./ProfilesDefinesTest

Src/runcpp2/Data/DependencyInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ bool runcpp2::Data::DependencyInfo::ParseYAML_Node(ryml::ConstNodeRef& node)
9494
{
9595
for(int i = 0; i < node["Setup"].num_children(); ++i)
9696
{
97-
DependencyCommands currentSetup;
97+
ProfilesCommands currentSetup;
9898
ryml::ConstNodeRef currentSetupNode = node["Setup"][i];
9999

100100
if(!currentSetup.ParseYAML_Node(currentSetupNode))
@@ -111,7 +111,7 @@ bool runcpp2::Data::DependencyInfo::ParseYAML_Node(ryml::ConstNodeRef& node)
111111
{
112112
for(int i = 0; i < node["Cleanup"].num_children(); ++i)
113113
{
114-
DependencyCommands currentCleanup;
114+
ProfilesCommands currentCleanup;
115115
ryml::ConstNodeRef currentCleanupNode = node["Cleanup"][i];
116116

117117
if(!currentCleanup.ParseYAML_Node(currentCleanupNode))
@@ -128,7 +128,7 @@ bool runcpp2::Data::DependencyInfo::ParseYAML_Node(ryml::ConstNodeRef& node)
128128
{
129129
for(int i = 0; i < node["Build"].num_children(); ++i)
130130
{
131-
DependencyCommands currentBuild;
131+
ProfilesCommands currentBuild;
132132
ryml::ConstNodeRef currentBuildNode = node["Build"][i];
133133

134134
if(!currentBuild.ParseYAML_Node(currentBuildNode))
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
#include "runcpp2/Data/DependencyCommands.hpp"
1+
#include "runcpp2/Data/ProfilesCommands.hpp"
22
#include "runcpp2/ParseUtil.hpp"
33
#include "runcpp2/Data/ParseCommon.hpp"
44
#include "ssLogger/ssLog.hpp"
55

6-
bool runcpp2::Data::DependencyCommands::ParseYAML_Node(ryml::ConstNodeRef& node)
6+
bool runcpp2::Data::ProfilesCommands::ParseYAML_Node(ryml::ConstNodeRef& node)
77
{
88
INTERNAL_RUNCPP2_SAFE_START();
99

1010
if(!node.is_map())
1111
{
12-
ssLOG_ERROR("DependencyCommands: Node is not a Map");
12+
ssLOG_ERROR("ProfilesCommands: Node is not a Map");
1313
return false;
1414
}
1515

1616
for(int i = 0; i < node.num_children(); i++)
1717
{
1818
if(!node[i].is_seq())
1919
{
20-
ssLOG_ERROR("DependencyCommands: Node is not a sequence");
20+
ssLOG_ERROR("ProfilesCommands: Node is not a sequence");
2121
return false;
2222
}
2323

@@ -31,7 +31,7 @@ bool runcpp2::Data::DependencyCommands::ParseYAML_Node(ryml::ConstNodeRef& node)
3131
INTERNAL_RUNCPP2_SAFE_CATCH_RETURN(false);
3232
}
3333

34-
std::string runcpp2::Data::DependencyCommands::ToString(std::string indentation) const
34+
std::string runcpp2::Data::ProfilesCommands::ToString(std::string indentation) const
3535
{
3636
std::string out;
3737

@@ -53,7 +53,7 @@ std::string runcpp2::Data::DependencyCommands::ToString(std::string indentation)
5353
return out;
5454
}
5555

56-
bool runcpp2::Data::DependencyCommands::Equals(const DependencyCommands& other) const
56+
bool runcpp2::Data::ProfilesCommands::Equals(const ProfilesCommands& other) const
5757
{
5858
if(CommandSteps.size() != other.CommandSteps.size())
5959
return false;

Src/runcpp2/DependenciesHelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ namespace
110110

111111
bool RunDependenciesSteps( const runcpp2::Data::Profile& profile,
112112
const std::unordered_map< PlatformName,
113-
runcpp2::Data::DependencyCommands> steps,
113+
runcpp2::Data::ProfilesCommands> steps,
114114
const std::string& dependenciesCopiedDirectory,
115115
bool required)
116116
{
@@ -131,7 +131,7 @@ namespace
131131
return true;
132132
}
133133

134-
const runcpp2::Data::DependencyCommands& dependencySteps =
134+
const runcpp2::Data::ProfilesCommands& dependencySteps =
135135
*runcpp2::GetValueFromPlatformMap(steps);
136136

137137
const std::vector<std::string>* commands =

0 commit comments

Comments
 (0)