build.gradle 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (C) 2011 Google Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. task wrapper(type: Wrapper) {
  17. gradleVersion = "2.2.1"
  18. }
  19. buildscript {
  20. apply from: project.file("buildscript.gradle")
  21. }
  22. apply plugin: "catkin"
  23. allprojects {
  24. group "org.ros.android_core"
  25. version = project.catkin.pkg.version
  26. }
  27. configure(subprojects.findAll { it.name.startsWith("android_") }) {
  28. /*
  29. * The android plugin configures a few things:
  30. *
  31. * - local deployment repository : where it dumps the jars and packaged artifacts)
  32. * - local maven repositories : where it finds your locally installed/built artifacts)
  33. * - external maven repositories : where it goes looking if it can't find dependencies locally
  34. * - android build tools version : which version we use across the board
  35. *
  36. * To modify, or add repos to the default external maven repositories list, pull request against this code:
  37. *
  38. * https://github.com/rosjava/rosjava_bootstrap/blob/indigo/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosPlugin.groovy#L31
  39. *
  40. * To modify the build tools version, pull request against this code:
  41. *
  42. * https://github.com/rosjava/rosjava_bootstrap/blob/indigo/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosAndroid.groovy#L14
  43. */
  44. apply plugin: "ros-android"
  45. afterEvaluate { project ->
  46. // Change the layout of Android projects to be compatible with Eclipse.
  47. android {
  48. sourceSets {
  49. //noinspection GroovyAssignabilityCheck
  50. main {
  51. manifest.srcFile "AndroidManifest.xml"
  52. res.srcDirs "res"
  53. assets.srcDirs "assets"
  54. java.srcDirs "src"
  55. }
  56. }
  57. // Copy JAR dependencies into the libs directory for Eclipse.
  58. task deployLibs(type: Copy) {
  59. from { configurations.compile }
  60. into { "${project.projectDir}/libs" }
  61. }
  62. // Exclude a few files that are duplicated across our dependencies and
  63. // prevent packaging Android applications.
  64. packagingOptions {
  65. /* https://github.com/rosjava/android_core/issues/194 */
  66. exclude "META-INF/LICENSE.txt"
  67. exclude "META-INF/NOTICE.txt"
  68. }
  69. }
  70. }
  71. }
  72. defaultTasks 'assembleRelease', 'uploadArchives'