Skip to content

Commit

Permalink
Merge pull request #89 from gazebosim/scpeters/merge_2_3
Browse files Browse the repository at this point in the history
Merge gz-utils2 ➡️  main
  • Loading branch information
scpeters authored Dec 16, 2022
2 parents adb150f + d50f508 commit 215e325
Show file tree
Hide file tree
Showing 9 changed files with 209 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Ubuntu Focal CI
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@focal
Expand All @@ -21,7 +21,7 @@ jobs:
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ find_package(gz-cmake3 REQUIRED)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project(VERSION_SUFFIX pre1)
gz_configure_project(VERSION_SUFFIX)

#============================================================================
# Set project-specific options
Expand Down
58 changes: 58 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,66 @@

## Gazebo Utils 2.0.0 (20XX-XX-XX)

1. Improve install instructions
* [Pull request #80](https://github.com/gazebosim/gz-utils/pull/80)

1. Round out ExtraTestMacros
* [Pull request #74](https://github.com/gazebosim/gz-utils/pull/74)

1. Update GoogleTest to latest version
* [Pull request #63](https://github.com/gazebosim/gz-utils/pull/63)
* [Pull request #77](https://github.com/gazebosim/gz-utils/pull/77)

1. cli_TEST: Fix compatibility with CLI11 2.0
* [Pull request #60](https://github.com/gazebosim/gz-utils/pull/60)

1. Include `<functional>` in FormatterFwd
* [Pull request #58](https://github.com/gazebosim/gz-utils/pull/58)

1. `ign` to `gz` Migration
* [Pull request #53](https://github.com/gazebosim/gz-utils/pull/53)
* [Pull request #55](https://github.com/gazebosim/gz-utils/pull/55)
* [Pull request #57](https://github.com/gazebosim/gz-utils/pull/57)
* [Pull request #59](https://github.com/gazebosim/gz-utils/pull/59)
* [Pull request #61](https://github.com/gazebosim/gz-utils/pull/61)
* [Pull request #62](https://github.com/gazebosim/gz-utils/pull/62)
* [Pull request #64](https://github.com/gazebosim/gz-utils/pull/64)
* [Pull request #65](https://github.com/gazebosim/gz-utils/pull/65)
* [Pull request #67](https://github.com/gazebosim/gz-utils/pull/67)
* [Pull request #69](https://github.com/gazebosim/gz-utils/pull/69)
* [Pull request #70](https://github.com/gazebosim/gz-utils/pull/70)

1. Infrastructure
* [Pull request #43](https://github.com/gazebosim/gz-utils/pull/43)
* [Pull request #49](https://github.com/gazebosim/gz-utils/pull/49)
* [Pull request #72](https://github.com/gazebosim/gz-utils/pull/72)

## Gazebo Utils 1.x

## Gazebo Utils 1.5.1 (2022-12-15)

1. Add missing config.hh include to gz headers
* [Pull request #90](https://github.com/gazebosim/gz-utils/pull/90)

## Gazebo Utils 1.5.0 (2022-12-08)

1. Ignition to Gazebo header migration.
* [Pull request #84](https://github.com/gazebosim/gz-utils/pull/84)

1. CI workflow: use checkout v3.
* [Pull request #85](https://github.com/gazebosim/gz-utils/pull/85)

## Gazebo Utils 1.4.1 (2022-11-17)

1. Include <functional> in FormatterFwd.
* [Pull request #58](https://github.com/gazebosim/gz-utils/pull/58)

1. cli_TEST: Fix compatibility with CLI11 2.0.
* [Pull request #60](https://github.com/gazebosim/gz-utils/pull/60)

1. Add code coverage ignore file.
* [Pull request #72](https://github.com/gazebosim/gz-utils/pull/72)

## Gazebo Utils 1.4.0 (2022-03-29)

1. Enable cpplint
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Build | Status
-- | --
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-utils)
Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_utils-ci-main-focal-amd64)](https://build.osrfoundation.org/job/ignition_utils-ci-main-focal-amd64)
Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_utils-ci-main-focal-amd64)](https://build.osrfoundation.org/job/ignition_utils-ci-main-focal-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_utils-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_utils-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/job/ign_utils-ci-win/badge/icon)](https://build.osrfoundation.org/job/ign_utils-ci-win/)

Expand Down Expand Up @@ -49,7 +49,7 @@ Gazebo Utils provides a wide range of functionality, including:

# Install

See the [installation tutorial](https://gazebosim.org/api/utils/0.1/install.html).
See the [installation tutorial](https://gazebosim.org/api/utils/2.0/install.html).

# Usage

Expand Down Expand Up @@ -110,7 +110,7 @@ Refer to the following table for information about important directories and fil
```
gz-utils
├── examples Example programs.
├── include/gz/utils Header files.
├── include/gz/utils Header files.
├── src Source files and unit tests.
├── test
│ ├── integration Integration tests.
Expand Down
2 changes: 1 addition & 1 deletion include/ignition/utils/Environment.hh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Open Source Robotics Foundation
* Copyright (C) 2022 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion include/ignition/utils/NeverDestroyed.hh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Open Source Robotics Foundation
* Copyright (C) 2022 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gz_get_libsources_and_unittests(sources gtest_sources)

gz_create_core_library(SOURCES ${sources} CXX_STANDARD ${c++standard})
gz_create_core_library(SOURCES ${sources} CXX_STANDARD ${CMAKE_CXX_STANDARD})
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
12 changes: 7 additions & 5 deletions src/NeverDestroyed_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <random>
#include <unordered_map>

using namespace gz;

class Boom : public std::exception
{
};
Expand Down Expand Up @@ -63,7 +65,7 @@ GTEST_TEST(NeverDestroyed, NoBoomTest)
try
{
{
gz::utils::NeverDestroyed<DtorGoesBoom> foo;
utils::NeverDestroyed<DtorGoesBoom> foo;
}
ASSERT_TRUE(true);
}
Expand All @@ -83,11 +85,11 @@ class Singleton
public: void operator=(Singleton &&) = delete;
public: static Singleton &getInstance()
{
static gz::utils::NeverDestroyed<Singleton> instance;
static utils::NeverDestroyed<Singleton> instance;
return instance.Access();
}

private: friend gz::utils::NeverDestroyed<Singleton>;
private: friend utils::NeverDestroyed<Singleton>;
private: Singleton() = default;
};

Expand All @@ -108,7 +110,7 @@ enum class Foo
Foo ParseFoo(const std::string &foo_string)
{
using Dict = std::unordered_map<std::string, Foo>;
static const gz::utils::NeverDestroyed<Dict> string_to_enum{
static const utils::NeverDestroyed<Dict> string_to_enum{
std::initializer_list<Dict::value_type>{
{"bar", Foo::kBar},
{"baz", Foo::kBaz},
Expand All @@ -127,7 +129,7 @@ GTEST_TEST(NeverDestroyedExample, ParseFoo)
using Result = std::vector<std::uint_fast32_t>;
const Result &GetConstantMagicNumbers()
{
static const gz::utils::NeverDestroyed<Result> result{
static const utils::NeverDestroyed<Result> result{
[]()
{
Result prototype;
Expand Down
136 changes: 135 additions & 1 deletion tutorials/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,47 @@ sudo apt install libgz-utils<#>-dev
Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
which version you need.

### macOS

On macOS, add OSRF packages:
```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew tap osrf/simulation
```

Install Gazebo utils:
```
brew install gz-utils<#>
```

Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
which version you need.

### Windows

Install [Conda package management system](https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html).
Miniconda suffices.

Create if necessary, and activate a Conda environment:
```
conda create -n gz-ws
conda activate gz-ws
```

Install `gz-utils`:
```
conda install libgz-utils<#> --channel conda-forge
```

Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
which version you need.

## Source Install

Source installation can be performed in UNIX systems by first installing the
necessary prerequisites followed by building from source.

### Building from source
### Ubuntu

1. Install tools
```
Expand Down Expand Up @@ -84,3 +119,102 @@ necessary prerequisites followed by building from source.
```
sudo make install
```
### macOS
1. Clone the repository
```
git clone https://github.com/gazebosim/gz-utils -b gz-utils<#>
```
Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
which version you need.
2. Install dependencies
```
brew install --only-dependencies gz-utils<#>
```
Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
which version you need.
3. Configure and build
```
cd gz-utils
mkdir build
cd build
cmake ..
make
```
4. Optionally, install
```
sudo make install
```
### Windows
This assumes you have created and activated a Conda environment while installing the Prerequisites.
1. Navigate to where you would like to build the library, and clone the repository.
```
# Optionally, append `-b gz-utils#` (replace # with a number) to check out a specific version
git clone https://github.com/gazebosim/gz-utils.git
```
2. Configure and build
```
cd gz-utils
mkdir build
cd build
cmake .. -DBUILD_TESTING=OFF # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\install
cmake --build . --config Release
```
3. Optionally, install
```
cmake --install . --config Release
```
# Documentation
API and tutorials can be found at [https://gazebosim.org/libs/utils](https://gazebosim.org/libs/utils).
You can also generate the documentation from a clone of this repository by following these steps.
1. You will need Doxygen. On Ubuntu Doxygen can be installed using
```
sudo apt-get install doxygen
```
2. Clone the repository
```
git clone https://github.com/gazebosim/gz-utils
```
3. Configure and build the documentation.
```
cd gz-utils
mkdir build
cd build
cmake ../
make doc
```
4. View the documentation by running the following command from the build directory.
```
firefox doxygen/html/index.html
```
# Testing
Follow these steps to run tests and static code analysis in your clone of this repository.
1. Follow the [source install instruction](#source-install).
2. Run tests.
```
make test
```
3. Static code checker.
```
make codecheck
```

0 comments on commit 215e325

Please sign in to comment.