Skip to content
Snippets Groups Projects
Commit 6c39cc2f authored by Daniel Stonier's avatar Daniel Stonier
Browse files

upgrade catkin indigo create scripts for android

parent 263c53e7
No related branches found
No related tags found
No related merge requests found
......@@ -126,11 +126,7 @@ macro(catkin_android_setup)
_rosjava_env()
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()
......
......@@ -100,7 +100,7 @@ def create_gradle_package_files(args, author, is_library, sdk_version):
'''
This is almost a direct copy from catkin_create_pkg.
'''
plugin_name = "android-library" if is_library else "android"
plugin_name = "com.android.library" if is_library else "com.android.application"
try:
package_name = args.name[0].lower()
package_path = os.path.abspath(os.path.join(os.getcwd(), package_name))
......
......@@ -11,6 +11,7 @@ project(%(repo_name)s)
find_package(catkin REQUIRED rosjava_build_tools)
# Set the gradle targets you want catkin's make to run by default
# e.g. usually catkin_android_setup(assembleRelease uploadArchives)
catkin_android_setup(assembleRelease uploadArchives)
catkin_package()
......@@ -19,8 +20,6 @@ catkin_package()
# Installation
##############################################################################
# If you are deploying android libraries (.aar's) uncomment this and
# change this to match the maven group name you have specified in the
# allprojects closure the root build.gradle
#install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}/com/github/rosjava/${PROJECT_NAME}/
# DESTINATION ${CATKIN_GLOBAL_MAVEN_DESTINATION}/com/github/rosjava/${PROJECT_NAME})
# Deploy android libraries (.aar's) and applications (.apk's)
install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}/com/github/rosjava/${PROJECT_NAME}/
DESTINATION ${CATKIN_GLOBAL_MAVEN_DESTINATION}/com/github/rosjava/${PROJECT_NAME}/)
......@@ -32,7 +32,32 @@ allprojects {
}
subprojects {
/* See https://github.com/rosjava/rosjava_bootstrap (look for gradle_plugins)
to see what is going on under the hood. */
/*
* The android plugin configures a few things:
*
* - local deployment repository : where it dumps the jars and packaged artifacts)
* - local maven repositories : where it finds your locally installed/built artifacts)
* - external maven repositories : where it goes looking if it can't find dependencies locally
* - android build tools version : which version we use across the board
*
* To modify, or add repos to the default external maven repositories list, pull request against this code:
*
* https://github.com/rosjava/rosjava_bootstrap/blob/indigo/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosPlugin.groovy#L31
*
* To modify the build tools version, pull request against this code:
*
* https://github.com/rosjava/rosjava_bootstrap/blob/indigo/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosAndroid.groovy#L14
*/
apply plugin: 'ros-android'
afterEvaluate { project ->
android {
// Exclude a few files that are duplicated across our dependencies and
// prevent packaging Android applications.
packagingOptions {
exclude "META-INF/LICENSE.txt"
exclude "META-INF/NOTICE.txt"
}
}
}
}
......@@ -26,19 +26,22 @@
/*
dependencies {
compile project(':local_android_library_dependency')
compile 'org.ros.android_core:android_gingerbread_mr1:[0.2,0.3)'
compile 'org.ros.android_core:android_10:[0.2,0.3)'
compile 'org.ros.android_core:android_15:[0.2,0.3)'
compile 'com.github.rosjava.android_extras:gingerbread:[0.2,0.3)'
compile 'org.ros.rosjava_messages:tf2_msgs:[0.5,0.6)'
}
*/
apply plugin: '%(plugin_name)s'
android {
packagingOptions {
/* https://github.com/rosjava/android_core/issues/194 */
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
compileSdkVersion %(sdk_version)s
defaultConfig {
minSdkVersion %(sdk_version)s
targetSdkVersion %(sdk_version)s
versionCode 1
versionName "1.0"
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment