platform_build_soong/cc/Android.bp
Dan Albert 1a2462717e Replace stringly-typed API levels.
Handling of API levels within Soong is currently fairly difficult
since it isn't always clear based on context what kind of API level a
given string represents, how much canonicalizing and error checking
the code receiving the string are expected to do, or how those errors
should be treated.

The API level struct does not export its raw data, so as to keep its
"constructor" private to the android package, and to prevent misuse of
the `number` field, which is only an implementation detail for preview
API levels. API levels can be parsed with either
`android.ApiLevelFromUser`, which returns any errors to the caller, or
`android.ApiLevelOrPanic`, which is used in the case where the input
is trusted and any errors in parsing should panic. Even within the
`android` package, these APIs should be preferred over direct
construction.

For cases where there are context specific parsing requirements, such
as handling the "minimum" alias in the cc module,
`nativeApiLevelFromUser` and `nativeApiLevelOrPanic` should be used
instead.

Test: treehugger
Bug: http://b/154667674
Change-Id: Id52921fda32cb437fb1775ac2183299dedc0cf20
2020-09-18 12:41:28 -07:00

89 lines
1.8 KiB
Text

bootstrap_go_package {
name: "soong-cc",
pkgPath: "android/soong/cc",
deps: [
"blueprint",
"blueprint-pathtools",
"soong",
"soong-android",
"soong-cc-config",
"soong-etc",
"soong-genrule",
"soong-tradefed",
],
srcs: [
"androidmk.go",
"api_level.go",
"builder.go",
"cc.go",
"ccdeps.go",
"check.go",
"coverage.go",
"gen.go",
"image.go",
"linkable.go",
"lto.go",
"makevars.go",
"pgo.go",
"prebuilt.go",
"proto.go",
"rs.go",
"sanitize.go",
"sabi.go",
"sdk.go",
"snapshot_utils.go",
"stl.go",
"strip.go",
"sysprop.go",
"tidy.go",
"util.go",
"vendor_snapshot.go",
"vndk.go",
"vndk_prebuilt.go",
"cflag_artifacts.go",
"cmakelists.go",
"compdb.go",
"compiler.go",
"installer.go",
"linker.go",
"binary.go",
"binary_sdk_member.go",
"fuzz.go",
"library.go",
"library_headers.go",
"library_sdk_member.go",
"object.go",
"test.go",
"toolchain_library.go",
"ndk_prebuilt.go",
"ndk_headers.go",
"ndk_library.go",
"ndk_sysroot.go",
"llndk_library.go",
"kernel_headers.go",
"genrule.go",
"vendor_public_library.go",
"testing.go",
],
testSrcs: [
"cc_test.go",
"compiler_test.go",
"gen_test.go",
"genrule_test.go",
"library_headers_test.go",
"library_test.go",
"object_test.go",
"prebuilt_test.go",
"proto_test.go",
"test_data_test.go",
],
pluginFor: ["soong_build"],
}