Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Merge branch 'kinetic' into obsolete/master
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGELOG.rst
	CMakeLists.txt
	cmake/rosjava.cmake.em
	env-hooks/15.rosjava.bash.em
	env-hooks/15.rosjava.sh.em
	package.xml
	src/rosjava_build_tools/create_android_project.py
	src/rosjava_build_tools/gradle/gradle/wrapper/gradle-wrapper.jar
	src/rosjava_build_tools/gradle/gradle/wrapper/gradle-wrapper.properties
	src/rosjava_build_tools/release.py
	src/rosjava_build_tools/templates/android_package/build.gradle.in
	src/rosjava_build_tools/templates/android_project/build.gradle.in
	src/rosjava_build_tools/templates/rosjava_msg_project/build.gradle.in
	src/rosjava_build_tools/templates/rosjava_package/CMakeLists.txt.in
	src/rosjava_build_tools/templates/rosjava_package/build.gradle.in
	src/rosjava_build_tools/templates/rosjava_project/build.gradle.in
  • Loading branch information
Julian Cerruti committed Dec 26, 2016
2 parents acd088d + 662c622 commit 08256a0
Show file tree
Hide file tree
Showing 31 changed files with 555 additions and 208 deletions.
71 changes: 71 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,83 @@
Changelog
^^^^^^^^^

0.3.0 (2016-12-14)
------------------
* Updates for Kinetic release.

0.2.4 (2015-06-03)
------------------
* bugfix environment hooks for workspaces with spaces.

0.2.3 (2015-03-01)
------------------
* publically expose the rosjava environment setup (for genjava).
* Contributors: Daniel Stonier

0.2.2 (2015-02-25)
------------------
* support for finding broken message packages.
* Contributors: Daniel Stonier

0.2.1 (2015-02-25)
------------------
* upgrade catkin create scripts for indigo
* support modules for genjava
* deprecated create msg package scripts
* minor bugfixes and improvements.
* Contributors: Benjamin Chrétien, Daniel Stonier, Martin Pecka

0.2.0 [2013-10-25]
==================
* official maven style open range dependencies in templates
* gradle 1.7->1.8
* android build tools 18.1.1

0.1.34 (2014-06-12)
===================
* assist rospack to speedup by ignoring the installed maven directories.

0.1.33 [2014-03-19]
===================
* gradle 1.9->1.11

0.1.32 [2014-02-20]
===================
* bugfix catkin_make on empty catkin_created gradle projects.

0.1.31 [2014-02-03]
===================
* separate app and library catkin_create_rosjava_xxx_project scripts.
* app rosjava project integration with catkin_make (i.e. cmake-gradle targets).

0.1.30 [2013-12-26]
===================
* rosdistro scraping more intelligent : now checks for message_generation dependant packages
* gradle 1.8->1.9 upgrade in templates

0.1.29 [2013-11-08]
===================
* fix single artifact message generation when there is dependencies.

0.1.28 [2013-10-30]
===================
* seed ROS_MAVEN_REPOSITORY when necessary.

0.1.27 [2013-10-30]
===================
* use ROS_MAVEN_REPOSITORY to configure the external repository.

0.1.26 [2013-10-26]
===================
* embedded gradle 1.7->1.8
* templates updated for official maven style open ranged dependencies

0.1.25 [2013-10-26]
===================

* gradle 1.7->1.8
* android tools 17->18.1.1

