rules.gradle 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * Base rules for building setup wizard library. This build file is not used directly but rather
  3. * included in scripts like build.gradle or standalone.gradle using 'apply from'.
  4. *
  5. * This allows the dependencies to be configured so that for builds in the Android tree, the
  6. * dependencies like support library is built directly from source, while for standalone builds they
  7. * will be fetched from maven central.
  8. */
  9. apply plugin: 'com.android.library'
  10. android {
  11. publishNonDefault true
  12. flavorDimensions 'compat'
  13. productFlavors {
  14. // DEPRECATED: Platform version that will not include the compatibility libraries
  15. platformDeprecated {
  16. dimension 'compat'
  17. // TODO(yukl): Bump this file to v28 once we can properly test that
  18. minSdkVersion 27
  19. }
  20. // Provides backwards compatibility for Gingerbread or above, using support libraries.
  21. gingerbreadCompat {
  22. dimension 'compat'
  23. minSdkVersion 14
  24. }
  25. }
  26. sourceSets {
  27. main {
  28. manifest.srcFile 'main/AndroidManifest.xml'
  29. java.srcDirs = ['main/src']
  30. resources.srcDirs = ['main/src']
  31. res.srcDirs = ['main/res']
  32. }
  33. platformDeprecated {
  34. java.srcDirs = ['platform/src']
  35. res.srcDirs = ['platform/res']
  36. }
  37. gingerbreadCompat {
  38. java.srcDirs = ['gingerbread/src', 'recyclerview/src']
  39. res.srcDirs = ['gingerbread/res', 'recyclerview/res']
  40. }
  41. }
  42. }
  43. dependencies {
  44. // Read the dependencies from the "deps" map in the extra properties.
  45. //
  46. // For builds in the Android tree we want to build the dependencies from source
  47. // for reproducible builds, for example in build.gradle define something like
  48. // this:
  49. // ext {
  50. // deps = ['project-name': project(':project-path')]
  51. // }
  52. //
  53. // For standalone project clients, since the source may not be available, we
  54. // fetch the dependencies from maven. For example in standalone.gradle define
  55. // something like this:
  56. // ext {
  57. // deps = ['project-name': 'com.example.group:project-name:1.0.0']
  58. // }
  59. //
  60. platformDeprecatedCompile deps['support-annotations']
  61. gingerbreadCompatCompile deps['support-appcompat-v7']
  62. gingerbreadCompatCompile deps['support-recyclerview-v7']
  63. }