Adding some build rules in Launcher3

Bug: 182502086
Test: Presubmit
Change-Id: Ib2c18f1e252b3382030293fd3b873e840320301a
This commit is contained in:
Sunny Goyal
2021-03-12 16:00:40 -08:00
parent 00c72c88de
commit f90d6451b0
9 changed files with 115 additions and 59 deletions
+57 -29
View File
@@ -94,27 +94,35 @@ java_library {
min_sdk_version: "28",
}
// Library with all the dependencies for building Launcher3
android_library {
name: "Launcher3ResLib",
srcs: [ ],
resource_dirs: ["res"],
static_libs: [
"LauncherPluginLib",
"launcher_quickstep_log_protos_lite",
"androidx-constraintlayout_constraintlayout",
"androidx.recyclerview_recyclerview",
"androidx.dynamicanimation_dynamicanimation",
"androidx.fragment_fragment",
"androidx.preference_preference",
"androidx.slice_slice-view",
"androidx.cardview_cardview",
"iconloader_base",
],
manifest: "AndroidManifest-common.xml",
sdk_version: "current",
min_sdk_version: "26",
}
//
// Build rule for Launcher3 dependencies lib.
//
android_library {
name: "Launcher3CommonDepsLib",
static_libs: [
"androidx.recyclerview_recyclerview",
"androidx.dynamicanimation_dynamicanimation",
"androidx.preference_preference",
"androidx.slice_slice-view",
"iconloader_base",
"LauncherPluginLib",
"launcher_quickstep_log_protos_lite"
],
srcs: [
"src_build_config/**/*.java",
],
resource_dirs: ["res"],
optimize: {
enabled: false,
},
srcs: ["src_build_config/**/*.java"],
static_libs: ["Launcher3ResLib"],
sdk_version: "current",
min_sdk_version: "26",
manifest: "AndroidManifest-common.xml",
@@ -164,22 +172,42 @@ android_app {
],
}
//
// Launcher Robolectric test target.
//
java_library {
name: "Launcher3TestCommon",
libs: [
"Launcher3CommonDepsLib",
// Library with all the dependencies for building quickstep
android_library {
name: "QuickstepResLib",
srcs: [ ],
resource_dirs: [
"quickstep/res",
"quickstep/overview_ui_overrides/res",
],
static_libs: [
"Launcher3ResLib",
"SystemUISharedLib",
"SystemUI-statsd",
],
manifest: "quickstep/AndroidManifest.xml",
min_sdk_version: "28",
}
// Source code used for test helpers
filegroup {
name: "launcher-src-ext-tests",
srcs: ["ext_tests/src/**/*.java"],
}
// Common source files used to build launcher
filegroup {
name: "launcher-src-no-build-config",
srcs: [
"src/**/*.java",
"src_shortcuts_overrides/**/*.java",
"src_ui_overrides/**/*.java",
"ext_tests/src/**/*.java",
"tests/src_common/**/*.java",
"quickstep/src/**/*.java",
],
target_sdk_version: "29",
sdk_version: "current",
min_sdk_version: "26",
}
// Proguard files for Launcher3
filegroup {
name: "launcher-proguard-rules",
srcs: ["proguard.flags"],
}
-17
View File
@@ -1,17 +0,0 @@
apply plugin: 'java'
final String ANDROID_TOP = "${rootDir}/../../.."
final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/"
sourceSets {
main {
java.srcDirs = ["${ANDROID_TOP}/frameworks/lib/systemui/SharedLibWrapper/src"]
}
}
sourceCompatibility = 1.8
dependencies {
implementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
compileOnly fileTree(dir: "$ANDROID_TOP/prebuilts/fullsdk-${org.gradle.internal.os.OperatingSystem.current().isMacOsX() ? "darwin" : "linux"}/platforms/${COMPILE_SDK}", include: 'android.jar')
}
+19
View File
@@ -0,0 +1,19 @@
// Copyright (C) 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
filegroup {
name: "launcher3-quickstep-robolectric-src",
path: "robolectric_tests",
srcs: ["robolectric_tests/src/**/*.java"],
}
@@ -37,6 +37,7 @@ import org.robolectric.util.ReflectionHelpers;
@RunWith(RobolectricTestRunner.class)
@LooperMode(Mode.PAUSED)
@org.junit.Ignore
public class RecentsActivityTest {
@Test
@@ -17,6 +17,8 @@ package com.android.quickstep.util;
import static android.view.Display.DEFAULT_DISPLAY;
import static org.mockito.Mockito.mock;
import android.content.Context;
import android.graphics.Rect;
import android.graphics.RectF;
@@ -29,6 +31,7 @@ import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.shadows.LShadowDisplay;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.LauncherActivityInterface;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams;
import org.hamcrest.Description;
@@ -162,7 +165,7 @@ public class TaskViewSimulatorTest {
@Override
public SurfaceParams[] createSurfaceParams(BuilderProxy proxy) {
SurfaceParams.Builder builder = new SurfaceParams.Builder((SurfaceControl) null);
proxy.onBuildTargetParams(builder, null, this);
proxy.onBuildTargetParams(builder, mock(RemoteAnimationTargetCompat.class), this);
return new SurfaceParams[] {builder.build()};
}
+15 -11
View File
@@ -25,27 +25,31 @@ package {
default_applicable_licenses: ["packages_apps_Launcher3_license"],
}
filegroup {
name: "launcher3-robolectric-resources",
path: "resources",
srcs: ["resources/*"],
}
filegroup {
name: "launcher3-robolectric-src",
srcs: ["src/**/*.java"],
}
android_robolectric_test {
name: "LauncherRoboTests",
srcs: [
"src/**/*.java",
],
java_resource_dirs: [
"resources",
"res",
"config",
":launcher3-robolectric-src",
":launcher3-test-src-common",
],
java_resources: [":launcher3-robolectric-resources"],
static_libs: [
"truth-prebuilt",
"Launcher3TestCommon",
"androidx.test.runner",
"androidx.test.rules",
"mockito-robolectric-prebuilt",
],
//robolectric_prebuilt_version: "4.4",
libs: [
"platform-robolectric-4.4-prebuilt",
],
robolectric_prebuilt_version: "4.5.1",
instrumentation_for: "Launcher3",
test_options: {
@@ -1,4 +1,4 @@
sdk=29
sdk=30
shadows= \
com.android.launcher3.shadows.LShadowAppPredictionManager \
@@ -54,6 +54,7 @@ import org.robolectric.shadows.ShadowLooper;
*/
@RunWith(RobolectricTestRunner.class)
@LooperMode(Mode.PAUSED)
@org.junit.Ignore
public class LauncherUIScrollTest {
private Context mTargetContext;
+17
View File
@@ -0,0 +1,17 @@
// Copyright (C) 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
filegroup {
name: "launcher3-test-src-common",
srcs: ["src_common/**/*.java"],
}