0.1.24 [2013-10-04]
===================

Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ install(
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

set(ROS_MAVEN_DEPLOYMENT_REPOSITORY $ENV{ROS_MAVEN_DEPLOYMENT_REPOSITORY})
if(NOT ROS_MAVEN_DEPLOYMENT_REPOSITORY)
set(ROS_MAVEN_DEPLOYMENT_REPOSITORY "${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_SHARE_DESTINATION}/maven")
endif()
file(WRITE ${ROS_MAVEN_DEPLOYMENT_REPOSITORY}/rospack_nosubdirs "")
install(FILES ${ROS_MAVEN_DEPLOYMENT_REPOSITORY}/rospack_nosubdirs
DESTINATION ${CATKIN_GLOBAL_SHARE_DESTINATION}/maven)
53 changes: 4 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,9 @@
# RosJava Tools
See [rosjava_core](https://github.com/rosjava/rosjava_core) readme.

Build tools for rosjava and android repositories. Currently includes some cmake macros and python creation
scripts.
## Moving ##

This documentation will eventually merge with the rosjava_core and android_core documentation.

## RosJava Build Demo


```
> mkdir -p ~/rosjava/src
> cd ~/rosjava/src
> catkin_init_workspace .
> wstool init .
> wstool set rosjava_build_tools --git https://github.com/rosjava/rosjava_build_tools -v hydro-devel
> wstool set rosjava_core --git https://github.com/rosjava/rosjava_core -v hydro-devel
> wstool update
> cd ~/rosjava
> catkin_make
```

The only changes made to the `rosjava_core` repo was to add a `package.xml` with a depends on `rosjava_build_tools` and a
changes to the `CMakeLists.txt` as follows:

```
...
find_package(catkin REQUIRED rosjava_build_tools)
catkin_rosjava_setup()
```

This cmake makro sets up dummy targets in the cmake configuration which call out to gradle in the actual make step.
It also parses the `package.xml` to add target dependencies from each `build_depends` tag (subsequently letting you
sequence builds across repositories).

It also adds a global and package `gradle-clean` target.

```
> catkin_make
# Clean a single gradle package
> cd ~/rosjava/build/rosjava_core
> make gradle-clean-rosjava_core
# Clean all gradle packages
> cd ~/rosjava/build
> make gradle-clean
```

## Android Build Demo
## Usage ##

Refer to http://ros.org/wiki/rosjava_build_tools.

## Moving

This documentation will eventually merge with the rosjava_core and android_core documentation.
44 changes: 28 additions & 16 deletions cmake/rosjava.cmake.em
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ endmacro()
# CATKIN_ENV won't have any configuration, so we need some incoming here.
# Note that we check for the variable existence as well so we don't
# override a user setting.
macro(_rosjava_env)
macro(catkin_rosjava_env_setup)
set(ROS_GRADLE_VERBOSE $ENV{ROS_GRADLE_VERBOSE})
set(ROS_MAVEN_DEPLOYMENT_REPOSITORY $ENV{ROS_MAVEN_DEPLOYMENT_REPOSITORY})
set(ROS_MAVEN_REPOSITORY $ENV{ROS_MAVEN_REPOSITORY})
if(NOT ROS_MAVEN_DEPLOYMENT_REPOSITORY)
Expand All @@ -68,34 +69,49 @@ endmacro()
# Calls the gradle wrapper to compile just the package
# that it is called in with install and installApp targets.
macro(catkin_rosjava_setup)
_rosjava_env()
catkin_rosjava_env_setup()
find_gradle()
if( ${ARGC} EQUAL 0 )
# Note : COMMAND is a list of variables (semi-colon separated)
set(gradle_tasks "uploadArchives") # old targets "install;installApp;uploadArchives"
return() # Nothing to do (typically no subprojects created yet)
else()
set(gradle_tasks ${ARGV})
endif()
add_custom_target(gradle-${PROJECT_NAME}
ALL
COMMAND ${ROSJAVA_ENV} ${CATKIN_ENV} "env" "|" "grep" "ROS"
COMMAND ${ROSJAVA_ENV} ${CATKIN_ENV} ${${PROJECT_NAME}_gradle_BINARY} ${gradle_tasks}
if(ROS_GRADLE_VERBOSE)
set(gradle_options "")
else()
set(gradle_options "-q")
endif()
###################################
# Execution
###################################
add_custom_target(gradle-${PROJECT_NAME} ALL
#COMMAND ${ROSJAVA_ENV} ${CATKIN_ENV} "env" "|" "grep" "ROS"
COMMAND ${ROSJAVA_ENV} ${CATKIN_ENV} ${${PROJECT_NAME}_gradle_BINARY} ${gradle_options} ${gradle_tasks}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
COMMENT "Gradling tasks for ${PROJECT_NAME}"
)
###################################
# Target Management
###################################
catkin_package_xml()
foreach(depends in ${${PROJECT_NAME}_BUILD_DEPENDS})
foreach(depends ${${PROJECT_NAME}_BUILD_DEPENDS})
if(TARGET gradle-${depends})
#message(STATUS "Adding dependency gradle-${depends}")
#message(STATUS "Adding dependency.....gradle-${PROJECT_NAME} <- gradle-${depends}")
add_dependencies(gradle-${PROJECT_NAME} gradle-${depends})
endif()
if(TARGET ${depends}_generate_messages)
#message(STATUS "Adding dependency.....gradle-${PROJECT_NAME} <- ${depends}_generate_messages")
add_dependencies(gradle-${PROJECT_NAME} ${depends}_generate_messages)
endif()
endforeach()
if(NOT TARGET gradle-clean)
add_custom_target(gradle-clean)
endif()
add_custom_target(gradle-clean-${PROJECT_NAME}
COMMAND ${CATKIN_ENV} ${${PROJECT_NAME}_gradle_BINARY} clean
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Cleaning gradle project for ${PROJECT_NAME}"
)
add_dependencies(gradle-clean gradle-clean-${PROJECT_NAME})
endmacro()
Expand All @@ -107,14 +123,10 @@ endmacro()
# It checks the build type and determines whether it should run
# assembleDebug or assembleRelease
macro(catkin_android_setup)
_rosjava_env()
catkin_rosjava_env_setup()
find_gradle()
if( ${ARGC} EQUAL 0 )
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(gradle_tasks "assembleRelase")
else()
set(gradle_tasks "assembleDebug")
endif()
return() # Nothing to do (typically no subprojects created yet)
else()
set(gradle_tasks ${ARGV})
endif()
Expand Down
7 changes: 3 additions & 4 deletions env-hooks/15.rosjava.bash.em
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ SCRIPT=@(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py
SCRIPT=@(CMAKE_INSTALL_PREFIX)/share/rosjava_build_tools/generate_environment_variables.py
@[end if]@

export ROS_MAVEN_PATH=`python ${SCRIPT} --maven-path`
export ROS_MAVEN_DEPLOYMENT_REPOSITORY=`python ${SCRIPT} --maven-deployment-repository`
export ROS_MAVEN_REPOSITORY=`python ${SCRIPT} --maven-repository`

export ROS_MAVEN_PATH="`python ${SCRIPT} --maven-path`"
export ROS_MAVEN_DEPLOYMENT_REPOSITORY="`python ${SCRIPT} --maven-deployment-repository`"
export ROS_MAVEN_REPOSITORY="`python ${SCRIPT} --maven-repository`"
6 changes: 3 additions & 3 deletions env-hooks/15.rosjava.sh.em
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ SCRIPT=@(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py
SCRIPT=@(CMAKE_INSTALL_PREFIX)/share/rosjava_build_tools/generate_environment_variables.py
@[end if]@

export ROS_MAVEN_PATH=`python ${SCRIPT} --maven-path`
export ROS_MAVEN_DEPLOYMENT_REPOSITORY=`python ${SCRIPT} --maven-deployment-repository`
export ROS_MAVEN_REPOSITORY=`python ${SCRIPT} --maven-repository`
export ROS_MAVEN_PATH="`python ${SCRIPT} --maven-path`"
export ROS_MAVEN_DEPLOYMENT_REPOSITORY="`python ${SCRIPT} --maven-deployment-repository`"
export ROS_MAVEN_REPOSITORY="`python ${SCRIPT} --maven-repository`"
2 changes: 1 addition & 1 deletion generate_environment_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_workspaces(environ):
value = environ[env_name] if env_name in environ else ''
paths = [path for path in value.split(os.pathsep) if path]
# remove non-workspace paths
workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))]
workspaces = [path.replace(' ', '\ ') for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))]
return workspaces

