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

Commit 215fb816 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Ravenwood] Cleanup build file" into main

parents e74e0c1c 8e52506e
Loading
Loading
Loading
Loading
+33 −82
Original line number Diff line number Diff line
@@ -67,34 +67,19 @@ filegroup {
    visibility: ["//visibility:private"],
}

// This and the next module contain the same classes with different implementations.
// "ravenwood-runtime-common-device" will be statically linked in device side tests.
// "ravenwood-runtime-common-ravenwood" will only exist in ravenwood-runtime, which will take
// precedence even if the test jar (accidentally) contains "ravenwood-runtime-common-device".
// "ravenwood-runtime-common" uses it to detect if the rutime is Ravenwood or not.
java_library {
    name: "ravenwood-runtime-common-ravenwood",
    host_supported: true,
    sdk_version: "core_current",
    srcs: [
        "runtime-common-ravenwood-src/**/*.java",
    ],
    visibility: [
        // Some tests need to access the utilities.
        ":__subpackages__",
    ],
filegroup {
    name: "ravenwood-services-jarjar-rules",
    srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
    visibility: ["//visibility:private"],
}

java_library {
    name: "ravenwood-runtime-common-device",
    host_supported: true,
    sdk_version: "core_current",
    srcs: [
        "runtime-common-device-src/**/*.java",
    ],
filegroup {
    name: "ravenwood-module-utils-jarjar-rules",
    srcs: ["texts/ravenwood-module-utils-jarjar-rules.txt"],
    visibility: ["//visibility:private"],
}

// Common code that is shared across host and device.
java_library {
    name: "ravenwood-runtime-common",
    host_supported: true,
@@ -102,15 +87,15 @@ java_library {
    srcs: [
        "runtime-common-src/**/*.java",
    ],
    libs: [
        "ravenwood-runtime-common-ravenwood",
    ],
    static_libs: [
        "framework-annotations-lib", // should it be "libs" instead?
        "modules-utils-ravenwood",
    ],
    visibility: ["//visibility:private"],
    jarjar_rules: ":ravenwood-module-utils-jarjar-rules",
}

// libcore-fake should be explicitly built against the host JDK, so use java_library_host.
java_library_host {
    name: "ravenwood-helper-libcore-runtime.host",
    srcs: [
@@ -118,8 +103,6 @@ java_library_host {
    ],
    libs: [
        "app-compat-annotations",
    ],
    static_libs: [
        "ravenwood-runtime-common",
    ],
    visibility: ["//visibility:private"],
@@ -136,18 +119,17 @@ java_host_for_device {
java_library {
    name: "ravenwood-helper-framework-runtime",
    srcs: [
        "runtime-helper-src/framework/**/*.java",
        ":framework-graphics-srcs",
        ":framework-ravenwood-sources",
        "runtime-helper-src/framework/**/*.java",
    ],
    static_libs: [
        "ravenwood-runtime-common",
        "androidx.annotation_annotation",
    ],
    libs: [
        "framework-minus-apex.ravenwood",
        "framework-configinfrastructure.ravenwood",
        "framework-minus-apex.ravenwood",
        "ravenwood-helper-libcore-runtime",
        "ravenwood-runtime-common",
    ],
    sdk_version: "core_current",
    visibility: ["//visibility:private"],
@@ -169,23 +151,22 @@ java_library {
java_library {
    name: "ravenwood-junit-impl",
    srcs: [
        "junit-src/**/*.java",
        "junit-impl-src/**/*.java",
        "junit-src/**/*.java",
    ],
    static_libs: [
        "androidx.test.monitor-for-device",
        "androidx.test.monitor",
        "ravenwood-runtime-common",
    ],
    libs: [
        "android.test.mock.impl",
        "framework-annotations-lib",
        "framework-minus-apex.ravenwood",
        "hoststubgen-helper-runtime.ravenwood",
        "junit",
        "ravenwood-framework",
        "ravenwood-helper-runtime",
        "services.core.ravenwood",
        "junit",
        "framework-annotations-lib",
        "ravenwood-helper-framework-runtime",
        "ravenwood-helper-libcore-runtime",
        "hoststubgen-helper-runtime.ravenwood",
    ],
    visibility: [":__subpackages__"],
    jarjar_rules: ":ravenwood-services-jarjar-rules",
@@ -211,17 +192,15 @@ java_library {
    srcs: [
        "junit-src/**/*.java",
        "junit-stub-src/**/*.java",
        "junit-flag-src/**/*.java",
    ],
    sdk_version: "module_current",
    static_libs: [
        "ravenwood-runtime-common",
        "ravenwood-runtime-common-device",
    ],
    libs: [
        "junit",
        "flag-junit",
        "framework-annotations-lib",
        "junit",
    ],
    visibility: ["//visibility:public"],
}
@@ -241,32 +220,6 @@ java_library {
    visibility: ["//visibility:public"],
}

java_host_for_device {
    name: "androidx.test.monitor-for-device",
    libs: [
        "androidx.test.monitor-for-host",
    ],
}

java_device_for_host {
    name: "androidx.test.monitor-for-host",
    libs: [
        "androidx.test.monitor",
    ],
}

filegroup {
    name: "ravenwood-framework-jarjar-rules",
    srcs: ["texts/ravenwood-framework-jarjar-rules.txt"],
    visibility: ["//frameworks/base"],
}

filegroup {
    name: "ravenwood-services-jarjar-rules",
    srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
    visibility: ["//frameworks/base"],
}

cc_defaults {
    name: "ravenwood_jni_defaults",
    cflags: [
@@ -297,13 +250,13 @@ cc_library_host_shared {
    defaults: ["ravenwood_jni_defaults"],
    header_libs: ["libicuuc_headers"],
    srcs: [
        "runtime-jni/ravenwood_runtime.cpp",
        "runtime-jni/ravenwood_os_constants.cpp",
        "runtime-jni/ravenwood_runtime.cpp",
    ],
    shared_libs: [
        "libbase",
        "libutils",
        "libcutils",
        "libutils",
    ],
}

@@ -315,24 +268,24 @@ sh_test_host {
    test_suites: ["general-tests"],
    device_common_data: [
        ":framework-minus-apex.ravenwood-stats{hoststubgen_framework-minus-apex_apis.csv}",
        ":framework-minus-apex.ravenwood-stats{hoststubgen_framework-minus-apex_keep_all.txt}",
        ":framework-minus-apex.ravenwood-stats{hoststubgen_framework-minus-apex_dump.txt}",
        ":framework-minus-apex.ravenwood-stats{hoststubgen_framework-minus-apex_keep_all.txt}",

        ":services.core.ravenwood-stats{hoststubgen_services.core_apis.csv}",
        ":services.core.ravenwood-stats{hoststubgen_services.core_keep_all.txt}",
        ":services.core.ravenwood-stats{hoststubgen_services.core_dump.txt}",
        ":services.core.ravenwood-stats{hoststubgen_services.core_keep_all.txt}",

        ":framework-configinfrastructure.ravenwood-stats{framework-configinfrastructure_apis.csv}",
        ":framework-configinfrastructure.ravenwood-stats{framework-configinfrastructure_keep_all.txt}",
        ":framework-configinfrastructure.ravenwood-stats{framework-configinfrastructure_dump.txt}",
        ":framework-configinfrastructure.ravenwood-stats{framework-configinfrastructure_keep_all.txt}",

        ":framework-statsd.ravenwood-stats{framework-statsd_apis.csv}",
        ":framework-statsd.ravenwood-stats{framework-statsd_keep_all.txt}",
        ":framework-statsd.ravenwood-stats{framework-statsd_dump.txt}",
        ":framework-statsd.ravenwood-stats{framework-statsd_keep_all.txt}",

        ":framework-graphics.ravenwood-stats{framework-graphics_apis.csv}",
        ":framework-graphics.ravenwood-stats{framework-graphics_keep_all.txt}",
        ":framework-graphics.ravenwood-stats{framework-graphics_dump.txt}",
        ":framework-graphics.ravenwood-stats{framework-graphics_keep_all.txt}",
    ],
}

@@ -404,11 +357,11 @@ java_library {
filegroup {
    name: "ravenwood-data",
    device_common_srcs: [
        ":system-build.prop",
        ":framework-res",
        ":ravenwood-empty-res",
        ":ravenwood-framework-platform-compat-config",
        ":ravenwood-services.core-platform-compat-config",
        ":system-build.prop",
        "texts/ravenwood-build.prop",
    ],
    device_first_srcs: [
@@ -696,8 +649,6 @@ android_ravenwood_libgroup {
        "200-kxml2-android",
        "ext-ravenwood",

        "ravenwood-runtime-common-ravenwood",

        "android.test.mock.ravenwood",
        "ravenwood-helper-runtime",
        "hoststubgen-helper-runtime.ravenwood",
@@ -767,13 +718,13 @@ android_ravenwood_libgroup {
android_ravenwood_libgroup {
    name: "ravenwood-utils",
    libs: [
        "junit",
        "truth",
        "flag-junit",
        "inline-mockito-ravenwood-prebuilt",
        "junit",
        "mockito-ravenwood-prebuilt",
        "ravenwood-framework",
        "ravenwood-junit",
        "mockito-ravenwood-prebuilt",
        "inline-mockito-ravenwood-prebuilt",
        "truth",
    ],
}

+0 −29
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 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.
 */
package com.android.ravenwood.common.divergence;

/**
 * A class that behaves differently on the device side and on Ravenwood, because we have
 * two build modules with different implementation and we link the different ones at runtime.
 */
public final class RavenwoodDivergence {
    private RavenwoodDivergence() {
    }

    public static boolean isOnRavenwood() {
        return false;
    }
}
+0 −29
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 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.
 */
package com.android.ravenwood.common.divergence;

/**
 * A class that behaves differently on the device side and on Ravenwood, because we have
 * two build modules with different implementation and we link the different ones at runtime.
 */
public final class RavenwoodDivergence {
    private RavenwoodDivergence() {
    }

    public static boolean isOnRavenwood() {
        return true;
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.ravenwood.common;
import android.annotation.NonNull;
import android.annotation.Nullable;

import com.android.ravenwood.common.divergence.RavenwoodDivergence;
import com.android.modules.utils.ravenwood.RavenwoodHelper;

import java.io.File;
import java.io.FileDescriptor;
@@ -57,7 +57,7 @@ public class RavenwoodCommonUtils {
    private static boolean sEnableExtraRuntimeCheck =
            "1".equals(System.getenv("RAVENWOOD_ENABLE_EXTRA_RUNTIME_CHECK"));

    private static final boolean IS_ON_RAVENWOOD = RavenwoodDivergence.isOnRavenwood();
    private static final boolean IS_ON_RAVENWOOD = RavenwoodHelper.isRunningOnRavenwood();

    private static final String RAVENWOOD_RUNTIME_PATH = getRavenwoodRuntimePathInternal();

+0 −5
Original line number Diff line number Diff line
@@ -12,11 +12,6 @@ android_ravenwood_test {

    resource_apk: "RavenwoodResApkTest-res",

    libs: [
        // Normally, tests shouldn't directly access it, but we need to access RavenwoodCommonUtils
        // in this test.
        "ravenwood-runtime-common-ravenwood",
    ],
    static_libs: [
        "androidx.annotation_annotation",
        "androidx.test.ext.junit",
Loading