build.gradle 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. l3go {
  34. applicationId 'com.android.launcher3'
  35. testApplicationId 'com.android.launcher3.tests'
  36. }
  37. }
  38. sourceSets {
  39. main {
  40. res.srcDirs = ['res']
  41. java.srcDirs = ['src']
  42. manifest.srcFile 'AndroidManifest-common.xml'
  43. proto {
  44. srcDir 'protos/'
  45. srcDir 'proto_overrides/'
  46. }
  47. }
  48. androidTest {
  49. res.srcDirs = ['tests/res']
  50. java.srcDirs = ['tests/src']
  51. manifest.srcFile "tests/AndroidManifest-common.xml"
  52. }
  53. aosp {
  54. java.srcDirs = ['src_flags']
  55. manifest.srcFile "AndroidManifest.xml"
  56. }
  57. aospAndroidTest {
  58. manifest.srcFile "tests/AndroidManifest.xml"
  59. }
  60. l3go {
  61. res.srcDirs = ['go/res']
  62. java.srcDirs = ['go/src_flags']
  63. // Note: we are using the Launcher3 manifest here because the gradle manifest-merger uses
  64. // different attributes than the build system.
  65. manifest.srcFile "AndroidManifest.xml"
  66. }
  67. l3goAndroidTest {
  68. manifest.srcFile "tests/AndroidManifest.xml"
  69. }
  70. }
  71. }
  72. repositories {
  73. mavenCentral()
  74. jcenter()
  75. }
  76. final String SUPPORT_LIBS_VERSION = '26.0.0-SNAPSHOT'
  77. dependencies {
  78. compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
  79. compile "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
  80. compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
  81. compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}"
  82. compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
  83. testCompile 'junit:junit:4.12'
  84. androidTestCompile "org.mockito:mockito-core:1.9.5"
  85. androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
  86. androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
  87. androidTestCompile 'com.android.support.test:runner:0.5'
  88. androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
  89. androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
  90. }
  91. protobuf {
  92. // Configure the protoc executable
  93. protoc {
  94. artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
  95. generateProtoTasks {
  96. all().each { task ->
  97. task.builtins {
  98. remove java
  99. javanano {
  100. option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
  101. option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
  102. option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
  103. option "enum_style=java"
  104. }
  105. }
  106. }
  107. }
  108. }
  109. }