blob: 3e6108003c66409615c378c364ba25db20beb341 [file]
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
android_sdk_repo_host {
name: "build-tools",
base_dir: select(soong_config_variable("sdk", "sdk_platform_dir_name"), {
any @ sdk_platform_dir_name: sdk_platform_dir_name,
default: "android",
}),
srcs: [
":build_tools_source_properties",
":build_tools_runtime_properties",
],
multilib: {
common: {
deps: [
"build-tools_core-lambda-stubs",
],
},
},
deps_remap: [
{
from: "framework/build-tools_core-lambda-stubs.jar",
to: "core-lambda-stubs.jar",
},
{
from: "bin/*",
to: "./",
},
{
from: "framework/*",
to: "./lib/",
},
],
target: {
linux: {
strip_files: [
"lib64/*.so",
],
},
linux_glibc: {
merge_zips: [":deprecated-renderscript-tools"],
},
darwin: {
merge_zips: [":deprecated-renderscript-tools"],
strip_files: [
"lib64/*.dylib",
],
},
not_windows: {
deps: [
"aapt",
"aapt2",
"aidl",
"apksigner",
"d8",
"dexdump",
"split-select",
"zipalign",
],
strip_files: [
"aapt",
"aapt2",
"aidl",
"split-select",
"zipalign",
],
},
windows: {
enabled: true,
merge_zips: [":deprecated-renderscript-tools"],
compile_multilib: "both",
multilib: {
lib32: {
deps: [
"aapt",
"aidl",
"apksigner",
"d8",
"dexdump",
"libwinpthread-1",
"split-select",
"zipalign",
],
},
lib64: {
deps: [
"aapt2",
"libwinpthread-1",
],
},
},
deps_remap: [
{
from: "lib/*",
to: "./",
},
],
strip_files: [
"*.dll",
"aapt.exe",
"aapt2.exe",
"aidl.exe",
"dexdump.exe",
"lib64/*.dll",
"split-select.exe",
"zipalign.exe",
],
},
},
}
android_sdk_repo_host {
name: "deprecated-renderscript-tools",
merge_zips: [
":build-tools_renderscript_includes",
":renderscript-clang-include",
":renderscript_sdk_prebuilts",
],
deps_remap: [
{
from: "bin/*",
to: "./",
},
],
target: {
linux: {
merge_zips: [":build-tools-lld-linux"],
strip_files: [
"lib64/*.so",
"lld-bin/lld",
"lib64/libc++.so.1",
],
},
darwin: {
merge_zips: [":build-tools-lld-darwin"],
strip_files: [
"lib64/*.dylib",
"lld-bin/lld",
],
},
not_windows: {
deps: [
"bcc_compat",
"llvm-rs-cc",
],
strip_files: [
"bcc_compat",
"llvm-rs-cc",
],
},
windows: {
enabled: true,
merge_zips: [":build-tools-lld-windows"],
compile_multilib: "32",
multilib: {
lib32: {
deps: [
"bcc_compat",
"lld",
"llvm-rs-cc",
],
},
},
deps_remap: [
{
from: "lib/*",
to: "./",
},
],
strip_files: [
"*.dll",
"bcc_compat.exe",
"lld-bin/*.dll",
"lld-bin/*.exe",
"lld.exe",
"llvm-rs-cc.exe",
],
},
},
}
// Rename rs_script_api files to renderscript/include/...
genrule {
name: "build-tools_renderscript_includes",
visibility: ["//visibility:private"],
tools: ["soong_zip"],
cmd: "echo $(in) >$(genDir)/list && " +
"$(location soong_zip) -o $(out) -P renderscript " +
"-C $$(dirname $$(dirname $$(awk '{ print $$1 }' $(genDir)/list))) -l $(genDir)/list",
srcs: [":rs_script_api"],
out: ["rs_script_api.zip"],
}
// This is a device library, so it can't be used by android_sdk_repo_host directly.
java_device_for_host {
name: "build-tools_core-lambda-stubs-device",
visibility: ["//visibility:private"],
// Use core-lambda-stubs-src instead of core-lambda-stubs to ensure the
// copy built from source used and not the prebuilts from the ART module
// SDK, otherwise Linux builds use the prebuilts and mac builds use
// source, causing mismatches between build tools for mac and Linux
// (see b/237299698).
libs: ["core-lambda-stubs-src"],
target: {
windows: {
enabled: true,
},
},
}
java_library_host {
name: "build-tools_core-lambda-stubs",
visibility: ["//visibility:private"],
installable: true,
static_libs: ["build-tools_core-lambda-stubs-device"],
target: {
windows: {
enabled: true,
},
},
}
android_sdk_repo_host {
name: "platform-tools",
base_dir: "platform-tools",
deps: [
"adb",
"etc1tool",
"fastboot",
"hprof-conv",
"make_f2fs",
"make_f2fs_casefold",
"mke2fs",
"sqlite3",
],
deps_remap: [
{
from: "bin/*",
to: "./",
},
],
srcs: [
":mke2fs_conf",
":platform_tools_properties",
],
target: {
linux: {
strip_files: ["lib64/*.so"],
},
linux_bionic: {
enabled: false,
},
darwin: {
strip_files: ["lib64/*.dylib"],
},
not_windows: {
strip_files: [
"adb",
"etc1tool",
"fastboot",
"hprof-conv",
"make_f2fs_casefold",
"make_f2fs",
"mke2fs",
"sqlite3",
],
},
windows: {
enabled: true,
deps: [
"AdbWinUsbApi",
"AdbWinApi",
"libwinpthread-1",
],
deps_remap: [
{
from: "lib/*",
to: "./",
},
],
strip_files: [
"*.exe",
],
},
},
}
// For sdk-repo-platforms*.zip
genrule {
name: "sdk_build_prop",
device_common_srcs: [":system-build.prop"],
out: ["build.prop"],
cmd: "sdk_build_prop_remove='ro.build.user= ro.build.host= ro.product.brand= ro.product.manufacturer= ro.product.device= ro.build.product=' && " +
"grep -v '$$(subst $$(space),\\|,$$(strip $${sdk_build_prop_remove}))' $(in) > sdk-build.prop.tmp && " +
"for x in $${sdk_build_prop_remove}; do echo \"$${x}generic\" >> sdk-build.prop.tmp; done && " +
"cp sdk-build.prop.tmp $(out)",
}
genrule {
name: "sdk_platforms_jars_zip",
tools: ["soong_zip"],
srcs: [
"optional.json",
],
device_common_srcs: [
":android_stubs_current_exportable{.jar}",
":frameworks-base-api-current.srcjar",
":core-current-stubs-for-system-modules-exportable",
":org.apache.http.legacy.stubs",
":android_uiautomator",
":android.car-stubs",
":android.test.mock.stubs{.jar}",
":android.test.base.stubs{.jar}",
":android.test.runner.stubs{.jar}",
":sdk-annotations.zip",
":api_versions_public{.api_versions.xml}",
":framework-doc-stubs{.metadata.zip}",
],
out: ["sdk_platforms_jars.zip"],
cmd: "mkdir -p $(genDir)/out/data/ && " +
"mkdir -p $(genDir)/out/optional/ && " +
"cp $(location :sdk-annotations.zip) $(genDir)/out/data/annotations.zip && " +
"cp $(location :api_versions_public{.api_versions.xml}) $(genDir)/out/data/api-versions.xml && " +
"unzip $(location :framework-doc-stubs{.metadata.zip}) -d $(genDir)/out/data/ && " +
"cp $(location optional.json) $(genDir)/out/optional/optional.json && " +
"cp $(location :android_stubs_current_exportable{.jar}) $(genDir)/out/android.jar && " +
"cp $(location :frameworks-base-api-current.srcjar) $(genDir)/out/android-stubs-src.jar && " +
"cp $(location :core-current-stubs-for-system-modules-exportable) $(genDir)/out/core-for-system-modules.jar && " +
"cp $(location :org.apache.http.legacy.stubs) $(genDir)/out/optional/org.apache.http.legacy.jar && " +
"cp $(location :android_uiautomator) $(genDir)/out/uiautomator.jar && " +
"cp $(location :android.car-stubs) $(genDir)/out/optional/android.car.jar && " +
"cp $(location :android.test.mock.stubs{.jar}) $(genDir)/out/optional/android.test.mock.jar && " +
"cp $(location :android.test.base.stubs{.jar}) $(genDir)/out/optional/android.test.base.jar && " +
"cp $(location :android.test.runner.stubs{.jar}) $(genDir)/out/optional/android.test.runner.jar && " +
"$(location soong_zip) -o $(out) -C $(genDir)/out -D $(genDir)/out",
}
genrule {
name: "wear_sdk_zip",
tools: ["soong_zip"],
srcs: [":wear-sdk-public-jar"],
out: ["wear_sdk_jar.zip"],
cmd: "mkdir -p $(genDir)/out/optional/ && " +
"cp $(in) $(genDir)/out/optional/wear-sdk.jar && " +
"$(location soong_zip) -o $(out) -C $(genDir)/out -D $(genDir)/out",
}
android_sdk_repo_host {
name: "platforms",
base_dir: select(soong_config_variable("sdk", "sdk_platform_dir_name"), {
any @ sdk_platform_dir_name: sdk_platform_dir_name,
default: "android",
}),
srcs: [
":sdk_platform_sources_properties",
":sdk_build_prop",
":sdk_properties",
],
merge_zips: [
":sdk_platforms_jars_zip",
":libbinder_ndk_include",
":sdk_platforms_emulator_skins",
":sdk_platforms_templates",
":sdk_platforms_notice",
":sdk_platforms_data_res",
":wear_sdk_zip",
],
pack_framework_aidl: true,
}
// For sdk-repo-samples*.zip
sh_binary_host {
name: "sdk_clean",
src: "tools/sdk_clean.sh",
}
android_sdk_repo_host {
name: "samples",
base_dir: select(soong_config_variable("sdk", "sdk_platform_dir_name"), {
any @ sdk_platform_dir_name: sdk_platform_dir_name,
default: "android",
}),
merge_zips: [
":sdk_repo_sample_legacy_zip",
":sdk_repo_sample_new_zip",
],
}
// For sdk-repo-sources*.zip
genrule {
name: "sdk_repo_sources_zip",
tools: ["soong_zip"],
device_common_srcs: [":platform-bootclasspath.srcjar"],
out: ["sdk_repo_sources.zip"],
cmd: "mkdir -p $(genDir)/out/ && " +
"unzip -qd $(genDir)/out $(location :platform-bootclasspath.srcjar) && " +
"$(location soong_zip) -o $(out) -C $(genDir)/out/ -D $(genDir)/out/",
}
android_sdk_repo_host {
name: "sources",
base_dir: "src",
srcs: [
":sdk_sources_source_properties",
],
merge_zips: [
":sdk_repo_sources_zip",
],
}
// For sdk-repo-docs*.zip
genrule {
name: "sdk_repo_docs_zip",
tools: ["soong_zip"],
srcs: [
":docs_samples_redirect",
],
device_common_srcs: [":offline-sdk-docs"],
out: ["sdk_repo_docs.zip"],
cmd: "mkdir -p $(genDir)/out/ && " +
"unzip -qd $(genDir)/out $(location :offline-sdk-docs) && " +
"mkdir -p $(genDir)/out/samples/ && " +
"cp $(locations :docs_samples_redirect) $(genDir)/out/samples/index.html && " +
"$(location soong_zip) -o $(out) -C $(genDir)/out/ -D $(genDir)/out/",
}
android_sdk_repo_host {
name: "docs",
base_dir: "docs",
srcs: [
":sdk_docs_source_properties",
],
merge_zips: [
":sdk_repo_docs_zip",
],
}
// Replacement for those sdk related target being disted, original defined under
// development/build/tools/sdk-preprocess-files.mk
// TODO(b/461970385): Move those dist targets to the srcs directly.
genrule {
name: "sdk_data_dist",
device_common_srcs: [
":sdk-annotations.zip",
":api_versions_public{.api_versions.xml}",
],
out: [
"annotations.zip",
"api-versions.xml",
],
cmd: "cp $(location :sdk-annotations.zip) $(genDir)/annotations.zip && " +
"cp $(location :api_versions_public{.api_versions.xml}) $(genDir)/api-versions.xml",
dist: {
targets: ["sdk"],
dir: "data",
},
}
genrule {
name: "sdk_module_lib_data_dist",
device_common_srcs: [
":sdk-annotations-module-lib.zip",
":api_versions_module_lib_complete{.api_versions.xml}",
":api_versions_module_lib{.api_versions.xml}",
],
out: [
"annotations.zip",
"api-versions-complete.xml",
"api-versions.xml",
],
cmd: "cp $(location :sdk-annotations-module-lib.zip) $(genDir)/annotations.zip && " +
"cp $(location :api_versions_module_lib_complete{.api_versions.xml}) $(genDir)/api-versions-complete.xml && " +
"cp $(location :api_versions_module_lib{.api_versions.xml}) $(genDir)/api-versions.xml",
dist: {
targets: ["sdk"],
dir: "module-lib-data",
},
}
genrule {
name: "sdk_system_data_dist",
device_common_srcs: [
":sdk-annotations-system.zip",
":api_versions_system{.api_versions.xml}",
],
out: [
"annotations.zip",
"api-versions.xml",
],
cmd: "cp $(location :sdk-annotations-system.zip) $(genDir)/annotations.zip && " +
"cp $(location :api_versions_system{.api_versions.xml}) $(genDir)/api-versions.xml",
dist: {
targets: ["sdk"],
dir: "system-data",
},
}
genrule {
name: "sdk_system_server_data_dist",
device_common_srcs: [
":sdk-annotations-system-server.zip",
":api_versions_system_server_complete{.api_versions.xml}",
":api_versions_system_server{.api_versions.xml}",
],
out: [
"annotations.zip",
"api-versions-complete.xml",
"api-versions.xml",
],
cmd: "cp $(location :sdk-annotations-system-server.zip) $(genDir)/annotations.zip && " +
"cp $(location :api_versions_system_server_complete{.api_versions.xml}) $(genDir)/api-versions-complete.xml && " +
"cp $(location :api_versions_system_server{.api_versions.xml}) $(genDir)/api-versions.xml",
dist: {
targets: ["sdk"],
dir: "system-server-data",
},
}