def get_environment_variable(environ, key):
Expand Down
12 changes: 3 additions & 9 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
<package>
<name>rosjava_build_tools</name>
<version>0.2.0</version>
<version>0.3.0</version>
<description>
Simple tools and catkin modules for rosjava development.
Simple tools and catkin modules for rosjava development.
</description>
<maintainer email="[email protected]">Daniel Stonier</maintainer>
<license>BSD</license>
<url type="website">http://ros.org/wiki/rosjava_build_tools</url>
<url type="repository">https://github.com/ros-java/rosjava_build_tools</url>
<url type="bugtracker">https://github.com/ros-java/rosjava_build_tools/issues</url>
<author email="[email protected]">Daniel Stonier</author>
<author>Daniel Stonier</author>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>python-rospkg</build_depend>
<build_depend>rospy</build_depend>
<build_depend>java</build_depend>
<build_depend>ant</build_depend>
<build_depend>python-rosinstall-generator</build_depend>
<run_depend>python-rospkg</run_depend>
<run_depend>rospy</run_depend>
<run_depend>java</run_depend>
<run_depend>ant</run_depend>
<run_depend>catkin</run_depend>
<run_depend>python-rosinstall-generator</run_depend>
</package>
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#!/usr/bin/env python

"""This script creates the skeleton of an android library package"""
"""This script creates the skeleton of a rosjava library project"""

