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 12 apply plugin: 'com.android.application' 13 apply plugin: 'com.google.protobuf' 14 15 android { 16 compileSdkVersion 26 17 buildToolsVersion '26.0.0' 18 19 defaultConfig { 20 minSdkVersion 21 21 targetSdkVersion 26 22 versionCode 1 23 versionName "1.0" 24 25 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 26 } 27 buildTypes { 28 debug { 29 minifyEnabled false 30 } 31 } 32 33 productFlavors { 34 aosp { 35 applicationId 'com.android.launcher3' 36 testApplicationId 'com.android.launcher3.tests' 37 } 38 39 l3go { 40 applicationId 'com.android.launcher3' 41 testApplicationId 'com.android.launcher3.tests' 42 } 43 } 44 sourceSets { 45 main { 46 res.srcDirs = ['res'] 47 java.srcDirs = ['src'] 48 manifest.srcFile 'AndroidManifest-common.xml' 49 proto { 50 srcDir 'protos/' 51 srcDir 'proto_overrides/' 52 } 53 } 54 55 androidTest { 56 res.srcDirs = ['tests/res'] 57 java.srcDirs = ['tests/src'] 58 manifest.srcFile "tests/AndroidManifest-common.xml" 59 } 60 61 aosp { 62 java.srcDirs = ['src_flags'] 63 manifest.srcFile "AndroidManifest.xml" 64 } 65 66 aospAndroidTest { 67 manifest.srcFile "tests/AndroidManifest.xml" 68 } 69 70 l3go { 71 res.srcDirs = ['go/res'] 72 java.srcDirs = ['go/src_flags'] 73 // Note: we are using the Launcher3 manifest here because the gradle manifest-merger uses 74 // different attributes than the build system. 75 manifest.srcFile "AndroidManifest.xml" 76 } 77 78 l3goAndroidTest { 79 manifest.srcFile "tests/AndroidManifest.xml" 80 } 81 } 82 } 83 84 repositories { 85 mavenCentral() 86 jcenter() 87 } 88 89 final String SUPPORT_LIBS_VERSION = '26.0.0-SNAPSHOT' 90 dependencies { 91 compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}" 92 compile "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}" 93 compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}" 94 compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}" 95 compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7' 96 97 testCompile 'junit:junit:4.12' 98 androidTestCompile "org.mockito:mockito-core:1.9.5" 99 androidTestCompile 'com.google.dexmaker:dexmaker:1.2' 100 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' 101 androidTestCompile 'com.android.support.test:runner:0.5' 102 androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' 103 androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}" 104 } 105 106 protobuf { 107 // Configure the protoc executable 108 protoc { 109 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3' 110 111 generateProtoTasks { 112 all().each { task -> 113 task.builtins { 114 remove java 115 javanano { 116 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano" 117 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano" 118 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano" 119 option "enum_style=java" 120 } 121 } 122 } 123 } 124 } 125 } 126