Skip to content

Commit

Permalink
Add package.xml (#432)
Browse files Browse the repository at this point in the history
* Fix windows tests
* Disable bash completion test on windows


Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored Apr 23, 2024
1 parent 78e664a commit 4bb6e0d
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/package_xml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Validate package.xml

on:
pull_request:

jobs:
package-xml:
runs-on: ubuntu-latest
name: Validate package.xml
steps:
- uses: gazebo-tooling/action-gz-ci/validate_package_xml@jammy
8 changes: 7 additions & 1 deletion core/src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ set(cmd_script_configured "${CMAKE_CURRENT_BINARY_DIR}/cmd${GZ_DESIGNATION}${PRO

# Set the library_location variable to the relative path to the library file
# within the install directory structure.
set(library_location "../../../${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:${PROJECT_LIBRARY_TARGET_NAME}>")
if (MSVC)
set(library_location_prefix "${CMAKE_INSTALL_BINDIR}")
else()
set(library_location_prefix "${CMAKE_INSTALL_LIBDIR}")
endif()

set(library_location "../../../${library_location_prefix}/$<TARGET_FILE_NAME:${PROJECT_NAME}>")

configure_file(
"cmd${GZ_DESIGNATION}.rb.in"
Expand Down
10 changes: 9 additions & 1 deletion core/src/cmd/cmdmsgs.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ else
end

require 'optparse'
require 'pathname'

# Constants.
LIBRARY_NAME = '@library_location@'
Expand Down Expand Up @@ -101,7 +102,7 @@ class Cmd
# puts options

# Read the plugin that handles the command.
if LIBRARY_NAME[0] == '/'
if Pathname.new(LIBRARY_NAME).absolute?
# If the first character is a slash, we'll assume that we've been given an
# absolute path to the library. This is only used during test mode.
plugin = LIBRARY_NAME
Expand All @@ -112,6 +113,13 @@ class Cmd
end
conf_version = LIBRARY_VERSION

if defined? RubyInstaller
# RubyInstaller does not search for dlls in PATH or the directory that tests are running from,
# so we'll add the parent directory of the plugin to the search path.
# https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#-dll-loading
RubyInstaller::Runtime.add_dll_directory(File.dirname(plugin))
end

begin
Importer.dlload plugin
rescue DLError
Expand Down
26 changes: 26 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<package format="2">
<name>gz-msgs10</name>
<version>10.1.2</version>
<description>Gazebo Messages: Protobuf messages and functions for robot applications</description>
<maintainer email="[email protected]">Carlos Agüero</maintainer>
<license>Apache License 2.0</license>
<url type="website">https://github.com/gazebosim/gz-msgs</url>

<buildtool_depend>cmake</buildtool_depend>

<build_depend>gz-cmake3</build_depend>

<depend>gz-math7</depend>
<depend>gz-tools2</depend>
<depend>protobuf-dev</depend>
<depend>python3-protobuf</depend>
<depend>python3</depend>
<depend>tinyxml2</depend>

<test_depend>python3-pytest</test_depend>

<export>
<build_type>cmake</build_type>
</export>
</package>
3 changes: 2 additions & 1 deletion test/integration/gz_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <string>
#include <gtest/gtest.h>
#include <gz/msgs/config.hh>
#include <gz/utils/ExtraTestMacros.hh>
#include "test_config.hh"

#ifdef _MSC_VER
Expand Down Expand Up @@ -95,7 +96,7 @@ TEST(CmdLine, MsgInfo)
}

/////////////////////////////////////////////////
TEST(CmdLine, MsgHelpVsCompletionFlags)
TEST(CmdLine, GZ_UTILS_TEST_DISABLED_ON_WIN32(MsgHelpVsCompletionFlags))
{
// Flags in help message
auto helpOutput = custom_exec_str("gz msg --help --force-version "
Expand Down

0 comments on commit 4bb6e0d

Please sign in to comment.