Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccef3e02 authored by Shikha Malhotra's avatar Shikha Malhotra
Browse files

Create android library for Go resources without src files

This is to ensure that the downstream projects like LauncherLily can
compile the sources itself and thus not include them twice in the
compilation leading to other errors/warnings in the code base

Bug: b/216136346
Test: manually tested LauncherLily
Change-Id: I3bd9962493a40842ae34d682a0c2d418d4703739
parent 57c11aab
Loading
Loading
Loading
Loading
+34 −30
Original line number Diff line number Diff line
@@ -241,6 +241,37 @@ filegroup {
    ],
}

// Library with all the dependencies for building Launcher Go
// without the sources, sources to be added in the downstream projects
android_library {
    name: "LauncherGoResNoSrcLib",

    resource_dirs: [
        "go/res",
        "go/quickstep/res",
    ],
    // Note the ordering here is important when it comes to resource
    // overriding. We want the most specific resource overrides defined
    // in QuickstepResLib to take precedence, so it should be the final
    // dependency. See b/205278434 for how this can go wrong.
    static_libs: [
        "Launcher3CommonDepsLib",
        "QuickstepResLib",
        "androidx.room_room-runtime",
    ],
    plugins: ["androidx.room_room-compiler-plugin"],
    manifest: "quickstep/AndroidManifest-launcher.xml",
    additional_manifests: [
        "go/AndroidManifest.xml",
        "AndroidManifest-common.xml",
    ],
    min_sdk_version: "current",
    lint: {
        baseline_filename: "lint-baseline-go-res-lib.xml",
    },
}


// Proguard files for Launcher3
filegroup {
    name: "launcher-proguard-rules",
@@ -251,27 +282,13 @@ filegroup {
android_library {
    name: "LauncherGoResLib",
    srcs: [
        "src/**/*.java",
        "src/**/*.kt",
        "quickstep/src/**/*.java",
        "quickstep/src/**/*.kt",
        ":launcher-go-src-no-build-config",
        "go/src/**/*.java",
        "go/src/**/*.kt",
        "go/quickstep/src/**/*.java",
        "go/quickstep/src/**/*.kt",
    ],
    resource_dirs: [
        "go/res",
        "go/quickstep/res",
    ],
    // Note the ordering here is important when it comes to resource
    // overriding. We want the most specific resource overrides defined
    // in QuickstepResLib to take precendece, so it should be the final
    // dependency. See b/205278434 for how this can go wrong.

    static_libs: [
        "Launcher3CommonDepsLib",
        "QuickstepResLib",
        "androidx.room_room-runtime",
        "LauncherGoResNoSrcLib",
    ],
    plugins: ["androidx.room_room-compiler-plugin"],
    manifest: "quickstep/AndroidManifest-launcher.xml",
@@ -407,19 +424,6 @@ android_app {
    min_sdk_version: "current",
    target_sdk_version: "current",

    srcs: [
        "src/**/*.java",
        "quickstep/src/**/*.java",
        "go/src/**/*.java",
        "go/quickstep/src/**/*.java",
    ],

    resource_dirs: [
        "go/quickstep/res",
        "go/res",
        "quickstep/res",
    ],

    optimize: {
        proguard_flags_files: ["proguard.flags"],
        enabled: true,