OSDN Git Service

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