From a1eb45b5539b145eb0b70b679f0fc32061b28f43 Mon Sep 17 00:00:00 2001 From: fmessmer Date: Fri, 14 Sep 2018 14:22:25 +0200 Subject: [PATCH 1/7] install rosjava_message artifacts to maven local --- src/genjava/templates/genjava_project/build.gradle.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/genjava/templates/genjava_project/build.gradle.in b/src/genjava/templates/genjava_project/build.gradle.in index a68c29f..d3a3cd1 100644 --- a/src/genjava/templates/genjava_project/build.gradle.in +++ b/src/genjava/templates/genjava_project/build.gradle.in @@ -114,4 +114,4 @@ task bugfixtask { jar.dependsOn(bugfixtask) -defaultTasks 'publish' +defaultTasks 'publish', 'install', 'info' From 1ed2ceb5fc76aab606b06c02f2a32f5aa4f075c0 Mon Sep 17 00:00:00 2001 From: fmessmer Date: Fri, 14 Sep 2018 14:22:48 +0200 Subject: [PATCH 2/7] fix verbosity plus additional debug output --- cmake/genjava-catkin-api.cmake.em | 18 +++++++++++++++++- src/genjava/genjava_main.py | 8 ++++---- src/genjava/gradle_project.py | 5 +++-- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/cmake/genjava-catkin-api.cmake.em b/cmake/genjava-catkin-api.cmake.em index edeeb3d..38a77f7 100644 --- a/cmake/genjava-catkin-api.cmake.em +++ b/cmake/genjava-catkin-api.cmake.em @@ -30,19 +30,35 @@ macro(generate_rosjava_messages) message(FATAL_ERROR "generate_rosjava_messages() called with unused arguments: ${ARG_UNPARSED_ARGUMENTS}") endif() catkin_rosjava_env_setup() + message(STATUS "ROS_GRADLE_VERBOSE: ${ROS_GRADLE_VERBOSE}") + message(STATUS "ROS_MAVEN_DEPLOYMENT_REPOSITORY: ${ROS_MAVEN_DEPLOYMENT_REPOSITORY}") + message(STATUS "ROS_MAVEN_REPOSITORY: ${ROS_MAVEN_REPOSITORY}") + message(STATUS "GRADLE_USER_HOME: ${GRADLE_USER_HOME}") set(ROS_GRADLE_VERBOSE $ENV{ROS_GRADLE_VERBOSE}) if(ROS_GRADLE_VERBOSE) set(verbosity "--verbosity") else() set(verbosity "") endif() + set(avoid_rebuilding "") + #set(avoid_rebuilding "--avoid-rebuilding") string(REPLACE ";" " " package_list "${ARG_PACKAGES}") + message(STATUS "#### ${PROJECT_NAME}_generate_artifacts ####") + message(STATUS "PROJECT_NAME: ${PROJECT_NAME}") + message(STATUS "CATKIN_ENV: ${CATKIN_ENV}") + message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") + message(STATUS "GENJAVA_MESSAGE_ARTIFACTS_BIN: ${GENJAVA_MESSAGE_ARTIFACTS_BIN}") + message(STATUS "verbosity: ${verbosity}") + message(STATUS "avoid_rebuilding: ${avoid_rebuilding}") + message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}") + message(STATUS "ARG_PACKAGES: ${ARG_PACKAGES}") + message(STATUS "package_list: ${package_list}") add_custom_target(${PROJECT_NAME}_generate_artifacts ALL COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE} ${GENJAVA_MESSAGE_ARTIFACTS_BIN} ${verbosity} - --avoid-rebuilding + ${avoid_rebuilding} -o ${CMAKE_CURRENT_BINARY_DIR} -p ${ARG_PACKAGES} # this has to be a list argument so it separates each arg (not a single string!) DEPENDS diff --git a/src/genjava/genjava_main.py b/src/genjava/genjava_main.py index 9a192e4..95699a1 100644 --- a/src/genjava/genjava_main.py +++ b/src/genjava/genjava_main.py @@ -77,7 +77,7 @@ def main(argv): changed and so forth. ''' args = parse_arguments(argv[1:]) - #print("genjava %s/%s" % (args.package, args.message)) + print("genjava.main %s" % (args)) if not args.compile: gradle_project.create(args.package, args.output_dir) else: @@ -88,7 +88,7 @@ def standalone_parse_arguments(argv): parser = argparse.ArgumentParser(description='Generate artifacts for any/all discoverable message packages.') parser.add_argument('-p', '--packages', action='store', nargs='*', default=[], help='a list of packages to generate artifacts for') parser.add_argument('-o', '--output-dir', action='store', default='build', help='output directory for the java code (e.g. build/foo_msgs)') - parser.add_argument('-v', '--verbose', default=False, action='store_true', help='enable verbosity in debugging (false)') + parser.add_argument('-v', '--verbosity', default=False, action='store_true', help='enable verbosity in debugging (false)') parser.add_argument('-f', '--fakeit', default=False, action='store_true', help='dont build, just list the packages it would build (false)') parser.add_argument('-a', '--avoid-rebuilding', default=False, action='store_true', help='avoid rebuilding if the working directory is already present (false)') parsed_arguments = parser.parse_args(argv) @@ -102,7 +102,7 @@ def standalone_main(argv): generate artifacts for. ''' args = standalone_parse_arguments(argv[1:]) - #print("genjava %s/%s/%s" % (args.package, args.output_dir, args.verbose)) + print("genjava.standalone_main %s" % (args)) sorted_package_tuples = rosjava_build_tools.catkin.index_message_package_dependencies_from_local_environment(package_name_list=args.packages) @@ -111,7 +111,7 @@ def standalone_main(argv): did_not_rebuild_these_packages = [] if not args.fakeit: for unused_relative_path, p in sorted_package_tuples: - result = gradle_project.standalone_create_and_build(p.name, args.output_dir, args.verbose, args.avoid_rebuilding) + result = gradle_project.standalone_create_and_build(p.name, args.output_dir, args.verbosity, args.avoid_rebuilding) if not result: did_not_rebuild_these_packages.append(p.name) if did_not_rebuild_these_packages: diff --git a/src/genjava/gradle_project.py b/src/genjava/gradle_project.py index ca1378e..d3e0ac2 100644 --- a/src/genjava/gradle_project.py +++ b/src/genjava/gradle_project.py @@ -152,6 +152,7 @@ def create(msg_pkg_name, output_dir): raise IOError("could not find %s among message packages. Does the that package have a on message_generation in its package.xml?" % msg_pkg_name) msg_dependencies = create_dependency_string(msg_pkg_name, msg_package_index) + print("msg_dependencies: %s" %msg_dependencies) create_gradle_wrapper(genjava_gradle_dir) pkg_directory = os.path.abspath(os.path.dirname(msg_package_index[msg_pkg_name].filename)) @@ -171,7 +172,7 @@ def build(msg_pkg_name, output_dir, verbosity): cmd = ['./gradlew'] if not verbosity: cmd.append('--quiet') - #print("COMMAND........................%s" % cmd) + print("COMMAND build ........................%s" % cmd) subprocess.call(cmd, stderr=subprocess.STDOUT,) @@ -195,6 +196,6 @@ def standalone_create_and_build(msg_pkg_name, output_dir, verbosity, avoid_rebui cmd = [gradle_wrapper, '-p', working_directory] if not verbosity: cmd.append('--quiet') - #print("COMMAND........................%s" % cmd) + print("COMMAND standalone_create_and_build ........................%s" % cmd) subprocess.call(cmd, stderr=subprocess.STDOUT,) return True From b1ab7b728b6f85d572fb4a62cfc53078a48a5e3e Mon Sep 17 00:00:00 2001 From: fmessmer Date: Mon, 30 Nov 2020 11:59:01 +0100 Subject: [PATCH 3/7] convert to package format 2 --- package.xml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/package.xml b/package.xml index a907f61..e3779b7 100644 --- a/package.xml +++ b/package.xml @@ -1,4 +1,4 @@ - + genjava 0.3.4 @@ -16,18 +16,11 @@ Daniel Stonier catkin - - genmsg - python-catkin-pkg - python-rospkg - rosjava_bootstrap - rosjava_build_tools - - genmsg - python-catkin-pkg - python-rospkg - rosjava_bootstrap - rosjava_build_tools + genmsg + python-catkin-pkg + python-rospkg + rosjava_bootstrap + rosjava_build_tools java From 0397398e3cb59b1c1ec035a97d2727b87cd423e0 Mon Sep 17 00:00:00 2001 From: fmessmer Date: Mon, 30 Nov 2020 12:00:58 +0100 Subject: [PATCH 4/7] Bump CMake version to avoid CMP0048 warning --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6410d12..6558258 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake ############################################################################## -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.0.2) project(genjava) ############################################################################## From d1adfd1b9100f259d726ab0bed1d10d27edab0cd Mon Sep 17 00:00:00 2001 From: fmessmer Date: Mon, 30 Nov 2020 12:01:11 +0100 Subject: [PATCH 5/7] use setuptools instead of distutils --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2b031ef..cf9ec7a 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from distutils.core import setup +from setuptools import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( From 742fd7beb314920ebc9b1ffec23d0f7dfff544fb Mon Sep 17 00:00:00 2001 From: fmessmer Date: Mon, 30 Nov 2020 12:01:30 +0100 Subject: [PATCH 6/7] ROS_PYTHON_VERSION conditional dependency --- package.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/package.xml b/package.xml index e3779b7..86233ab 100644 --- a/package.xml +++ b/package.xml @@ -1,4 +1,8 @@ - + + + genjava 0.3.4 @@ -16,9 +20,14 @@ Daniel Stonier catkin + python-setuptools + python3-setuptools + genmsg - python-catkin-pkg - python-rospkg + python-catkin-pkg + python-rospkg + python3-catkin-pkg + python3-rospkg rosjava_bootstrap rosjava_build_tools From 47a9f7c5bc818397149ee2626b73d7ff86e33bfb Mon Sep 17 00:00:00 2001 From: fmessmer Date: Tue, 5 Jan 2021 14:01:23 +0000 Subject: [PATCH 7/7] python 2to3 --- src/genjava/gradle_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/genjava/gradle_project.py b/src/genjava/gradle_project.py index 66a85a8..5ecfbca 100644 --- a/src/genjava/gradle_project.py +++ b/src/genjava/gradle_project.py @@ -79,7 +79,7 @@ def get_templates(): def populate_project(project_name, project_version, pkg_directory, gradle_project_dir, msg_dependencies): author = author_name() - for filename, template in get_templates().iteritems(): + for filename, template in get_templates().items(): contents = instantiate_genjava_template(template, project_name, project_version, pkg_directory, author, msg_dependencies) try: p = os.path.abspath(os.path.join(gradle_project_dir, filename))