Skip to content

Future of ament_build_type_gradle #9

Open

Description

@jacobperron

As I understand it, ament_tools is deprecated having been replaced by colcon as the build tool for ROS distros newer than Bouncy. Further, ament_build_type_gradle depends on ament_tools. I'm opening this issue to start a discussion about how to proceed for later ROS releases (e.g. Dashing).

If I ignore ament_build_type_gradle, I'm able to build ROS 2 Dashing with Java support, except some runtime environment information is missing for gradle packages (e.g. CLASSPATH, AMENT_PREFIX_PATH) and the packages are not registered with the ament index. My main question is where should these things be handled?

Should we keep the logic in ament_build_type_gradle and refactor so it doesn't use ament_tools?
Or perhaps we can move all of the functionality into ament_gradle_plugin?
It seems like what we want is a new package ament_index_java (similar to the C++ and Python packages) that provides helpers for registering/querying entries in the ament index. Then this new Java API can be called from ament_gradle_plugin or directly by the gradle package.

I'm new to gradle, so I'm still doing some reading and experimenting.

Activity

  1. esteve commented on Oct 9, 2019

    @esteve
    Member

    @jacobperron ament_build_type_gradle depends on ament_tools just because at the time ROS 2 was distributed only as a .repos file with ament_tools being one of the repos. The dependency was there only to force ament_tools to be built before building ament_build_type_gradle.

    In any case, there should be no need for ament_build_type_gradle now that https://github.com/colcon/colcon-ros-gradle is part of the colcon distribution. A good start would be to change the CI scripts to use colcon and fix whatever break.

  2. jacobperron commented on Oct 9, 2019

    @jacobperron
    ContributorAuthor

    @esteve Thanks for the reply 🙂

    In any case, there should be no need for ament_build_type_gradle now that https://github.com/colcon/colcon-ros-gradle is part of the colcon distribution.

    From trying to run examples, it appears we're missing some logic for setting the environment (CLASSPATH and AMENT_PREFIX_PATH) and registering with the ament index.

    This logic from ament_build_type_gradle needs to go somewhere:

    https://github.com/esteve/ament_java/blob/e6e23fbf54c2027999afa234474a4126175617cd/ament_build_type_gradle/ament_build_type_gradle/__init__.py#L151-L176

    https://github.com/esteve/ament_java/blob/e6e23fbf54c2027999afa234474a4126175617cd/ament_build_type_gradle/ament_build_type_gradle/__init__.py#L210-L225

    Even with colcon-ros-gradle installed, I am not able to run examples without manually setting up the environment. Though, I'm not sure that colcon-ros-gradle should be responsible for this, since I think we should be able to build an ament gradle package without colcon (e.g. gradle build).

    A good start would be to change the CI scripts to use colcon and fix whatever break.

    I'll do this too.

  3. nuclearsandwich commented on Oct 16, 2019

    @nuclearsandwich

    I think that we'll likely want a support package suite analogous to ament_cmake, that contains common code for handling the installation of package.xml files and ament index registration. We don't have one in Python because the setuptools format doesn't allow us to depend on third-party libraries during the setup itself. Keeping the code central allows us to update it in only one place which is far preferable to the approach necessary in Python.

  4. jacobperron commented on Feb 5, 2020

    @jacobperron
    ContributorAuthor

    I've added a support package ament_index_java that supports both ament index queries as well as registering new resources (like packages). Currently, registering a package only installs a marker file, though it might make sense to expand on this to also install a package.xml and/or provide shell rules for configuring your environment.

  5. talregev commented on Feb 15, 2020

    @talregev

    Can you try to compile with colcon?
    https://github.com/colcon/colcon-gradle
    https://github.com/colcon/colcon-ros-gradle
    I added them to pr

    I add a repo change that you could compile your ament java with colcon.
    I try it on windows with vs2019 and dashing. It compile.
    https://github.com/ros2-java/ament_java/pull/13/files

    Please try and let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions