build.gradle 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. buildscript {
  2. repositories {
  3. mavenCentral()
  4. jcenter()
  5. }
  6. dependencies {
  7. classpath 'com.android.tools.build:gradle:2.3.1'
  8. classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0'
  9. }
  10. }
  11. apply plugin: 'com.android.application'
  12. apply plugin: 'com.google.protobuf'
  13. android {
  14. compileSdkVersion 26
  15. buildToolsVersion '26.0.0'
  16. defaultConfig {
  17. minSdkVersion 21
  18. targetSdkVersion 26
  19. versionCode 1
  20. versionName "1.0"
  21. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  22. }
  23. buildTypes {
  24. debug {
  25. minifyEnabled false
  26. }
  27. }
  28. productFlavors {
  29. aosp {
  30. applicationId 'com.android.launcher3'
  31. testApplicationId 'com.android.launcher3.tests'
  32. }
  33. }
  34. sourceSets {
  35. main {
  36. res.srcDirs = ['res']
  37. java.srcDirs = ['src', 'src_config']
  38. manifest.srcFile 'AndroidManifest-common.xml'
  39. proto.srcDirs 'protos/'
  40. }
  41. androidTest {
  42. java.srcDirs = ['tests/src']
  43. res.srcDirs = ['tests/res']
  44. manifest.srcFile "tests/AndroidManifest-common.xml"
  45. }
  46. aosp {
  47. manifest.srcFile "AndroidManifest.xml"
  48. }
  49. aospAndroidTest {
  50. manifest.srcFile "tests/AndroidManifest.xml"
  51. }
  52. }
  53. }
  54. repositories {
  55. mavenCentral()
  56. jcenter()
  57. }
  58. final String SUPPORT_LIBS_VERSION = '26.0.0-SNAPSHOT'
  59. dependencies {
  60. compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
  61. compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
  62. compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}"
  63. compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2'
  64. testCompile 'junit:junit:4.12'
  65. androidTestCompile "org.mockito:mockito-core:1.+"
  66. androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
  67. androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
  68. androidTestCompile 'com.android.support.test:runner:0.5'
  69. androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
  70. androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
  71. }
  72. protobuf {
  73. // Configure the protoc executable
  74. protoc {
  75. artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
  76. generateProtoTasks {
  77. all().each { task ->
  78. task.builtins {
  79. remove java
  80. javanano {
  81. option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
  82. option "enum_style=java"
  83. }
  84. }
  85. }
  86. }
  87. }
  88. }