##############################################################################
# Imports
##############################################################################

from __future__ import print_function
import argparse
import os
import sys

from rosjava_build_tools import create_rosjava_msg_project
from rosjava_build_tools import create_rosjava_library_project
import rosjava_build_tools.console as console

##############################################################################
Expand All @@ -20,7 +18,7 @@ import rosjava_build_tools.console as console

if __name__ == "__main__":
try:
sys.exit(create_rosjava_msg_project())
sys.exit(create_rosjava_library_project())
except Exception as e:
console.logerror("%s : %s" % (str(e), type(e)))
sys.exit(1)
2 changes: 1 addition & 1 deletion scripts/catkin_create_rosjava_pkg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

"""This script creates the skeleton of an rosjava repo"""
"""This script creates the skeleton of a rosjava catkin package (typically an entire repo)"""

##############################################################################
# Imports
Expand Down
2 changes: 1 addition & 1 deletion scripts/catkin_create_rosjava_project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

"""This script creates the skeleton of an android library package"""
"""This script creates the skeleton of a rosjava application project"""

##############################################################################
# Imports
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@
'scripts/catkin_create_android_library_project',
'scripts/catkin_create_rosjava_pkg',
'scripts/catkin_create_rosjava_project',
'scripts/catkin_create_rosjava_msg_project',
'scripts/catkin_create_rosjava_library_project',
],
package_data = {'rosjava_build_tools': [
'templates/android_package/*',
'templates/android_project/*',
'templates/rosjava_msg_project/*',
'templates/rosjava_library_project/*',
'templates/rosjava_package/*',
'templates/rosjava_project/*',
'templates/init_repo/*',
]},
requires=['rospy' 'rospkg']
)

setup(**d)
3 changes: 2 additions & 1 deletion src/rosjava_build_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import console
from create_package import init_android_package, init_rosjava_package
from create_android_project import create_android_project
from create_rosjava_project import create_rosjava_project, create_rosjava_msg_project
from create_rosjava_project import create_rosjava_project, create_rosjava_msg_project, create_rosjava_library_project
from utils import which
from release import scrape_for_release_message_packages
import catkin
Loading

0 comments on commit 08256a0

Please sign in to comment.