Skip to content

Commit

Permalink
Documentation! Wow! (DLu#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
DLu authored Nov 19, 2020
1 parent db6376e commit a70e3a7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
25 changes: 22 additions & 3 deletions roscompile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ There are also some other useful scripts described at the bottom of this documen
The `to` name and email must be specified, but you only need to specify either the name or email for the `from`.

# Other Scripts
* `convert_to_format_2` Convert the `manifest.xml` from format 1 to format 2.
* `add_tests` Add roslaunch and/or roslint tests to your package, updating both the `manifest.xml` and `CMakeLists.txt`.
* `add_compile_options` Script to add C++ compile flags to your `CMakeLists.txt`
The other scripts work similarly to the main tool in that they run on all the packages found within your current folder.

### `upgrade_manifest`
Upgrade your `package.xml` to either format 2 or 3. Without any arguments, it will convert to format 2. `rosrun roscompile upgrade_manifest 3` will upgrade to format 3.

The deprecated version is `convert_to_format_2` which still exists and works, but is not preferred.

### `noetic_migration`
Migrates your package from a pre-Noetic version to be compatible with Noetic, invoked with `rosrun roscompile noetic_migration`. Adding the `-m` option is useful when using the same branch for Noetic and other distros AND you're using Python, as it will conditionally depend on the proper `python-` and `python3-` libraries.

### `add_compile_options`
This script will add C++ compile flags to your `CMakeLists.txt`.
* `-1` will add `-std=c++11`
* `-w` will add `-Wall`
* `-e` will add `-Werror`
* `-a` will add all of the above.

### `add_tests`
This script will add roslaunch and/or roslint tests to your package, updating both the `manifest.xml` and `CMakeLists.txt`.
* `-r` will add `roslaunch` tests.
* `-l` will add `roslint` tests.
* `-a` will add both
8 changes: 4 additions & 4 deletions roscompile/scripts/add_compile_options
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ from ros_introspection.cmake import Command
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('-1', '--cpp11', action='store_true')
parser.add_argument('-w', '--wall', action='store_true')
parser.add_argument('-e', '--werror', action='store_true')
parser.add_argument('-a', '--all', action='store_true')
parser.add_argument('-1', '--cpp11', action='store_true', help='Add -std=c++11 compile option')
parser.add_argument('-w', '--wall', action='store_true', help='Add -Wall compile option')
parser.add_argument('-e', '--werror', action='store_true', help='Add -Werror compile option')
parser.add_argument('-a', '--all', action='store_true', help='Add all three compile options')
args = parser.parse_args()

if not args.cpp11 and not args.wall and not args.werror and not args.all:
Expand Down
6 changes: 3 additions & 3 deletions roscompile/scripts/add_tests
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def add_test_command(test_section, cmd_name, values=None):


parser = argparse.ArgumentParser()
parser.add_argument('-r', '--roslaunch', action='store_true')
parser.add_argument('-l', '--lint', action='store_true')
parser.add_argument('-a', '--all', action='store_true')
parser.add_argument('-r', '--roslaunch', action='store_true', help='Add roslaunch tests')
parser.add_argument('-l', '--lint', action='store_true', help='Add roslint tests')
parser.add_argument('-a', '--all', action='store_true', help='Add roslaunch and roslint tests')
args = parser.parse_args()

if not args.roslaunch and not args.lint and not args.all:
Expand Down
3 changes: 2 additions & 1 deletion roscompile/scripts/upgrade_manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import argparse
from ros_introspection.util import get_packages

parser = argparse.ArgumentParser()
parser.add_argument('format', choices=[2, 3], type=int, default=2, nargs='?')
parser.add_argument('format', choices=[2, 3], type=int, default=2, nargs='?',
help='Format version to upgrade to. Default is 2')
args = parser.parse_args()

for package in get_packages():
Expand Down

0 comments on commit a70e3a7

Please sign in to comment.