platform_build_soong/sdk
Jiyong Park 8fe14e6a49 Enable sdk and sdk members in os_arch granularity
This amends Idad7ef138cdbcbd209d390bf6c10ca8365d4619f. With the change,
when there is a member that returns IsHostOsDependent() == true,
the sdk having the member and the member itself are disable for host and
only the os that the member supports is explicitly enabled.

However, that change will cause a problem when we add the support for
the linux_bionic_arm64 target. The target is not enabled when building
sdk snapshots. The only linux_bionic target that is enabled is
'linux_bionic_x86_64'. However, since the granularity is os which is
linux_bionic, the snapshot is generated as follows.

cc_prebuilt_binary {
    target: {
        host: {
	    enabled: false,
	},
	linux_bionic: {
            enabled: true,
        },
	linux_bionic_x86_64: {
            srcs: ["x86_64/bin/..."],
	},
	// no srcs for linux_bionic_arm64
    },
}

Above is a problem for linux_bionic_arm64 target because the target is
enabled (via linux_bionic.enabled: true), but srcs is not provided.

To fix the problem, the enabling of a target is done in a target
(os_arch) granularity, rather than os granularity. For example, above
now becomes ...

cc_prebuilt_binary {
    target: {
        host: {
	    enabled: false,
	},
	linux_bionic_x86_64: {
            enabled: true,
            srcs: ["x86_64/bin/..."],
	},
    },
}

Only the targets that the snapshot actually can provide srcs are enabled
and the rest of the host targets are disabled.

Bug: 159685774
Test: m nothing
Test: build/soong/scripts/build-aml-prebuilts.sh
runtime-module-host-exports

Change-Id: Ibca48c40f6dc4628b5f4bfa4ceb68ebe0973cc81
2020-10-23 13:05:13 +09:00
..
Android.bp Soong package structure refactoring 2020-06-01 13:44:48 -07:00
bp.go Handle property structs and BpPropertySets as values to AddProperty. 2020-09-25 00:33:04 +01:00
bp_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
cc_sdk_test.go Enable sdk and sdk members in os_arch granularity 2020-10-23 13:05:13 +09:00
exports.go Restrict SdkMemberTypes that can be used with sdk/sdk_snapshot 2019-12-31 15:08:59 +00:00
exports_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
java_sdk_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
sdk.go Add prebuilt_visibility property 2020-10-02 10:59:41 +01:00
sdk_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
testing.go Allow java_sdk_library to specify doctags_files 2020-09-28 18:35:57 +01:00
update.go Enable sdk and sdk members in os_arch granularity 2020-10-23 13:05:13 +09:00