Showing with 450 additions and 128 deletions.
  1. +31 −9 CHANGELOG.rst
  2. +4 −2 CMakeLists.txt
  3. +1 −1 README.rst
  4. +8 −4 bin/catkin_make_isolated
  5. +50 −22 bin/catkin_prepare_release
  6. +1 −1 cmake/all.cmake
  7. +8 −0 cmake/catkinConfig.cmake.in
  8. +9 −1 cmake/em/order_packages.cmake.em
  9. +5 −3 cmake/em/pkg.pc.em
  10. +4 −1 cmake/env-hooks/05.catkin_make.bash
  11. +4 −1 cmake/env-hooks/05.catkin_make_isolated.bash
  12. +6 −3 cmake/python.cmake
  13. +8 −7 cmake/templates/pkg.context.pc.in
  14. +1 −1 cmake/templates/pkgConfig.cmake.in
  15. +4 −0 cmake/test/catkin_download_test_data.cmake
  16. +4 −0 cmake/test/download_test_data.cmake
  17. +4 −0 cmake/test/gtest.cmake
  18. +4 −0 cmake/test/nosetests.cmake
  19. +23 −6 cmake/test/run_tests.py
  20. +70 −9 cmake/test/tests.cmake
  21. +2 −2 doc/howto/building_executables.rst
  22. +2 −2 doc/howto/building_libraries.rst
  23. +6 −5 doc/howto/building_msgs.rst
  24. +5 −13 doc/howto/catkin_library_dependencies.rst
  25. +2 −2 doc/howto/catkin_overview.rst
  26. +9 −8 doc/howto/cpp_msg_dependencies.rst
  27. +56 −0 doc/howto/downloading_test_data.rst
  28. +1 −1 doc/howto/dynamic_reconfiguration.rst
  29. +31 −0 doc/howto/gtest_configuration.rst
  30. +5 −2 doc/howto/index.rst
  31. +1 −1 doc/howto/installing_cmake.rst
  32. +1 −1 doc/howto/installing_other.rst
  33. +1 −1 doc/howto/installing_python.rst
  34. +8 −4 doc/howto/python_module_dependencies.rst
  35. +27 −0 doc/howto/python_nose_configuration.rst
  36. +34 −0 doc/howto/rostest_configuration.rst
  37. +3 −13 doc/howto/system_library_dependencies.rst
  38. +1 −1 package.xml
  39. +6 −1 python/catkin/builder.py
40 changes: 31 additions & 9 deletions CHANGELOG.rst
Expand Up @@ -2,12 +2,34 @@
Changelog for package catkin
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.5.68 (2013-07-03)
-------------------
* add option CATKIN_ENABLE_TESTING to configure without tests
* add CTest support for all registered test types: gtest, nosetest, rostest
* add the --from-pkg option to catkin_make_isolated
* catkin_prepare_release:

* fix if git repo has multiple remotes (`#450 <https://github.com/ros/catkin/issues/450>`_)
* modify to not change the remote repo by default, add option --push for old behavior (`#451 <https://github.com/ros/catkin/issues/451>`_)

* add 'prefix' to generated pkg-config files (`#444 <https://github.com/ros/catkin/issues/444>`_)
* add dummy target to catkin_EXPORTED_TARGETS if empty (`#453 <https://github.com/ros/catkin/issues/453>`_)
* expose SETUPTOOLS_DEB_LAYOUT as option again (`#418 <https://github.com/ros/catkin/issues/418>`_)
* suppress stacktrace when topologic_order raises within generating CMake files (`#442 <https://github.com/ros/catkin/issues/442>`_)
* fixes:

* update check in generated pkgConfig.cmake files to work independent of cmake policy CMD0012 (`#452 <https://github.com/ros/catkin/issues/452>`_)
* fix generating pkg-config files with empty -I directives (fix `#445 <https://github.com/ros/catkin/issues/445>`_)

* update documentation, especially abput testing
* for a complete list of changes see the `commit log for 0.5.68 <https://github.com/ros/catkin/compare/0.5.67...0.5.68>`_

