diff --git a/Migration.md b/Migration.md index c0425956..d8581505 100644 --- a/Migration.md +++ b/Migration.md @@ -6,6 +6,11 @@ * **Replacement**: `gz` namespace * **Deprecation**: `ignition/...` headers * **Replacement**: `gz/...` headers +* The following `ign_` prefixed macros are deprecated and will be removed in future versions. + Additionally, they will only be available when including the corresponding `ignition/...` header. + Use the `gz_` prefix instead. + * `ign_strcat`, `ign_strcpy`, `ign_sprintf`, `ign_strdup` + ## Gazebo Fuel Tools 5.X to 6.X @@ -101,4 +106,3 @@ └── modelname ├── 1 └── 2 - diff --git a/README.md b/README.md index 8e58bbf9..0d548038 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ sudo apt install ruby-ffi libzip-dev libcurl-dev libjsoncpp-dev * Think about how to detect when new versions of remote models have been uploaded. * Idea of a hash. -* Add ignition fuel command line utilities for: +* Add Gazebo Fuel command line utilities for: * detail * create * delete diff --git a/conf/fuel.yaml.in b/conf/fuel.yaml.in index f6709e2a..95028c82 100644 --- a/conf/fuel.yaml.in +++ b/conf/fuel.yaml.in @@ -1,4 +1,4 @@ ---- # Subcommands available inside ignition fuel +--- # Subcommands available inside Gazebo Fuel format: 1.0.0 library_name: @PROJECT_NAME_NO_VERSION@ library_version: @PROJECT_VERSION_FULL@ diff --git a/include/gz/fuel_tools/ClientConfig.hh b/include/gz/fuel_tools/ClientConfig.hh index 3124345d..da7eb962 100644 --- a/include/gz/fuel_tools/ClientConfig.hh +++ b/include/gz/fuel_tools/ClientConfig.hh @@ -104,7 +104,7 @@ namespace gz private: std::unique_ptr dataPtr; }; - /// \brief High level interface to ignition fuel. + /// \brief High level interface to Gazebo Fuel. /// class GZ_FUEL_TOOLS_VISIBLE ClientConfig { diff --git a/include/gz/fuel_tools/FuelClient.hh b/include/gz/fuel_tools/FuelClient.hh index 2e571e85..ac46a3c1 100644 --- a/include/gz/fuel_tools/FuelClient.hh +++ b/include/gz/fuel_tools/FuelClient.hh @@ -48,7 +48,7 @@ namespace gz class ModelIdentifier; class ServerConfig; - /// \brief High level interface to ignition fuel + /// \brief High level interface to Gazebo Fuel class GZ_FUEL_TOOLS_VISIBLE FuelClient { /// \brief Default constructor. @@ -201,13 +201,13 @@ namespace gz public: Result DeleteUrl(const gz::common::URI &_uri, const std::vector &_headers); - /// \brief Download a model from ignition fuel. This will override an + /// \brief Download a model from Gazebo Fuel. This will override an /// existing local copy of the model. /// \param[in] _id The model identifier. /// \return Result of the download operation public: Result DownloadModel(const ModelIdentifier &_id); - /// \brief Download a model from ignition fuel. This will override an + /// \brief Download a model from Gazebo Fuel. This will override an /// existing local copy of the model. /// \param[in] _id The model identifier. /// \param[in] _headers Headers to set on the HTTP request. @@ -215,7 +215,7 @@ namespace gz public: Result DownloadModel(const ModelIdentifier &_id, const std::vector &_headers); - /// \brief Download a model from ignition fuel. This will override an + /// \brief Download a model from Gazebo Fuel. This will override an /// existing local copy of the model. /// \param[in] _id The model identifier. /// \param[in] _headers Headers to set on the HTTP request. @@ -254,7 +254,7 @@ namespace gz public: Result DownloadWorld(WorldIdentifier &_id, const std::vector &_headers); - /// \brief Download a model from ignition fuel. This will override an + /// \brief Download a model from Gazebo Fuel. This will override an /// existing local copy of the model. /// \param[in] _modelUrl The unique URL of the model to download. /// E.g.: https://fuel.ignitionrobotics.org/1.0/caguero/models/Beer @@ -263,7 +263,7 @@ namespace gz public: Result DownloadModel(const common::URI &_modelUrl, std::string &_path); - /// \brief Download a world from ignition fuel. This will override an + /// \brief Download a world from Gazebo Fuel. This will override an /// existing local copy of the world. /// \param[in] _worldUrl The unique URL of the world to download. /// E.g.: https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty @@ -274,7 +274,7 @@ namespace gz using ModelResult = std::tuple; - /// \brief Download a list of models from ignition fuel. + /// \brief Download a list of models from Gazebo Fuel. /// \param[in] _ids The list of model ids to download. /// This will also find all recursive dependencies of the models /// \param[in] _jobs Number of parallel jobs to use to download models @@ -286,7 +286,7 @@ namespace gz const std::vector &_ids, size_t _jobs = 2); - /// \brief Download a list of mworlds from ignition fuel. + /// \brief Download a list of mworlds from Gazebo Fuel. /// \param[in] _ids The list of world ids to download. /// \param[in] _jobs Number of parallel jobs to use to download worlds. /// \return Result of the download operation. diff --git a/include/gz/fuel_tools/Helpers.hh b/include/gz/fuel_tools/Helpers.hh index 5027a349..b04e91c0 100644 --- a/include/gz/fuel_tools/Helpers.hh +++ b/include/gz/fuel_tools/Helpers.hh @@ -24,15 +24,15 @@ // Use safer functions on Windows #ifdef _MSC_VER - #define ign_strcat strcat_s - #define ign_strcpy strcpy_s - #define ign_sprintf sprintf_s - #define ign_strdup _strdup + #define gz_strcat strcat_s + #define gz_strcpy strcpy_s + #define gz_sprintf sprintf_s + #define gz_strdup _strdup #else - #define ign_strcat std::strcat - #define ign_strcpy std::strcpy - #define ign_sprintf std::sprintf - #define ign_strdup strdup + #define gz_strcat std::strcat + #define gz_strcpy std::strcpy + #define gz_sprintf std::sprintf + #define gz_strdup strdup #endif namespace gz @@ -50,4 +50,3 @@ std::string uriToPath(const gz::common::URI &_uri); // IGNITION_FUEL_TOOLS_HELPERS_HH_ #endif - diff --git a/include/gz/fuel_tools/Interface.hh b/include/gz/fuel_tools/Interface.hh index c38e6eeb..25530135 100644 --- a/include/gz/fuel_tools/Interface.hh +++ b/include/gz/fuel_tools/Interface.hh @@ -24,7 +24,7 @@ namespace gz namespace fuel_tools { /// \brief Download the specified resource into the default configuration of - /// fuel tools. This will place the asset in ~/.ignition/fuel. + /// fuel tools. This will place the asset in ~/.gz/fuel. /// \param[in] _uri URI to the asset. /// \return Path to the downloaded asset. Empty on error. GZ_FUEL_TOOLS_VISIBLE std::string fetchResource( diff --git a/include/ignition/fuel_tools/Helpers.hh b/include/ignition/fuel_tools/Helpers.hh index 654835d9..990c4a60 100644 --- a/include/ignition/fuel_tools/Helpers.hh +++ b/include/ignition/fuel_tools/Helpers.hh @@ -17,3 +17,8 @@ #include #include + +#define ign_strcat gz_strcat +#define ign_strcpy gz_strcpy +#define ign_sprintf gz_sprintf +#define ign_strdup gz_strdup diff --git a/src/ClientConfig.cc b/src/ClientConfig.cc index 9fe5f3c3..043e32f4 100644 --- a/src/ClientConfig.cc +++ b/src/ClientConfig.cc @@ -39,7 +39,7 @@ class gz::fuel_tools::ClientConfigPrivate public: ClientConfigPrivate() { std::string homePath; - gz::common::env(IGN_HOMEDIR, homePath); + gz::common::env(GZ_HOMEDIR, homePath); this->cacheLocation = common::joinPaths( homePath, ".ignition", "fuel"); @@ -208,7 +208,7 @@ ClientConfig::ClientConfig() : dataPtr(new ClientConfigPrivate) if (gz::common::env("IGN_FUEL_CACHE_PATH", gzFuelPath)) { gzwarn << "Using deprecated environment variable [IGN_FUEL_CACHE_PATH] " - << "set cache path. Please use [GZ_FUEL_CACHE_PATH] instead." + << "to set cache path. Please use [GZ_FUEL_CACHE_PATH] instead." << std::endl; } else @@ -426,7 +426,7 @@ bool ClientConfig::LoadConfig(const std::string &_file) // Default cache path. std::string homePath; - gz::common::env(IGN_HOMEDIR, homePath); + gz::common::env(GZ_HOMEDIR, homePath); std::string cacheLocation = gz::common::joinPaths( homePath, ".ignition", "fuel"); @@ -446,7 +446,7 @@ bool ClientConfig::LoadConfig(const std::string &_file) else if (gz::common::env("IGN_FUEL_CACHE_PATH", gzFuelPath)) { gzwarn << "Using deprecated environment variable [IGN_FUEL_CACHE_PATH] " - << "set cache path. Please use [GZ_FUEL_CACHE_PATH] instead." + << "to set cache path. Please use [GZ_FUEL_CACHE_PATH] instead." << std::endl; gzwarn << "GZ_FUEL_CACHE_PATH is set to [" << gzFuelPath << "]. The " diff --git a/src/FuelClient_TEST.cc b/src/FuelClient_TEST.cc index 0354d0b4..47ffae96 100644 --- a/src/FuelClient_TEST.cc +++ b/src/FuelClient_TEST.cc @@ -598,7 +598,7 @@ TEST_F(FuelClientTest, DownloadModel) ///////////////////////////////////////////////// // Windows doesn't support colons in filenames // https://github.com/gazebosim/gz-fuel-tools/issues/106 -TEST_F(FuelClientTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(ModelDependencies)) +TEST_F(FuelClientTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(ModelDependencies)) { // Configure to use binary path as cache ASSERT_EQ(0, ChangeDirectory(PROJECT_BINARY_PATH)); diff --git a/src/cmd/cmdfuel.rb.in b/src/cmd/cmdfuel.rb.in index cb268b9b..2a0b8529 100755 --- a/src/cmd/cmdfuel.rb.in +++ b/src/cmd/cmdfuel.rb.in @@ -361,12 +361,12 @@ class Cmd end # Read the library version. - Importer.extern 'char* ignitionVersion()' + Importer.extern 'char* gzVersion()' begin - plugin_version = Importer.ignitionVersion.to_s + plugin_version = Importer.gzVersion.to_s rescue DLError - puts "Library error: Problem running 'ignitionVersion()' from #{plugin}." - exit(-1) + puts "Library error: Problem running 'gzVersion()' from #{plugin}." + exit(-1) end # Sanity check: Verify that the version of the yaml file matches the version diff --git a/src/ign.cc b/src/ign.cc index f18180ef..bbdf36e0 100644 --- a/src/ign.cc +++ b/src/ign.cc @@ -285,7 +285,7 @@ extern "C" bool getOwnerWorlds( } ////////////////////////////////////////////////// -extern "C" GZ_FUEL_TOOLS_VISIBLE char *ignitionVersion() +extern "C" GZ_FUEL_TOOLS_VISIBLE char *gzVersion() { return strdup(GZ_FUEL_TOOLS_VERSION_FULL); } diff --git a/src/ign.hh b/src/ign.hh index 27b5b678..66252912 100644 --- a/src/ign.hh +++ b/src/ign.hh @@ -22,7 +22,7 @@ /// \brief External hook to read the library version. /// \return C-string representing the version. Ex.: 0.1.2 -extern "C" GZ_FUEL_TOOLS_VISIBLE char *ignitionVersion(); +extern "C" GZ_FUEL_TOOLS_VISIBLE char *gzVersion(); /// \brief Set verbosity level /// \param[in] _verbosity 0 to 4 diff --git a/src/ign_TEST.cc b/src/ign_TEST.cc index 7278c084..1b92f515 100644 --- a/src/ign_TEST.cc +++ b/src/ign_TEST.cc @@ -53,7 +53,7 @@ auto g_listCmd = "ign fuel list -v 4 --force-version " + g_version; ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 -TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Versions)) +TEST(CmdLine, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Versions)) { auto output = custom_exec_str("ign fuel --versions"); EXPECT_NE(output.find(g_version), std::string::npos) << output; @@ -61,7 +61,7 @@ TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Versions)) ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 -TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Help)) +TEST(CmdLine, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Help)) { auto output = custom_exec_str("ign fuel --force-version " + g_version + " --help"); @@ -76,7 +76,7 @@ TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Help)) ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 -TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ListFail)) +TEST(CmdLine, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ListFail)) { auto output = custom_exec_str(g_listCmd); EXPECT_NE(output.find("Missing resource type"), std::string::npos) << output; @@ -96,7 +96,7 @@ TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ListFail)) ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 TEST(CmdLine, - IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ModelListConfigServerUgly)) + GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ModelListConfigServerUgly)) { auto output = custom_exec_str(g_listCmd + " -t model --raw"); EXPECT_NE(output.find("https://fuel.ignitionrobotics.org/1.0/"), @@ -107,7 +107,7 @@ TEST(CmdLine, ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 TEST(CmdLine, - IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ModelListCustomServerPretty)) + GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ModelListCustomServerPretty)) { auto output = custom_exec_str( g_listCmd + " -t model -u https://staging-fuel.ignitionrobotics.org"); @@ -125,7 +125,7 @@ TEST(CmdLine, ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 -TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListConfigServerUgly)) +TEST(CmdLine, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListConfigServerUgly)) { auto output = custom_exec_str(g_listCmd + " -t world --raw -u https://staging-fuel.ignitionrobotics.org"); @@ -137,7 +137,7 @@ TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListConfigServerUgly)) ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 TEST(CmdLine, - IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListCustomServerPretty)) + GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListCustomServerPretty)) { auto output = custom_exec_str( g_listCmd + " -t world -u https://staging-fuel.ignitionrobotics.org"); diff --git a/test/test_config.h.in b/test/test_config.h.in index 5865f0f9..705df317 100644 --- a/test/test_config.h.in +++ b/test/test_config.h.in @@ -119,9 +119,9 @@ namespace testing PROCESS_INFORMATION processInfo; char cmd[500]; - ign_strcpy(cmd, _command); - ign_strcat(cmd, " "); - ign_strcat(cmd, _partition); + gz_strcpy(cmd, _command); + gz_strcat(cmd, " "); + gz_strcat(cmd, _partition); if (!CreateProcess(NULL, const_cast(cmd), NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo))