ros app gradle 和其他配置

ros配置

参考项目 https://github.com/rosjava/android_apps

Project复制kinetic包的东西,没有Project的gradle中的plugin:catkin会找不到
CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(android_apps)

find_package(catkin REQUIRED rosjava_build_tools)

catkin_android_setup(assembleRelease assembleDebug uploadArchives)

catkin_package()


install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}/com/github/rosjava/android_apps/
DESTINATION ${CATKIN_GLOBAL_MAVEN_DESTINATION}/com/github/rosjava/android_apps)

package.xml



  android_apps
  0.2.0
  
    Applications for robot-android pairing..
  
  http://ros.org/wiki/android_apps
  https://github.com/rosjava/android_apps
  https://github.com/rosjava/android_apps/issues
  Daniel Stonier
  Daniel Stonier
  Kazuto Murase
  Apache 2.0

  catkin
  rosjava_build_tools
  rosjava_bootstrap
  android_core
  android_extras
  android_remocons
  rosjava_messages

配置Project的gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
apply from: "https://github.com/rosjava/android_core/raw/kinetic/buildscript.gradle"
repositories {
    jcenter()
}
dependencies {
    classpath "com.android.tools.build:gradle:2.2.3"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}
apply plugin: 'catkin'
allprojects {
repositories {
    jcenter()
}
group 'com.github.rosjava.android_apps'
version = project.catkin.pkg.version

}

subprojects {
apply plugin: 'ros-android'
afterEvaluate { project ->
    android {

        packagingOptions {
            /* https://github.com/rosjava/android_core/issues/194 */
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
        }
    }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

配置module:app的gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
configurations.all {
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
defaultConfig {
    applicationId "com.hlf.rosdemo"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
productFlavors {
    kinetic {
        applicationId "com.github.rosjava.android_apps.make_a_map.kinetic"
    }
}

lintOptions {
    abortOnError = false
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.github.rosjava.android_remocons:common_tools:[0.2,0.3)'
compile 'org.ros.android_core:android_15:[0.3,0.4)'
compile 'org.ros.rosjava_core:rosjava_geometry:[0.3,0.4)'
compile 'org.ros.rosjava_messages:map_store:[0.3,0.4)'
compile 'org.ros.rosjava_messages:world_canvas_msgs:[0.2,0.3)'

}

你可能感兴趣的:(android)