0.5.67 (2013-06-18)
-------------------
* fix --build and --directory auto completion for catkin_make(_isolated) (`#325 <https://github.com/ros/catkin/issues/325>`_)
* fix catkin_make(_isolated) auto completion on older versions of bash on OS X (`#325 <https://github.com/ros/catkin/issues/325>`_)
* add how-to documentation
* for a complete list of changes see the `commit log <https://github.com/ros/catkin/compare/0.5.66...0.5.67>`_
* for a complete list of changes see the `commit log for 0.5.67 <https://github.com/ros/catkin/compare/0.5.66...0.5.67>`_

0.5.66 (2013-06-06)
-------------------
Expand Down Expand Up @@ -48,7 +70,7 @@ Changelog for package catkin
* add generated CMake API to appear in the wiki (`#384 <https://github.com/ros/catkin/issues/384>`_)

* add and install LICENSE file (`#398 <https://github.com/ros/catkin/issues/398>`_)
* for a complete list of changes see the `commit log <https://github.com/ros/catkin/compare/0.5.65...0.5.66>`_
* for a complete list of changes see the `commit log for 0.5.66 <https://github.com/ros/catkin/compare/0.5.65...0.5.66>`_

0.5.65 (2013-03-21)
-------------------
Expand All @@ -64,7 +86,7 @@ Changelog for package catkin
* fix catkin_prepare_release bumping wrong part of the version (`#386 <https://github.com/ros/catkin/issues/386>`_)
* handle dependencies that are imported libraries (`#378 <https://github.com/ros/catkin/issues/378>`_)

* for a complete list of changes see the `commit log <https://github.com/ros/catkin/compare/0.5.64...0.5.65>`_
* for a complete list of changes see the `commit log for 0.5.65 <https://github.com/ros/catkin/compare/0.5.64...0.5.65>`_

0.5.64 (2013-03-08)
-------------------
Expand Down Expand Up @@ -116,7 +138,7 @@ Changelog for package catkin
* update doc on CFG_EXTRAS (`#353 <https://github.com/ros/catkin/issues/353>`_)
* general catkin docs (`#357 <https://github.com/ros/catkin/issues/357>`_)

* for a complete list of changes see the `commit log <https://github.com/ros/catkin/compare/0.5.63...0.5.64>`_
* for a complete list of changes see the `commit log for 0.5.64 <https://github.com/ros/catkin/compare/0.5.63...0.5.64>`_

0.5.63 (2013-01-24)
-------------------
Expand All @@ -139,7 +161,7 @@ Changelog for package catkin
* fix sourcing environment hooks
* improve several error messages in case of problems (`#318 <https://github.com/ros/catkin/issues/318>`_, `#320 <https://github.com/ros/catkin/issues/320>`_)

* for a complete list of changes see the `commit log <https://github.com/ros/catkin/compare/0.5.62...0.5.63>`_
* for a complete list of changes see the `commit log for 0.5.63 <https://github.com/ros/catkin/compare/0.5.62...0.5.63>`_

0.5.62 (2013-01-17)
-------------------
Expand All @@ -150,18 +172,18 @@ Changelog for package catkin
* source environment hooks for all workspace in correct order (`#316 <https://github.com/ros/catkin/issues/316>`_)
* fix PYTHON_PACKAGES_DIR and SETUPTOOLS_ARG_EXTRA to be up-to-date when passing -DSETUPTOOLS_DEB_LAYOUT=.. (`#314 <https://github.com/ros/catkin/issues/314>`_)

* for a complete list of changes see the `commit log <https://github.com/ros/catkin/compare/0.5.61...0.5.62>`_
* for a complete list of changes see the `commit log for 0.5.62 <https://github.com/ros/catkin/compare/0.5.61...0.5.62>`_

