2018-04-27 13:16:32 +02:00
|
|
|
// Copyright (C) 2018 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.
|
|
|
|
|
2018-11-19 08:26:16 +01:00
|
|
|
cc_defaults {
|
|
|
|
name: "idmap2_defaults",
|
2018-04-27 13:16:32 +02:00
|
|
|
tidy: true,
|
Add back missing `tidy_checks`, since `tidy_checks_as_errors` isn't enough
I unfortunately missed in the original testing that
`tidy_checks_as_errors` isn't sufficient by itself. Instead we need to
have both places with the same variables. A future change will make
Soong expand `tidy_checks_as_errors` into both locations appropriately.
Bug: 119328308
Test: WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=*,-readability-*,-google-readability-*,-google-runtime-references,-cppcoreguidelines-*,-modernize-*,-llvm-*,-bugprone-narrowing-conversions,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-hicpp-*,-fuchsia-* mm
Change-Id: If69f69bf7861ba3569756270381f3f737366f2f0
Merged-In: If69f69bf7861ba3569756270381f3f737366f2f0
(cherry picked from commit 56af59395e0cdcebeb9b01813f752cc22468c4c0)
2020-06-09 00:14:52 -07:00
|
|
|
tidy_checks: [
|
|
|
|
"modernize-*",
|
|
|
|
"-modernize-avoid-c-arrays",
|
|
|
|
"-modernize-use-trailing-return-type",
|
|
|
|
"android-*",
|
|
|
|
"misc-*",
|
|
|
|
"readability-*",
|
|
|
|
],
|
Use `tidy_checks_as_errors` list instead of `-warnings-as-errors=*`
This fixes a build break due to new code from
http://ag/I96f970e82b5243be01b205ac2cb6ab249c6100bc that inadvertently
triggers some false positives with other clang-tidy flags. Builds that
use a wider set of tidy flags (as specified in the test below) will
break since `-warnings-as-errors=*` turns all warnings into errors,
rather than just the ones that were specified as part of this
Android.bp. The preferred way of checking this is to use
`tidy_checks_as_errors`
Bug: 119328308
Test: WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=*,-readability-*,-google-readability-*,-google-runtime-references,-cppcoreguidelines-*,-modernize-*,-llvm-*,-bugprone-narrowing-conversions,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-hicpp-*,-fuchsia-* mm
Change-Id: I941b3c89402e2cfa290b3829e2ac8ff7ea67ca3d
Merged-In: I941b3c89402e2cfa290b3829e2ac8ff7ea67ca3d
(cherry picked from commit 0bc64543270b16e1953b399dc73fa739132a6e5f)
2020-06-09 00:13:57 -07:00
|
|
|
tidy_checks_as_errors: [
|
2019-01-29 12:01:24 -08:00
|
|
|
"modernize-*",
|
|
|
|
"-modernize-avoid-c-arrays",
|
2019-07-27 14:43:50 -07:00
|
|
|
"-modernize-use-trailing-return-type",
|
2018-11-19 08:26:16 +01:00
|
|
|
"android-*",
|
|
|
|
"misc-*",
|
|
|
|
"readability-*",
|
|
|
|
],
|
2018-04-27 13:16:32 +02:00
|
|
|
tidy_flags: [
|
|
|
|
"-system-headers",
|
|
|
|
],
|
2018-11-19 08:26:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_library {
|
|
|
|
name: "libidmap2",
|
|
|
|
defaults: [
|
|
|
|
"idmap2_defaults",
|
|
|
|
],
|
|
|
|
host_supported: true,
|
2018-04-27 13:16:32 +02:00
|
|
|
srcs: [
|
2019-12-04 08:36:48 -08:00
|
|
|
"libidmap2/**/*.cpp",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
|
|
|
export_include_dirs: ["include"],
|
|
|
|
target: {
|
|
|
|
android: {
|
|
|
|
static: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
shared_libs: [
|
|
|
|
"libandroidfw",
|
|
|
|
"libbase",
|
2018-11-30 16:22:05 +01:00
|
|
|
"libcutils",
|
2018-04-27 13:16:32 +02:00
|
|
|
"libutils",
|
|
|
|
"libziparchive",
|
2019-12-04 08:36:48 -08:00
|
|
|
"libidmap2_policies",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
host: {
|
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
static_libs: [
|
|
|
|
"libandroidfw",
|
|
|
|
"libbase",
|
2019-09-18 12:58:11 -07:00
|
|
|
"libcutils",
|
2018-04-27 13:16:32 +02:00
|
|
|
"libutils",
|
|
|
|
"libziparchive",
|
2019-12-04 08:36:48 -08:00
|
|
|
"libidmap2_policies",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_library {
|
|
|
|
name: "libidmap2_policies",
|
|
|
|
defaults: [
|
|
|
|
"idmap2_defaults",
|
|
|
|
],
|
|
|
|
host_supported: true,
|
|
|
|
export_include_dirs: ["libidmap2_policies/include"],
|
|
|
|
target: {
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
android: {
|
|
|
|
static: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
shared_libs: [
|
|
|
|
"libandroidfw",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
host: {
|
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
static_libs: [
|
|
|
|
"libandroidfw",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "idmap2_tests",
|
2018-11-19 08:26:16 +01:00
|
|
|
defaults: [
|
|
|
|
"idmap2_defaults",
|
|
|
|
],
|
|
|
|
tidy_checks: [
|
|
|
|
"-readability-magic-numbers",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
2018-11-19 08:26:16 +01:00
|
|
|
host_supported: true,
|
2019-03-29 14:55:51 -07:00
|
|
|
test_suites: ["general-tests"],
|
2018-04-27 13:16:32 +02:00
|
|
|
srcs: [
|
|
|
|
"tests/BinaryStreamVisitorTests.cpp",
|
|
|
|
"tests/CommandLineOptionsTests.cpp",
|
|
|
|
"tests/FileUtilsTests.cpp",
|
|
|
|
"tests/Idmap2BinaryTests.cpp",
|
|
|
|
"tests/IdmapTests.cpp",
|
|
|
|
"tests/Main.cpp",
|
2019-01-07 17:26:25 -08:00
|
|
|
"tests/PoliciesTests.cpp",
|
2018-04-27 13:16:32 +02:00
|
|
|
"tests/PrettyPrintVisitorTests.cpp",
|
|
|
|
"tests/RawPrintVisitorTests.cpp",
|
2019-09-19 12:15:52 -07:00
|
|
|
"tests/ResourceMappingTests.cpp",
|
2018-04-27 13:16:32 +02:00
|
|
|
"tests/ResourceUtilsTests.cpp",
|
2019-01-28 08:49:12 +01:00
|
|
|
"tests/ResultTests.cpp",
|
2019-09-18 14:52:45 -07:00
|
|
|
"tests/XmlParserTests.cpp",
|
2018-04-27 13:16:32 +02:00
|
|
|
"tests/ZipFileTests.cpp",
|
|
|
|
],
|
|
|
|
required: [
|
|
|
|
"idmap2",
|
|
|
|
],
|
|
|
|
static_libs: ["libgmock"],
|
|
|
|
target: {
|
|
|
|
android: {
|
|
|
|
shared_libs: [
|
|
|
|
"libandroidfw",
|
|
|
|
"libbase",
|
|
|
|
"libidmap2",
|
|
|
|
"liblog",
|
|
|
|
"libutils",
|
|
|
|
"libz",
|
|
|
|
"libziparchive",
|
2019-12-04 08:36:48 -08:00
|
|
|
"libidmap2_policies",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
host: {
|
|
|
|
static_libs: [
|
|
|
|
"libandroidfw",
|
|
|
|
"libbase",
|
2019-09-18 12:58:11 -07:00
|
|
|
"libcutils",
|
2018-04-27 13:16:32 +02:00
|
|
|
"libidmap2",
|
|
|
|
"liblog",
|
|
|
|
"libutils",
|
|
|
|
"libziparchive",
|
2019-12-04 08:36:48 -08:00
|
|
|
"libidmap2_policies",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libz",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: ["tests/data/**/*.apk"],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "idmap2",
|
2018-11-19 08:26:16 +01:00
|
|
|
defaults: [
|
|
|
|
"idmap2_defaults",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
2018-11-19 08:26:16 +01:00
|
|
|
host_supported: true,
|
2018-04-27 13:16:32 +02:00
|
|
|
srcs: [
|
2020-05-13 14:17:52 -07:00
|
|
|
"idmap2/CommandUtils.cpp",
|
2018-04-27 13:16:32 +02:00
|
|
|
"idmap2/Create.cpp",
|
Add xml configuration of RROs
This change adds the ability to configure the priority, default enable
state, and mutability (previously know as staticness) of an overlay.
Rather than overlays configuring themselves, the system can configure
overlays relative to each other.
An example configuration file looks like:
<config>
<merge path="auto-generated.xml" />
<overlay package="com.example.one" mutable="false"
enabled="true"/>
<overlay package="com.example.two" mutable="false"
enabled="true"/>
<overlay package="com.example.three" enabled="true"/>
</config>
The <overlay> tag configures the overlay while the <merge> tag allows
additional configuration files to be included at a position within
the configuration file.
If the configuration file is not present for a partition, the legacy
android:isStatic and android:priority will continue to configure the
overlays in the partition. Once at least one configuration file has
been defined in any partition, strict partition precedence will be
enforced and overlays on separate partitions will no longer be able
to use android:priority to reorder themselves conversely from the
overlay partition precedence.
The order of the system partitions from least to greatest precedence
is system, vendor, odm, oem, product, system_ext.
Bug: 135048762
Test: atest OverlayConfigTest
Change-Id: If57e8caa9b881f9d424ef48bba80b18cc8b7b943
2020-02-04 10:18:53 -08:00
|
|
|
"idmap2/CreateMultiple.cpp",
|
2018-04-27 13:16:32 +02:00
|
|
|
"idmap2/Dump.cpp",
|
|
|
|
"idmap2/Lookup.cpp",
|
|
|
|
"idmap2/Main.cpp",
|
|
|
|
],
|
|
|
|
target: {
|
|
|
|
android: {
|
|
|
|
shared_libs: [
|
|
|
|
"libandroidfw",
|
|
|
|
"libbase",
|
2018-11-30 16:22:05 +01:00
|
|
|
"libcutils",
|
2018-04-27 13:16:32 +02:00
|
|
|
"libidmap2",
|
|
|
|
"libutils",
|
|
|
|
"libziparchive",
|
2019-12-04 08:36:48 -08:00
|
|
|
"libidmap2_policies",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
host: {
|
|
|
|
static_libs: [
|
|
|
|
"libandroidfw",
|
|
|
|
"libbase",
|
2019-09-18 12:58:11 -07:00
|
|
|
"libcutils",
|
2018-04-27 13:16:32 +02:00
|
|
|
"libidmap2",
|
|
|
|
"liblog",
|
|
|
|
"libutils",
|
|
|
|
"libziparchive",
|
2019-12-04 08:36:48 -08:00
|
|
|
"libidmap2_policies",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libz",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2019-12-04 08:36:48 -08:00
|
|
|
|
2018-04-27 13:16:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "idmap2d",
|
2018-11-19 08:26:16 +01:00
|
|
|
defaults: [
|
|
|
|
"idmap2_defaults",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
2018-11-19 08:26:16 +01:00
|
|
|
host_supported: false,
|
2018-04-27 13:16:32 +02:00
|
|
|
srcs: [
|
|
|
|
"idmap2d/Idmap2Service.cpp",
|
|
|
|
"idmap2d/Main.cpp",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libandroidfw",
|
|
|
|
"libbase",
|
|
|
|
"libbinder",
|
|
|
|
"libcutils",
|
|
|
|
"libidmap2",
|
|
|
|
"libutils",
|
|
|
|
"libziparchive",
|
2019-12-04 08:36:48 -08:00
|
|
|
"libidmap2_policies",
|
2018-04-27 13:16:32 +02:00
|
|
|
],
|
2018-11-19 08:26:16 +01:00
|
|
|
static_libs: [
|
|
|
|
"libidmap2daidl",
|
|
|
|
],
|
2018-09-21 09:58:10 +02:00
|
|
|
init_rc: ["idmap2d/idmap2d.rc"],
|
2018-04-27 13:16:32 +02:00
|
|
|
}
|
|
|
|
|
2018-11-19 08:26:16 +01:00
|
|
|
cc_library_static {
|
|
|
|
name: "libidmap2daidl",
|
|
|
|
defaults: [
|
|
|
|
"idmap2_defaults",
|
|
|
|
],
|
|
|
|
tidy: false,
|
|
|
|
host_supported: false,
|
|
|
|
srcs: [
|
|
|
|
":idmap2_aidl",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
],
|
|
|
|
aidl: {
|
|
|
|
export_aidl_headers: true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2018-04-27 13:16:32 +02:00
|
|
|
filegroup {
|
|
|
|
name: "idmap2_aidl",
|
|
|
|
srcs: [
|
|
|
|
"idmap2d/aidl/android/os/IIdmap2.aidl",
|
|
|
|
],
|
2019-06-08 08:42:07 -07:00
|
|
|
path: "idmap2d/aidl",
|
2018-04-27 13:16:32 +02:00
|
|
|
}
|
2019-12-04 08:36:48 -08:00
|
|
|
|
|
|
|
aidl_interface {
|
|
|
|
name: "overlayable_policy_aidl",
|
2020-04-13 12:55:24 +09:00
|
|
|
unstable: true,
|
2019-12-04 08:36:48 -08:00
|
|
|
srcs: [":overlayable_policy_aidl_files"],
|
|
|
|
}
|
|
|
|
|
|
|
|
filegroup {
|
|
|
|
name: "overlayable_policy_aidl_files",
|
|
|
|
srcs: [
|
|
|
|
"idmap2d/aidl/android/os/OverlayablePolicy.aidl",
|
|
|
|
],
|
|
|
|
path: "idmap2d/aidl",
|
|
|
|
}
|