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

Commit 99f0ef67 authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge changes Idccae8e9,I22a3be64 into main

* changes:
  Add "stats" build target for tiny-framework
  Clean up HSG build file
parents e2d92114 96337ea3
Loading
Loading
Loading
Loading
+0 −39
Original line number Diff line number Diff line
@@ -122,42 +122,3 @@ java_test_host {
    test_suites: ["general-tests"],
    visibility: ["//visibility:private"],
}

// File that contains the standard command line argumetns to hoststubgen.
// This is only for the prototype. The productionized version is "ravenwood-standard-options".
filegroup {
    name: "hoststubgen-standard-options",
    defaults: ["ravenwood-internal-only-visibility-filegroup"],
    srcs: [
        "hoststubgen-standard-options.txt",
    ],
}

hoststubgen_common_options = "$(location hoststubgen) " +
    // "--in-jar $(location :framework-all) " +
    // "--policy-override-file $(location framework-policy-override.txt) " +
    "@$(location :hoststubgen-standard-options) " +

    "--out-jar $(location host.jar) " +

    // "--keep-all-classes " + // Used it for an experiment. See KeepAllClassesFilter.
    "--gen-keep-all-file $(location hoststubgen_keep_all.txt) " +
    "--gen-input-dump-file $(location hoststubgen_dump.txt) " +
    ""

// Common defaults for stub generation.
// This one is not specific to Android APIs.
genrule_defaults {
    name: "hoststubgen-command-defaults",
    tools: ["hoststubgen"],
    srcs: [
        ":hoststubgen-standard-options",
    ],
    out: [
        "host.jar",

        // Following files are created just as FYI.
        "hoststubgen_keep_all.txt",
        "hoststubgen_dump.txt",
    ],
}
+59 −34
Original line number Diff line number Diff line
@@ -19,30 +19,69 @@ java_library {
    visibility: ["//frameworks/base/ravenwood/tools/hoststubgen:__subpackages__"],
}

// Create stub/impl jars from "hoststubgen-test-tiny-framework", using the following 3 rules.
java_genrule_host {
    name: "hoststubgen-test-tiny-framework-host-base",
    defaults: ["hoststubgen-command-defaults"],
    cmd: hoststubgen_common_options +
// File that contains the standard command line argumetns to hoststubgen.
// This is only for the prototype. The productionized version is "ravenwood-standard-options".
filegroup {
    name: "hoststubgen-standard-options",
    srcs: [
        "hoststubgen-standard-options.txt",
    ],
    visibility: ["//visibility:private"],
}

tf_hsg_base_options = "@$(location :hoststubgen-standard-options) " +
    "--in-jar $(location :hoststubgen-test-tiny-framework) " +
    "--policy-override-file $(location policy-override-tiny-framework.txt) " +
        "--package-redirect com.unsupported:com.supported ",
    "--package-redirect com.unsupported:com.supported " +
    "--gen-keep-all-file $(location hoststubgen_keep_all.txt) " +
    "--gen-input-dump-file $(location hoststubgen_dump.txt) "

tf_hsg_base_options_with_out = tf_hsg_base_options +
    "--out-jar $(location host.jar) "

genrule_defaults {
    name: "tf_hsg_base-defaults",
    tools: [
        "hoststubgen",
        "ravenhelper",
    ],
    srcs: [
        ":hoststubgen-standard-options",
        ":hoststubgen-test-tiny-framework",
        "policy-override-tiny-framework.txt",
    ],
    out: [
        "hoststubgen_keep_all.txt",
        "hoststubgen_dump.txt",
    ],
    visibility: ["//visibility:private"],
}

java_genrule_host {
    name: "hoststubgen-test-tiny-framework-host",
    cmd: "cp $(in) $(out)",
    srcs: [
        ":hoststubgen-test-tiny-framework-host-base{host.jar}",
    ],
genrule_defaults {
    name: "tf_hsg_base_with_out-defaults",
    defaults: ["tf_hsg_base-defaults"],
    out: [
        "host.jar",
    ],
}

java_genrule_host {
    name: "hoststubgen-test-tiny-framework-host-base",
    defaults: ["tf_hsg_base_with_out-defaults"],
    cmd: "$(location hoststubgen) " + tf_hsg_base_options_with_out,
}

java_genrule_host {
    name: "hoststubgen-test-tiny-framework-stats",
    defaults: ["tf_hsg_base-defaults"],
    cmd: "$(location ravenhelper) stats " + tf_hsg_base_options,
}

java_genrule_host {
    name: "hoststubgen-test-tiny-framework-host",
    cmd: "cp $(in) $(out)",
    srcs: [":hoststubgen-test-tiny-framework-host-base{host.jar}"],
    out: ["host.jar"],
    visibility: ["//visibility:private"],
}

@@ -50,31 +89,17 @@ java_genrule_host {
// features.
java_genrule_host {
    name: "hoststubgen-test-tiny-framework-host-ext-base",
    defaults: ["hoststubgen-command-defaults"],
    cmd: hoststubgen_common_options +
        "--in-jar $(location :hoststubgen-test-tiny-framework) " +
        "--policy-override-file $(location policy-override-tiny-framework.txt) " +
        "--package-redirect com.unsupported:com.supported " +

        // More options.
    defaults: ["tf_hsg_base_with_out-defaults"],
    cmd: "$(location hoststubgen) " + tf_hsg_base_options_with_out +
    "--default-method-call-hook com.android.hoststubgen.hosthelper.HostTestUtils.logMethodCall " +
    "--default-class-load-hook com.android.hoststubgen.hosthelper.HostTestUtils.logClassLoaded ",
    srcs: [
        ":hoststubgen-test-tiny-framework",
        "policy-override-tiny-framework.txt",
    ],
    visibility: ["//visibility:private"],
}

java_genrule_host {
    name: "hoststubgen-test-tiny-framework-host-ext",
    cmd: "cp $(in) $(out)",
    srcs: [
        ":hoststubgen-test-tiny-framework-host-ext-base{host.jar}",
    ],
    out: [
        "host.jar",
    ],
    srcs: [":hoststubgen-test-tiny-framework-host-ext-base{host.jar}"],
    out: ["host.jar"],
    visibility: ["//visibility:private"],
}