build.gradle 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* Licensed to the Apache Software Foundation (ASF) under one
  2. or more contributor license agreements. See the NOTICE file
  3. distributed with this work for additional information
  4. regarding copyright ownership. The ASF licenses this file
  5. to you under the Apache License, Version 2.0 (the
  6. "License"); you may not use this file except in compliance
  7. with the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing,
  10. software distributed under the License is distributed on an
  11. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12. KIND, either express or implied. See the License for the
  13. specific language governing permissions and limitations
  14. under the License.
  15. */
  16. buildscript {
  17. repositories {
  18. mavenCentral()
  19. }
  20. // Switch the Android Gradle plugin version requirement depending on the
  21. // installed version of Gradle. This dependency is documented at
  22. // http://tools.android.com/tech-docs/new-build-system/version-compatibility
  23. // and https://issues.apache.org/jira/browse/CB-8143
  24. if (gradle.gradleVersion >= "2.2") {
  25. dependencies {
  26. classpath 'com.android.tools.build:gradle:1.0.0+'
  27. }
  28. } else if (gradle.gradleVersion >= "2.1") {
  29. dependencies {
  30. classpath 'com.android.tools.build:gradle:0.14.0+'
  31. }
  32. } else {
  33. dependencies {
  34. classpath 'com.android.tools.build:gradle:0.12.0+'
  35. }
  36. }
  37. }
  38. apply plugin: 'android-library'
  39. android {
  40. compileSdkVersion cdvCompileSdkVersion
  41. buildToolsVersion cdvBuildToolsVersion
  42. publishNonDefault true
  43. compileOptions {
  44. sourceCompatibility JavaVersion.VERSION_1_6
  45. targetCompatibility JavaVersion.VERSION_1_6
  46. }
  47. sourceSets {
  48. main {
  49. manifest.srcFile 'AndroidManifest.xml'
  50. java.srcDirs = ['src']
  51. resources.srcDirs = ['src']
  52. aidl.srcDirs = ['src']
  53. renderscript.srcDirs = ['src']
  54. res.srcDirs = ['res']
  55. assets.srcDirs = ['assets']
  56. }
  57. }
  58. }