Skip to content

Commit

Permalink
Merge ae5dbe1 into 7390bbe
Browse files Browse the repository at this point in the history
  • Loading branch information
scpeters authored Jul 20, 2023
2 parents 7390bbe + ae5dbe1 commit c4f634d
Show file tree
Hide file tree
Showing 26 changed files with 671 additions and 250 deletions.
110 changes: 110 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
load(
"@gz//bazel/skylark:build_defs.bzl",
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
)
load(
"@gz//bazel/lint:lint.bzl",
"add_lint_tests",
)

package(
default_visibility = GZ_VISIBILITY,
features = GZ_FEATURES,
)

licenses(["notice"]) # Apache-2.0

exports_files(["LICENSE"])

gz_configure_header(
name = "fuel_tools_config_hh",
src = "include/gz/fuel_tools/config.hh.in",
cmakelists = ["CMakeLists.txt"],
defines = {
# These definitions are unused,
# this is merely to suppress generator warnings
"CMAKE_INSTALL_PREFIX": "unused",
},
package = "fuel_tools",
)

gz_export_header(
name = "include/gz/fuel_tools/Export.hh",
export_base = "GZ_FUEL_TOOLS",
lib_name = "gz-fuel_tools",
visibility = ["//visibility:private"],
)

public_headers_no_gen = glob([
"include/gz/fuel_tools/*.hh",
])

private_headers = glob(["src/*.hh"])

sources = glob(
["src/*.cc"],
exclude = [
"src/gz.cc",
"src/*_TEST.cc",
],
)

gz_include_header(
name = "fuel_tools_hh_genrule",
out = "include/gz/fuel_tools.hh",
hdrs = public_headers_no_gen + [
"include/gz/fuel_tools/config.hh",
"include/gz/fuel_tools/Export.hh",
],
)

public_headers = public_headers_no_gen + [
"include/gz/fuel_tools/config.hh",
"include/gz/fuel_tools/Export.hh",
"include/gz/fuel_tools.hh",
]

cc_library(
name = "fuel_tools",
srcs = sources + private_headers,
hdrs = public_headers,
includes = ["include"],
deps = [
GZ_ROOT + "common",
GZ_ROOT + "msgs",
"@curl",
"@jsoncpp",
"@yaml",
"@zip",
],
)

test_sources = glob(
include = ["src/*_TEST.cc"],
exclude = [
"src/gz_TEST.cc",
"src/gz_src_TEST.cc",
],
)

[cc_test(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
env = {
"GZ_BAZEL": "1",
"GZ_BAZEL_PATH": "fuel_tools",
},
deps = [
":fuel_tools",
GZ_ROOT + "common/testing",
"@gtest",
"@gtest//:gtest_main",
],
) for src in test_sources]

add_lint_tests()
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ set(GZ_UTILS_VER ${gz-utils2_VERSION_MAJOR})

#--------------------------------------
# Find gz-common
gz_find_package(gz-common5 REQUIRED PRIVATE)
gz_find_package(gz-common5 REQUIRED PRIVATE COMPONENTS testing)
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})

#--------------------------------------
Expand All @@ -70,6 +70,7 @@ set(GZ_MSGS_VER ${gz-msgs10_VERSION_MAJOR})
#--------------------------------------
# Find gz-tools
find_program(HAVE_GZ_TOOLS gz)
set (GZ_TOOLS_VER 2)

#============================================================================
# Configure the build
Expand Down
27 changes: 27 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@

## Gazebo Fuel Tools 7.x

### Gazebo Fuel Tools 7.3.0 (2023-06-13)

1. Forward merges
* [Pull request #355](https://github.com/gazebosim/gz-fuel-tools/pull/355)

1. Add bash completion
* [Pull request #329](https://github.com/gazebosim/gz-fuel-tools/pull/329)

1. Reflect pagination of RESTful requests in iterator API
* [Pull request #350](https://github.com/gazebosim/gz-fuel-tools/pull/350)

1. Support link referral download
* [Pull request #333](https://github.com/gazebosim/gz-fuel-tools/pull/333)

### Gazebo Fuel Tools 7.2.2 (2023-03-29)

1. Support link referral download
Expand Down Expand Up @@ -293,6 +307,19 @@

### Gazebo Fuel Tools 4.8.3 (2023-03-29)

1. Support link referral download
* [Pull request #333](https://github.com/gazebosim/gz-fuel-tools/pull/333)

### Gazebo Fuel Tools 4.9.0 (2023-05-03)

1. Add bash completion
* [Pull request #329](https://github.com/gazebosim/gz-fuel-tools/pull/329)

1. Reflect pagination of RESTful requests in iterator API
* [Pull request #350](https://github.com/gazebosim/gz-fuel-tools/pull/350)

### Gazebo Fuel Tools 4.8.3 (2023-03-29)

1. Support link referral download
* [Pull request #333](https://github.com/gazebosim/gz-fuel-tools/pull/333)

Expand Down
6 changes: 6 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Gazebo Fuel Tools 8.X to 9.X

### Removals

* `GZ_FUEL_INITIAL_CONFIG_PATH` macro removed from `gz/fuel_tools/config.hh`

## Gazebo Fuel Tools 7.X to 8.X

### Deprecations
Expand Down
37 changes: 29 additions & 8 deletions include/gz/fuel_tools/FuelClient.hh
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,46 @@ namespace gz
/// \brief Returns models matching a given identifying criteria
/// \param[in] _id a partially filled out identifier used to fetch models
/// \remarks Fulfills Get-One requirement
/// \remarks It's not yet clear if model names are unique, so this API
/// \remarks Model names are unique to the owner, so this API
/// allows the possibility of getting multiple models with the
/// same name.
/// same name if the owner is not specified.
/// \return An iterator of models with names matching the criteria
public: ModelIter Models(const ModelIdentifier &_id);

/// \brief Returns models matching a given identifying criteria
/// \param[in] _id a partially filled out identifier used to fetch models
/// \remarks Fulfills Get-One requirement
/// \remarks It's not yet clear if model names are unique, so this API
/// \remarks Model names are unique to the owner, so this API
/// allows the possibility of getting multiple models with the
/// same name.
/// same name if the owner is not specified.
/// \return An iterator of models with names matching the criteria
public: ModelIter Models(const ModelIdentifier &_id) const;

/// \brief Returns an iterator for the models found in a collection.
/// \param[in] _id a partially filled out identifier used to fetch a
/// collection.
/// \return An iterator of models in the collection.
/// \brief Returns models matching a given identifying criteria
/// \param[in] _id a partially filled out identifier used to fetch models
/// \param[in] _checkCache Whether to check the cache.
/// \remarks Fulfills Get-One requirement
/// \remarks Model names are unique to the owner, so this API
/// allows the possibility of getting multiple models with the
/// same name if the owner is not specified.
/// \return An iterator of models with names matching the criteria
public: ModelIter Models(const ModelIdentifier &_id, bool _checkCache);

/// \brief Returns models matching a given identifying criteria
/// \param[in] _id a partially filled out identifier used to fetch models
/// \param[in] _checkCache Whether to check the cache.
/// \remarks Fulfills Get-One requirement
/// \remarks Model names are unique to the owner, so this API
/// allows the possibility of getting multiple models with the
/// same name if the owner is not specified.
/// \return An iterator of models with names matching the criteria
public: ModelIter Models(const ModelIdentifier &_id,
bool _checkCache) const;

/// \brief Returns an iterator for the models found in a collection.
/// \param[in] _id a partially filled out identifier used to fetch a
/// collection.
/// \return An iterator of models in the collection.
public: ModelIter Models(const CollectionIdentifier &_id) const;

/// \brief Returns worlds matching a given identifying criteria
Expand Down
2 changes: 0 additions & 2 deletions include/gz/fuel_tools/config.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@

#define GZ_FUEL_TOOLS_VERSION_HEADER "Gazebo Fuel Tools, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2017 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n"

#define GZ_FUEL_INITIAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/ignition/${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}/"

#endif
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ gz_build_tests(TYPE UNIT
TEST_LIST test_targets
LIB_DEPS
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-common${GZ_COMMON_VER}::testing
TINYXML2::TINYXML2
)

Expand Down
6 changes: 3 additions & 3 deletions src/ClientConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ ClientConfig::ClientConfig(const ClientConfig &_copy)
}

//////////////////////////////////////////////////
ClientConfig &ClientConfig::operator=(const ClientConfig &_rhs)
ClientConfig &ClientConfig::operator=(const ClientConfig &_copy)
{
*(this->dataPtr) = *(_rhs.dataPtr);
*(this->dataPtr) = *(_copy.dataPtr);

return *this;
}
Expand Down Expand Up @@ -526,7 +526,7 @@ std::string ClientConfig::AsString(const std::string &_prefix) const
<< _prefix << "Cache location: " << this->CacheLocation() << std::endl
<< _prefix << "Servers:" << std::endl;

for (auto s : this->Servers())
for (const auto &s : this->Servers())
{
out << _prefix << " ---" << std::endl;
out << _prefix << s.AsString(" ");
Expand Down
Loading

0 comments on commit c4f634d

Please sign in to comment.