0.5.61 (2013-01-16)
-------------------
* yet another workaround for pkg-config handling static libraries (`#300 <https://github.com/ros/catkin/issues/300>`_)
* for a complete list of changes see the `commit log <https://github.com/ros/catkin/compare/0.5.60...0.5.61>`_
* for a complete list of changes see the `commit log for 0.5.61 <https://github.com/ros/catkin/compare/0.5.60...0.5.61>`_

0.5.60 (2013-01-15)
-------------------
* work around for pkg-config reordering libs with no -l prefix (`#300 <https://github.com/ros/catkin/issues/300>`_)
* fix colorizing of unicode text in catkin_make and catkin_make_isolated (`#310 <https://github.com/ros/catkin/issues/310>`_)
* for a complete list of changes see the `commit log <https://github.com/ros/catkin/compare/0.5.59...0.5.60>`_
* for a complete list of changes see the `commit log for 0.5.60 <https://github.com/ros/catkin/compare/0.5.59...0.5.60>`_

0.5.59 (2013-01-13)
-------------------
Expand All @@ -173,7 +195,7 @@ Changelog for package catkin
* fix catkin_toplogical_order (`#299 <https://github.com/ros/catkin/issues/299>`_)
* make plain cmake install to devel when --install not present (`#302 <https://github.com/ros/catkin/issues/302>`_)
* fix creating test_results folder before trying to use it when running tests
* for a complete list of changes see the `commit log <https://github.com/ros/catkin/compare/0.5.58...0.5.59>`_
* for a complete list of changes see the `commit log for 0.5.59 <https://github.com/ros/catkin/compare/0.5.58...0.5.59>`_

0.5.58 (2012-12-21)
-------------------
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Expand Up @@ -34,5 +34,7 @@ install(DIRECTORY cmake

catkin_python_setup()

catkin_add_nosetests(test/local_tests)
catkin_add_nosetests(test/unit_tests)
if(CATKIN_ENABLE_TESTING)
catkin_add_nosetests(test/local_tests)
catkin_add_nosetests(test/unit_tests)
endif()
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -7,4 +7,4 @@ to build some parts of `ROS <http://www.ros.org>`_
Documentation
-------------

http://ros.org/doc/groovy/api/catkin/html/
http://ros.org/doc/api/catkin/html/
12 changes: 8 additions & 4 deletions bin/catkin_make_isolated
Expand Up @@ -50,8 +50,11 @@ def parse_args(args=None):
help='Runs cmake explicitly for each catkin package.')
add('--no-color', action='store_true', default=False,
help='Disables colored output (only for catkin_make and CMake)')
add('--pkg', nargs='+', metavar='PKGNAME', dest='packages',
help='Invoke "make" on specific packages (only after initial invocation)')
pkg = parser.add_mutually_exclusive_group(required=False)
pkg.add_argument('--pkg', nargs='+', metavar='PKGNAME', dest='packages',
help='Invoke "make" on specific packages (only after initial invocation)')
pkg.add_argument('--from-pkg', metavar='PKGNAME', dest='from_package',
help='Restart catkin_make_isolated at the given package continuing from there.')
add('-q', '--quiet', action='store_true', default=False,
help='Suppresses the cmake and make output until an error occurs.')
add('--cmake-args', dest='cmake_args', nargs='*', type=str,
Expand Down Expand Up @@ -114,11 +117,12 @@ def main():
install=opts.install,
force_cmake=opts.force_cmake,
colorize=not opts.no_color,
build_packages=opts.packages,
build_packages=opts.packages or ([] if opts.from_package is None else [opts.from_package]),
quiet=opts.quiet,
cmake_args=cmake_args,
make_args=opts.make_args,
catkin_make_args=opts.catkin_make_args
catkin_make_args=opts.catkin_make_args,
continue_from_pkg=opts.from_package is not None
)

if __name__ == '__main__':
Expand Down
72 changes: 50 additions & 22 deletions bin/catkin_prepare_release
Expand Up @@ -50,18 +50,18 @@ def prompt_continue(msg, default):


def get_git_remote_and_branch(base_path):
cmd_remote = [_find_executable('git'), 'remote', 'show']
try:
remote = subprocess.check_output(cmd_remote, cwd=base_path).rstrip()
except subprocess.CalledProcessError as e:
raise RuntimeError('Could not determine git remote: %s' % str(e))

cmd_branch = [_find_executable('git'), 'rev-parse', '--abbrev-ref', 'HEAD']
try:
branch = subprocess.check_output(cmd_branch, cwd=base_path).rstrip()
except subprocess.CalledProcessError as e:
raise RuntimeError('Could not determine git branch: %s' % str(e))

cmd_remote = [_find_executable('git'), 'config', '--get', 'branch.%s.remote' % branch]
try:
remote = subprocess.check_output(cmd_remote, cwd=base_path).rstrip()
except subprocess.CalledProcessError as e:
raise RuntimeError('Could not determine git remote: %s' % str(e))

return (remote, branch)


Expand All @@ -76,17 +76,20 @@ def try_repo_push(base_path, vcs_type):
raise RuntimeError("Failed to push to repository: %s" % str(e))


def commit_package_xml_files(base_path, vcs_type, packages, message):
def commit_package_xml_files(base_path, vcs_type, packages, message, local_only=False):
package_xmls = [os.path.join(p, PACKAGE_MANIFEST_FILENAME) for p in packages.keys()]
cmd = [_find_executable(vcs_type), 'commit', '-m', message]
cmd += package_xmls
if local_only and vcs_type in ['svn']:
return cmd
try:
subprocess.check_call(cmd, cwd=base_path)
except subprocess.CalledProcessError as e:
raise RuntimeError("Failed to commit package.xml files: %s" % str(e))
return None


def tag_repository(base_path, vcs_type, new_version):
def tag_repository(base_path, vcs_type, new_version, local_only=False):
if vcs_type in ['bzr', 'git', 'hg']:
cmd = [_find_executable(vcs_type), 'tag', new_version]
elif vcs_type == 'svn':
Expand All @@ -106,10 +109,13 @@ def tag_repository(base_path, vcs_type, new_version):
cmd = 'svn cp -m "tagging %s" %s %s' % (new_version, svn_url, tag_url)
else:
assert False, 'Unknown vcs type: %s' % vcs_type
if local_only and vcs_type in ['svn']:
return cmd
try:
subprocess.check_call(cmd, cwd=base_path)
except subprocess.CalledProcessError as e:
raise RuntimeError("Failed to tag repository: %s" % str(e))
return None


def _find_executable(vcs_type):
Expand All @@ -124,6 +130,7 @@ def main():
parser = argparse.ArgumentParser(
description='Runs the commands to bump the version number, commit the modified %s files and create a tag in the repository.' % PACKAGE_MANIFEST_FILENAME)
parser.add_argument('--bump', choices=('major', 'minor', 'patch'), default='patch', help='Which part of the version number to bump? (default: %(default)s)')
parser.add_argument('-p', '--push', action='store_true', default=False, help='Push changes automatically instead of showing the commands only')
parser.add_argument('-y', '--non-interactive', action='store_true', default=False,
help="Run without user interaction, confirming all questions with 'yes'")
args = parser.parse_args()
Expand Down Expand Up @@ -174,38 +181,59 @@ def main():
if not args.non_interactive and not prompt_continue('Continue without changelogs', default=False):
raise RuntimeError("Skipping release, populate the changelog with 'catkin_generate_changelog' or manually.")

# verify that repository is pushable
try_repo_push(base_path, vcs_type)
if args.push:
# verify that repository is pushable
try_repo_push(base_path, vcs_type)

# bump version number
update_versions(packages.keys(), new_version)
print('Bump version from %s to %s' % (old_version, new_version))

# commands to run to push changes to remote
commands = []

print('Committing the package.xml files...')
commit_package_xml_files(base_path, vcs_type, packages, new_version)
cmd = commit_package_xml_files(base_path, vcs_type, packages, new_version, local_only=not args.push)
if cmd:
commands.append(cmd)

print('Tagging the repository...')
tag_repository(base_path, vcs_type, new_version)
cmd = tag_repository(base_path, vcs_type, new_version, local_only=not args.push)
if cmd:
commands.append(cmd)

# push changes to the repository
if vcs_type in ['bzr', 'git', 'hg']:
print('Pushing changes to the repository...')
cmd = [_find_executable(vcs_type), 'push']
if vcs_type == 'git':
cmd.extend(get_git_remote_and_branch(base_path))
try:
subprocess.check_call(cmd, cwd=base_path)
except subprocess.CalledProcessError as e:
raise RuntimeError("Failed to push changes to the repository: %s\n%s\n\nYou need to manually push the changes/tag to the repository." % str(e))
if args.push:
print('Pushing changes to the repository...')
try:
subprocess.check_call(cmd, cwd=base_path)
except subprocess.CalledProcessError as e:
raise RuntimeError("Failed to push changes to the repository: %s\n%s\n\nYou need to manually push the changes/tag to the repository." % str(e))
else:
commands.append(cmd)

# push tags to the repository
if vcs_type in ['git']:
print('Pushing tag to the repository...')
cmd = [_find_executable(vcs_type), 'push', '--tags']
try:
subprocess.check_call(cmd, cwd=base_path)
except subprocess.CalledProcessError as e:
raise RuntimeError("Failed to push tag to the repository: %s\n%s\n\nYou need to manually push the new tag to the repository." % str(e))
if args.push:
print('Pushing tag to the repository...')
try:
subprocess.check_call(cmd, cwd=base_path)
except subprocess.CalledProcessError as e:
raise RuntimeError("Failed to push tag to the repository: %s\n%s\n\nYou need to manually push the new tag to the repository." % str(e))
else:
commands.append(cmd)

if not args.push:
commands = [c for c in commands if c]
print('All local changes have been completed.')
print('To push the changes to the remote repository execute the following commands:')
for cmd in commands:
print(' %s' % ' '.join(cmd))


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion cmake/all.cmake
Expand Up @@ -120,11 +120,11 @@ foreach(filename
platform/lsb
platform/ubuntu
platform/windows
test/tests # defines CATKIN_ENABLE_TESTING, required by other test functions
test/catkin_download_test_data
test/download_test_data
test/gtest
test/nosetests
test/tests
tools/doxygen
tools/libraries
tools/rt
Expand Down
8 changes: 8 additions & 0 deletions cmake/catkinConfig.cmake.in
Expand Up @@ -89,6 +89,14 @@ endforeach()
list_insert_in_workspace_order(catkin_INCLUDE_DIRS ${catkin_INCLUDE_DIRS})
list_insert_in_workspace_order(catkin_LIBRARY_DIRS ${catkin_LIBRARY_DIRS})

# add dummy target to catkin_EXPORTED_TARGETS if empty
if(NOT catkin_EXPORTED_TARGETS)
if(NOT TARGET _catkin_empty_exported_target)
add_custom_target(_catkin_empty_exported_target)
endif()
list(APPEND catkin_EXPORTED_TARGETS _catkin_empty_exported_target)
endif()

# decrement recursion counter
math(EXPR _CATKIN_FIND_ "${_CATKIN_FIND_} - 1")

Expand Down
10 changes: 9 additions & 1 deletion cmake/em/order_packages.cmake.em
Expand Up @@ -9,8 +9,16 @@ try:
from catkin_pkg.topological_order import topological_order
except ImportError as e:
raise RuntimeError('ImportError: "from catkin_pkg.topological_order import topological_order" failed: %s\nMake sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.' % e)
try:
from catkin_pkg.package import InvalidPackage
except ImportError as e:
raise RuntimeError('ImportError: "from catkin_pkg.package import InvalidPackage" failed: %s\nMake sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.' % e)
# vars defined in order_packages.context.py.in
ordered_packages = topological_order(os.path.normpath(source_root_dir), whitelisted_packages, blacklisted_packages)
try:
ordered_packages = topological_order(os.path.normpath(source_root_dir), whitelisted_packages, blacklisted_packages)
except InvalidPackage as e:
print('message(FATAL_ERROR "%s")' % e)
ordered_packages = []
fatal_error = False
}@

