• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1buildscript {
2    repositories {
3        mavenCentral()
4        google()
5        jcenter()
6    }
7    dependencies {
8        classpath GRADLE_CLASS_PATH
9        classpath PROTOBUF_CLASS_PATH
10    }
11}
12
13final String ANDROID_TOP = "${rootDir}/../../.."
14final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/"
15
16apply plugin: 'com.android.application'
17apply plugin: 'com.google.protobuf'
18
19android {
20    compileSdkVersion COMPILE_SDK
21    buildToolsVersion BUILD_TOOLS_VERSION
22
23    defaultConfig {
24        minSdkVersion 25
25        targetSdkVersion 28
26        versionCode 1
27        versionName "1.0"
28
29        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
30        vectorDrawables.useSupportLibrary = true
31    }
32    buildTypes {
33        debug {
34            minifyEnabled false
35        }
36    }
37
38    compileOptions {
39        sourceCompatibility JavaVersion.VERSION_1_8
40        targetCompatibility JavaVersion.VERSION_1_8
41    }
42
43    // The flavor dimensions for build variants (e.g. aospWithQuickstep, aospWithoutQuickstep)
44    // See: https://developer.android.com/studio/build/build-variants#flavor-dimensions
45    flavorDimensions "app", "recents"
46
47    productFlavors {
48        aosp {
49            dimension "app"
50            applicationId 'com.android.launcher3'
51            testApplicationId 'com.android.launcher3.tests'
52        }
53
54        l3go {
55            dimension "app"
56            applicationId 'com.android.launcher3'
57            testApplicationId 'com.android.launcher3.tests'
58        }
59
60        withQuickstep {
61            dimension "recents"
62
63            minSdkVersion 28
64        }
65
66        withoutQuickstep {
67            dimension "recents"
68        }
69    }
70
71    // Disable release builds for now
72    android.variantFilter { variant ->
73        if (variant.buildType.name.endsWith('release')) {
74            variant.setIgnore(true)
75        }
76    }
77
78    sourceSets {
79        main {
80            res.srcDirs = ['res']
81            java.srcDirs = ['src', 'src_plugins']
82            manifest.srcFile 'AndroidManifest-common.xml'
83            proto {
84                srcDirs = ['protos/', 'protos_overrides/']
85            }
86        }
87
88        androidTest {
89            res.srcDirs = ['tests/res']
90            java.srcDirs = ['tests/src', 'tests/tapl']
91            manifest.srcFile "tests/AndroidManifest-common.xml"
92        }
93
94        androidTestDebug {
95            manifest.srcFile "tests/AndroidManifest.xml"
96        }
97
98        aosp {
99            java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
100        }
101
102        aospWithoutQuickstep {
103            manifest.srcFile "AndroidManifest.xml"
104        }
105
106        aospWithQuickstep {
107            manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
108        }
109
110        l3go {
111            res.srcDirs = ['go/res']
112            java.srcDirs = ['go/src']
113            manifest.srcFile "go/AndroidManifest.xml"
114        }
115
116        l3goWithoutQuickstepDebug {
117            manifest.srcFile "AndroidManifest.xml"
118        }
119
120        l3goWithQuickstepDebug {
121            manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
122        }
123
124        withoutQuickstep {
125            java.srcDirs = ['src_ui_overrides']
126        }
127
128        withQuickstep {
129            res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
130            java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
131            manifest.srcFile "quickstep/AndroidManifest.xml"
132        }
133    }
134}
135
136allprojects {
137    repositories {
138        maven { url "../../../prebuilts/sdk/current/androidx/m2repository" }
139        maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
140        maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
141        mavenCentral()
142        google()
143    }
144}
145
146dependencies {
147    implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
148    implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
149    implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
150    implementation project(':IconLoader')
151    withQuickstepImplementation project(':SharedLibWrapper')
152
153    // Recents lib dependency
154    withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
155
156    // Required for AOSP to compile. This is already included in the sysui_shared.jar
157    withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')
158
159    testImplementation 'junit:junit:4.12'
160    androidTestImplementation "org.mockito:mockito-core:1.9.5"
161    androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
162    androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
163    androidTestImplementation 'com.android.support.test:runner:1.0.0'
164    androidTestImplementation 'com.android.support.test:rules:1.0.0'
165    androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
166    androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
167}
168
169protobuf {
170    // Configure the protoc executable
171    protoc {
172        artifact = "com.google.protobuf:protoc:${protocVersion}"
173    }
174    generateProtoTasks {
175        all().each { task ->
176            task.builtins {
177                remove java
178                java {
179                    option "lite"
180                }
181            }
182        }
183    }
184}
185