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

Commit 2e25fdc9 authored by Anton Hansson's avatar Anton Hansson
Browse files

Use filegroups for test-{base,mock,runner} srcs

This allows soong to infer the package of the given srcs, which in turns
make it able to filter the inputs to metalava to exclude unwanted
packages.

This is part of a larger topic of changes intended to remove undesired
classes from the public documentation.

Bug: 187386774
Test: m
Change-Id: I8196c306b743ce6ca8a6452d212f3d7c0b5b2b82
parent 6c4de79b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -89,9 +89,9 @@ stubs_defaults {
        ":updatable-media-srcs",

        // No longer part of the stubs, but are included in the docs.
        "test-base/src/**/*.java",
        "test-mock/src/**/*.java",
        "test-runner/src/**/*.java",
        ":android-test-base-sources",
        ":android-test-mock-sources",
        ":android-test-runner-sources",
    ],
    libs: framework_docs_only_libs,
    create_doc_stubs: true,
+8 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ package {
java_sdk_library {
    name: "android.test.base",

    srcs: ["src/**/*.java"],
    srcs: [":android-test-base-sources"],

    errorprone: {
        javacflags: ["-Xep:DepAnn:ERROR"],
@@ -66,7 +66,7 @@ java_library_static {
    name: "android.test.base_static",
    installable: false,

    srcs: ["src/**/*.java"],
    srcs: [":android-test-base-sources"],

    errorprone: {
        javacflags: ["-Xep:DepAnn:ERROR"],
@@ -114,6 +114,12 @@ java_library_static {
    ],
}

filegroup {
    name: "android-test-base-sources",
    srcs: ["src/**/*.java"],
    path: "src",
}

// Make the current.txt available for use by the cts/tests/signature tests.
// ========================================================================
filegroup {
+7 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ java_sdk_library {
    name: "android.test.mock",

    srcs: [
        "src/**/*.java",
        ":android-test-mock-sources",
        // Note: Below are NOT APIs of this library. We only take APIs under
        // the android.test.mock package. They however provide private APIs that
        // android.test.mock APIs references to.
@@ -61,3 +61,9 @@ filegroup {
        "api/current.txt",
    ],
}

filegroup {
    name: "android-test-mock-sources",
    srcs: ["src/**/*.java"],
    path: "src",
}
+8 −2
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ package {
java_sdk_library {
    name: "android.test.runner",

    srcs: ["src/**/*.java"],
    srcs: [":android-test-runner-sources"],

    errorprone: {
        javacflags: ["-Xep:DepAnn:ERROR"],
@@ -76,7 +76,7 @@ java_library {
java_library_static {
    name: "repackaged.android.test.runner",

    srcs: ["src/**/*.java"],
    srcs: [":android-test-runner-sources"],
    exclude_srcs: [
        "src/android/test/ActivityUnitTestCase.java",
        "src/android/test/ApplicationTestCase.java",
@@ -108,3 +108,9 @@ filegroup {
        "api/current.txt",
    ],
}

filegroup {
    name: "android-test-runner-sources",
    srcs: ["src/**/*.java"],
    path: "src",
}