Expand Down
8 changes: 5 additions & 3 deletions cmake/em/pkg.pc.em
@@ -1,6 +1,8 @@
prefix=@PROJECT_SPACE_DIR

Name: @(CATKIN_PACKAGE_PREFIX + PROJECT_NAME)
Description: Description of @PROJECT_NAME
Version: @PROJECT_VERSION
Cflags: @(' '.join(['-I%s' % include for include in PROJECT_ABSOLUTE_INCLUDE_DIRS.split(';')]))
Libs: -L@PROJECT_SPACE_DIR/lib @(' '.join([lib for lib in PKG_CONFIG_LIBRARIES_WITH_PREFIX.split(';')]))
Requires: @(PROJECT_CATKIN_DEPENDS.replace(';', ' '))
Cflags: @(' '.join(['-I%s' % include for include in PROJECT_ABSOLUTE_INCLUDE_DIRS]))
Libs: -L@PROJECT_SPACE_DIR/lib @(' '.join(PKG_CONFIG_LIBRARIES_WITH_PREFIX))
Requires: @(PROJECT_CATKIN_DEPENDS)
5 changes: 4 additions & 1 deletion cmake/env-hooks/05.catkin_make.bash
Expand Up @@ -14,14 +14,17 @@ function _catkin_make()
if [[ "$cur" == -DCMAKE_BUILD_TYPE=* ]]; then
# autocomplete CMake argument CMAKE_BUILD_TYPE with its options
COMPREPLY=( $( compgen -W "None Debug Release RelWithDebInfo MinSizeRel" -- "${cur:19}" ) )
elif [[ "$cur" == -DCATKIN_ENABLE_TESTING=* ]]; then
# autocomplete catkin argument CATKIN_ENABLE_TESTING with its options
COMPREPLY=( $( compgen -W "0 1" -- "${cur:24}" ) )
elif [[ "$cur" == -DCATKIN_DEVEL_PREFIX=* || "$cur" == -DCMAKE_INSTALL_PREFIX=* ]]; then
COMPREPLY=()
elif [[ "$cur" == -* ]]; then
local opts="$( _parse_help "$1" )"
[[ $opts ]] || opts="$( _parse_usage "$1" )"
if [[ "$cur" == -* ]]; then
# suggest some common CMake arguments
opts="$opts -DCMAKE_BUILD_TYPE= -DCATKIN_DEVEL_PREFIX= -DCMAKE_INSTALL_PREFIX="
opts="$opts -DCATKIN_DEVEL_PREFIX= -DCATKIN_ENABLE_TESTING= -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE="
fi
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
Expand Down
5 changes: 4 additions & 1 deletion cmake/env-hooks/05.catkin_make_isolated.bash
Expand Up @@ -14,12 +14,15 @@ function _catkin_make_isolated()
if [[ "$cur" == -DCMAKE_BUILD_TYPE=* ]]; then
# autocomplete CMake argument CMAKE_BUILD_TYPE with its options
COMPREPLY=( $( compgen -W "None Debug Release RelWithDebInfo MinSizeRel" -- "${cur:19}" ) )
elif [[ "$cur" == -DCATKIN_ENABLE_TESTING=* ]]; then
# autocomplete catkin argument CATKIN_ENABLE_TESTING with its options
COMPREPLY=( $( compgen -W "0 1" -- "${cur:24}" ) )
elif [[ "$cur" == -* ]]; then
local opts="$( _parse_help "$1" )"
[[ $opts ]] || opts="$( _parse_usage "$1" )"
if [[ "$cur" == -* ]]; then
# suggest some common CMake arguments
opts="$opts -DCMAKE_BUILD_TYPE="
opts="$opts -DCATKIN_ENABLE_TESTING= -DCMAKE_BUILD_TYPE="
fi
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
Expand Down