blob: 47241f78d41dd8d3966b721b2dd491db266f6269 [file]
// Copyright (C) 2025 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.
//
/**
* Rule defaults for sysui pod build rules
*/
// Represents code in the "main" folder of a pod
java_defaults {
name: "sysui_main",
defaults: [
"sysui_pod_defaults",
"SystemUI_compile_dagger",
],
srcs: [
"src/main/**/*.kt",
"src/main/**/*.java",
],
libs: [
"jsr330", // javax.inject.*
"dagger2", // Dagger-specific annotations
],
defaults_visibility: ["//frameworks/base/packages/SystemUI/pods:__subpackages__"],
}
// Represents code in the "api" folder of a pod
java_defaults {
name: "sysui_api",
defaults: ["sysui_pod_defaults"],
srcs: [
"src/api/**/*.kt",
"src/api/**/*.java",
],
libs: [
"jsr330", // javax.inject.*
],
visibility: ["//visibility:public"],
defaults_visibility: ["//frameworks/base/packages/SystemUI/pods:__subpackages__"],
}
// Represents code in the "dagger" folder of a pod
java_defaults {
name: "sysui_dagger",
defaults: [
"sysui_pod_defaults",
"SystemUI_compile_dagger",
],
srcs: [
"src/dagger/**/*.kt",
"src/dagger/**/*.java",
],
libs: [
"jsr330", // javax.inject.*
"dagger2", // Dagger-specific annotations
],
visibility: [
"//frameworks/base/packages/SystemUI/pods/bundle:__subpackages__",
],
defaults_visibility: ["//frameworks/base/packages/SystemUI/pods:__subpackages__"],
}
// Represents code in the "test" folder of a pod
java_defaults {
name: "sysui_testlib",
defaults: ["sysui_pod_defaults"],
srcs: [
"src/test/**/*.kt",
"src/test/**/*.java",
],
libs: [
"kosmos",
// TODO (b/475532791): This dependency is unfortunate, as it means that we must effectively
// recompile all text fixtures before running any tests. We should try to remove it (by
// extracting all fixtures that pod tests require into their own fixture pods).
"SystemUI_test_fixtures",
"androidx.test.ext.junit",
"androidx.test.ext.truth",
"androidx.test.rules",
"hamcrest-library",
"kotlinx_coroutines_test",
"mockito-kotlin-nodeps",
"mockito-target-extended-minus-junit4",
"platform-test-annotations",
"truth",
],
visibility: ["//visibility:public"],
defaults_visibility: ["//frameworks/base/packages/SystemUI/pods:__subpackages__"],
}
// Represents code in the "testFixtures" folder (unlike other targets, this should be a
// filegroup
filegroup_defaults {
name: "sysui_fixtureFiles",
srcs: [
"src/testFixtures/**/*.kt",
],
visibility: ["//frameworks/base/packages/SystemUI/pods"],
defaults_visibility: ["//frameworks/base/packages/SystemUI/pods:__subpackages__"],
}
// Represents code in the "preview" folder of a pod
java_defaults {
name: "sysui_preview",
defaults: ["sysui_pod_defaults"],
srcs: [
"src/preview/**/*.kt",
],
libs: [
"androidx.compose.ui_ui-tooling-preview",
],
defaults_visibility: ["//frameworks/base/packages/SystemUI/pods:__subpackages__"],
}
java_defaults {
name: "sysui_pod_defaults",
lint: {
extra_check_modules: ["SystemUILintChecker"],
warning_checks: ["MissingApacheLicenseDetector"],
},
kotlincflags: [
// Annotations on constructor fields apply to both the param and class field.
// See https://youtrack.jetbrains.com/issue/KT-73255
"-Xannotation-default-target=param-property",
],
defaults_visibility: ["//visibility:private"],
}