規則
- android_binary
- aar_import
- android_library
- android_instrumentation_test
- android_local_test
- android_device
- android_ndk_repository
- android_sdk_repository
android_binary
android_binary(name, deps, srcs, assets, assets_dir, compatible_with, crunch_png, custom_package, debug_key, debug_signing_keys, debug_signing_lineage_file, densities, deprecation, dex_shards, dexopts, distribs, enable_data_binding, exec_compatible_with, exec_properties, features, incremental_dexing, instruments, javacopts, key_rotation_min_sdk, licenses, main_dex_list, main_dex_list_opts, main_dex_proguard_specs, manifest, manifest_values, multidex, nocompress_extensions, package_id, plugins, proguard_apply_dictionary, proguard_apply_mapping, proguard_generate_mapping, proguard_specs, resource_configuration_filters, resource_files, restricted_to, shrink_resources, tags, target_compatible_with, testonly, visibility)
產生 Android 應用程式套件檔案 (.apk)。
隱式輸出目標
name.apk
:使用偵錯金鑰簽署且 已 zipalign 處理的 Android 應用程式套件檔案,就能用來開發應用程式和偵錯。使用偵錯金鑰簽署時,您無法發布應用程式。name_unsigned.apk
:上述檔案的未簽署版本,可在發布前使用發布金鑰簽署。name_deploy.jar
:包含此目標轉換關閉的 Java 封存。部署 jar 包含從頭到尾搜尋這個目標的執行階段類別路徑,類別載入器會看到的所有類別。
name_proguard.jar
:包含name_deploy.jar
執行 ProGuard 結果的 Java 封存。只有在指定 proguard_specs 屬性時,系統才會產生這個輸出內容。name_proguard.map
:在name_deploy.jar
上執行 ProGuard 的對應檔案結果。只有在指定 proguard_specs 屬性,且已設定 proguard_generate_mapping 或 shrink_resources 時,系統才會產生輸出內容。
範例
您可以在 Bazel 來源樹狀結構的 examples/android
目錄中找到 Android 規則範例。
引數
屬性 | |
---|---|
name |
此目標的專屬名稱。 |
deps
|
android_library 、設有 android 限制的 java_library ,以及 cc_library 包裝或產生 .so 原生資料庫供 Android 目標平台使用。 |
srcs
|
系統會編譯
|
assets
|
assets 目錄下所有檔案的 glob 。您也可以參照其他規則 (任何會產生檔案的規則),或參照其他套件中的匯出檔案,前提是這些檔案必須全都在對應套件的 assets_dir 目錄中。 |
assets_dir
|
assets 中檔案路徑的字串。assets 和 assets_dir 組合用於說明封裝的資產,因此不應同時提供這兩個屬性,或是兩者都不提供。 |
crunch_png
|
|
custom_package
|
|
debug_key
|
警告:請勿使用正式版金鑰,這些金鑰應受到嚴格保護,而不是儲存在原始碼樹狀結構中。 |
debug_signing_keys
|
警告:請勿使用正式版金鑰,這些金鑰應受到嚴格保護,而不是儲存在原始碼樹狀結構中。 |
debug_signing_lineage_file
|
警告:請勿使用正式版金鑰,這些金鑰應受到嚴格保護,而不是儲存在原始碼樹狀結構中。 |
densities
|
|
dex_shards
|
請注意,每個資料分割都會在最終應用程式中產生至少一個 dex。因此,我們不建議將版本二進位檔設為超過 1 個。 |
dexopts
|
|
enable_data_binding
|
如要建構包含資料繫結的 Android 應用程式,您還必須執行下列操作:
|
incremental_dexing
|
|
instruments
|
要用於檢測的 如果設定這項屬性,系統會將這個 |
javacopts
|
這些編譯器選項會在全域編譯器選項之後傳遞至 javac。 |
key_rotation_min_sdk
|
|
main_dex_list
|
android/support/multidex/MultiDex$V19.class android/support/multidex/MultiDex.class android/support/multidex/MultiDexApplication.class com/google/common/base/Objects.class必須與 multidex="manual_main_dex" 搭配使用。 |
main_dex_list_opts
|
|
main_dex_proguard_specs
|
multidex 屬性設為 legacy 時才能使用。
|
manifest
|
AndroidManifest.xml 。如果已定義 resource_files 或資產,就必須定義。 |
manifest_values
|
|
multidex
|
可能的值包括:
|
nocompress_extensions
|
|
package_id
|
詳情請參閱 AAPT2 的 |
plugins
|
java_plugin 都會執行。外掛程式產生的資源會納入目標的結果 Jar 中。
|
proguard_apply_dictionary
|
|
proguard_apply_mapping
|
proguard_generate_mapping 產生的對應檔案,可重複使用,將相同的對應套用到新版本。 |
proguard_generate_mapping
|
proguard_specs 時,系統才會產生對應檔案。這個檔案會列出原始和模糊化的類別、方法和欄位名稱之間的對應關係。警告:如果使用這項屬性,Proguard 規格不應包含 |
proguard_specs
|
|
resource_configuration_filters
|
en_XA 和/或 ar_XB 虛擬語言代碼。 |
resource_files
|
res 目錄下所有檔案的 glob 。標籤也可以參照產生的檔案 (取自 genrules)。唯一的限制是,產生的輸出內容必須與任何納入的其他資源檔案位於相同的「 res 」目錄。 |
shrink_resources
|
manifest 和 resource_files 屬性) 的規則,且需要 ProGuard。
運作方式與 Gradle 資源縮減器相同 (https://developer.android.com/studio/build/shrink-code.html#shrink-resources) 大致相同。重要差異:
name_files/resource_shrinker.log ,詳細列出已執行的分析和刪除作業。可能的值包括:
|
aar_import
aar_import(name, deps, data, aar, compatible_with, deprecation, distribs, exec_compatible_with, exec_properties, exports, features, licenses, restricted_to, srcjar, tags, target_compatible_with, testonly, visibility)
這項規則允許將 .aar
檔案做為 android_library
和 android_binary
規則的程式庫。
範例
aar_import( name = "google-vr-sdk", aar = "gvr-android-sdk/libraries/sdk-common-1.10.0.aar", ) android_binary( name = "app", manifest = "AndroidManifest.xml", srcs = glob(["**.java"]), deps = [":google-vr-sdk"], )
引數
屬性 | |
---|---|
name |
此目標的專屬名稱。 |
aar
|
.aar 檔案。 |
exports
|
|
srcjar
|
|
android_library
android_library(name, deps, srcs, data, assets, assets_dir, compatible_with, custom_package, deprecation, distribs, enable_data_binding, exec_compatible_with, exec_properties, exported_plugins, exports, exports_manifest, features, idl_import_root, idl_parcelables, idl_preprocessed, idl_srcs, javacopts, licenses, manifest, neverlink, plugins, proguard_specs, resource_files, restricted_to, tags, target_compatible_with, testonly, visibility)
這項規則會將原始碼編譯並封存至 .jar
檔案中。系統會以隱含方式將 Android 執行階段程式庫 android.jar
置於編譯類別路徑上。
隱式輸出目標
libname.jar
:Java 封存。libname-src.jar
:包含來源的封存 (「source jar」)。name.aar
:Android「aar」套件,包含此目標的 Java 封存和資源。不含遞移性閉合。
範例
您可以在 Bazel 來源樹狀結構的 examples/android
目錄中找到 Android 規則範例。
以下範例說明如何設定 idl_import_root
。讓 //java/bazel/helloandroid/BUILD
包含:
android_library( name = "parcelable", srcs = ["MyParcelable.java"], # bazel.helloandroid.MyParcelable # MyParcelable.aidl will be used as import for other .aidl # files that depend on it, but will not be compiled. idl_parcelables = ["MyParcelable.aidl"] # bazel.helloandroid.MyParcelable # We don't need to specify idl_import_root since the aidl file # which declares bazel.helloandroid.MyParcelable # is present at java/bazel/helloandroid/MyParcelable.aidl # underneath a java root (java/). ) android_library( name = "foreign_parcelable", srcs = ["src/android/helloandroid/OtherParcelable.java"], # android.helloandroid.OtherParcelable idl_parcelables = [ "src/android/helloandroid/OtherParcelable.aidl" # android.helloandroid.OtherParcelable ], # We need to specify idl_import_root because the aidl file which # declares android.helloandroid.OtherParcelable is not positioned # at android/helloandroid/OtherParcelable.aidl under a normal java root. # Setting idl_import_root to "src" in //java/bazel/helloandroid # adds java/bazel/helloandroid/src to the list of roots # the aidl compiler will search for imported types. idl_import_root = "src", ) # Here, OtherInterface.aidl has an "import android.helloandroid.CallbackInterface;" statement. android_library( name = "foreign_interface", idl_srcs = [ "src/android/helloandroid/OtherInterface.aidl" # android.helloandroid.OtherInterface "src/android/helloandroid/CallbackInterface.aidl" # android.helloandroid.CallbackInterface ], # As above, idl_srcs which are not correctly positioned under a java root # must have idl_import_root set. Otherwise, OtherInterface (or any other # interface in a library which depends on this one) will not be able # to find CallbackInterface when it is imported. idl_import_root = "src", ) # MyParcelable.aidl is imported by MyInterface.aidl, so the generated # MyInterface.java requires MyParcelable.class at compile time. # Depending on :parcelable ensures that aidl compilation of MyInterface.aidl # specifies the correct import roots and can access MyParcelable.aidl, and # makes MyParcelable.class available to Java compilation of MyInterface.java # as usual. android_library( name = "idl", idl_srcs = ["MyInterface.aidl"], deps = [":parcelable"], ) # Here, ServiceParcelable uses and thus depends on ParcelableService, # when it's compiled, but ParcelableService also uses ServiceParcelable, # which creates a circular dependency. # As a result, these files must be compiled together, in the same android_library. android_library( name = "circular_dependencies", srcs = ["ServiceParcelable.java"], idl_srcs = ["ParcelableService.aidl"], idl_parcelables = ["ServiceParcelable.aidl"], )
引數
屬性 | |
---|---|
name |
此目標的專屬名稱。 |
deps
|
android_library 、設有 android 限制的 java_library ,以及 cc_library 包裝或產生 .so 原生資料庫供 Android 目標平台使用。 |
srcs
|
.java 或 .srcjar 檔案清單。系統會編譯
如果省略 |
assets
|
assets 目錄下所有檔案的 glob 。您也可以參照其他規則 (任何會產生檔案的規則),或參照其他套件中的匯出檔案,前提是這些檔案必須全都在對應套件的 assets_dir 目錄中。 |
assets_dir
|
assets 中檔案路徑的字串。assets 和 assets_dir 組合用於說明封裝的資產,因此不應同時提供這兩個屬性,或是兩者都不提供。 |
custom_package
|
|
enable_data_binding
|
如要建構包含資料繫結的 Android 應用程式,您還必須執行下列操作:
|
exported_plugins
|
java_plugin 清單 (例如註解處理工具)。
指定的 |
exports
|
exports 屬性到達的所有規則,則視為直接依附於任何直接依附於 exports 目標的規則。
|
exports_manifest
|
android_binary 目標。uses-permissions 屬性絕不會匯出。
|
idl_import_root
|
處理依附這個程式庫的 ID 來源時,這個路徑會用來當做匯入根目錄。 如果指定 請參閱 範例。 |
idl_parcelables
|
android_library 目標 (直接或透過連帶封閉做法),但不會翻譯為 Java 或編譯。僅應包含與這個程式庫中的 這些檔案必須適當放置,才能讓 AI 編譯器找到。 如要瞭解相關意義,請參閱 idl_import_root 的說明。 |
idl_preprocessed
|
android_library 目標 (直接或透過連帶封閉做法),但不會翻譯為 Java 或編譯。僅應包含與這個程式庫中 |
idl_srcs
|
srcs 的內容一起編譯。這些檔案將做為匯入此程式庫的任何 這些檔案必須適當放置,才能讓 AI 編譯器找到。 如要瞭解相關意義,請參閱 idl_import_root 的說明。 |
javacopts
|
這些編譯器選項會在全域編譯器選項之後傳遞至 javac。 |
manifest
|
AndroidManifest.xml 。如果已定義 resource_files 或資產,就必須定義。 |
neverlink
|
neverlink 的規則的輸出內容不會用於 .apk 建立作業。如果在執行期間由執行階段環境提供程式庫,這個選項就能派上用場。 |
plugins
|
java_plugin 都會執行。外掛程式產生的資源會納入目標的結果 Jar 中。
|
proguard_specs
|
android_binary 目標。這裡所含檔案只能包含冪等規則、-dontnote、-dontwarn、假設無副作用,以及以 -keep 開頭的規則。其他選項只能顯示在 android_binary 的 proguard_specs 中,以確保非自動化的合併情況。
|
resource_files
|
res 目錄下所有檔案的 glob 。標籤也可以參照產生的檔案 (取自 genrules)。唯一的限制是,產生的輸出內容必須與任何納入的其他資源檔案位於相同的「 res 」目錄。 |
android_instrumentation_test
android_instrumentation_test(name, data, args, compatible_with, deprecation, distribs, env, env_inherit, exec_compatible_with, exec_properties, features, flaky, licenses, local, restricted_to, shard_count, size, support_apks, tags, target_compatible_with, target_device, test_app, testonly, timeout, toolchains, visibility)
android_instrumentation_test
規則會執行 Android 檢測設備測試。這個程序會啟動模擬器、安裝接受測試的應用程式、測試應用程式和任何其他所需應用程式,然後執行測試套件中定義的測試。
test_app 屬性會指定包含測試的 android_binary
。此 android_binary
會以其檢測屬性指定待測試的 android_binary
應用程式。
範例
# java/com/samples/hello_world/BUILD android_library( name = "hello_world_lib", srcs = ["Lib.java"], manifest = "LibraryManifest.xml", resource_files = glob(["res/**"]), ) # The app under test android_binary( name = "hello_world_app", manifest = "AndroidManifest.xml", deps = [":hello_world_lib"], )
# javatests/com/samples/hello_world/BUILD android_library( name = "hello_world_test_lib", srcs = ["Tests.java"], deps = [ "//java/com/samples/hello_world:hello_world_lib", ... # test dependencies such as Espresso and Mockito ], ) # The test app android_binary( name = "hello_world_test_app", instruments = "//java/com/samples/hello_world:hello_world_app", manifest = "AndroidManifest.xml", deps = [":hello_world_test_lib"], ) android_instrumentation_test( name = "hello_world_uiinstrumentation_tests", target_device = ":some_target_device", test_app = ":hello_world_test_app", )
引數
屬性 | |
---|---|
name |
此目標的專屬名稱。 |
support_apks
|
|
target_device
|
執行測試的 android_device。 如要在已在執行中的模擬器或實體裝置上執行測試,請使用以下引數: |
test_app
|
android_binary 目標必須透過 instruments 屬性指定要測試的目標。 |
android_local_test
android_local_test(name, deps, srcs, data, args, compatible_with, custom_package, densities, deprecation, enable_data_binding, env, env_inherit, exec_compatible_with, exec_properties, features, flaky, javacopts, jvm_flags, licenses, local, manifest, manifest_values, nocompress_extensions, plugins, resource_configuration_filters, resource_jars, resource_strip_prefix, restricted_to, runtime_deps, shard_count, size, stamp, tags, target_compatible_with, test_class, testonly, timeout, toolchains, use_launcher, visibility)
這項規則適用於本機 (而非裝置) 測試 android_library
規則。可與 Android Robolectric 測試架構搭配使用。如要進一步瞭解如何編寫 Robolectric 測試,請參閱 Android Robolectric 網站。
隱式輸出目標
name.jar
:測試的 Java 封存。name-src.jar
:包含來源的封存 (「source jar」)。name_deploy.jar
:適合部署的 Java 部署封存檔 (僅在明確要求時建構)。
範例
如要將 Robolectric 與 android_local_test
搭配使用,請將 Robolectric 的存放區新增至 WORKSPACE
檔案:
http_archive( name = "robolectric", urls = ["https://github.com/robolectric/robolectric/archive/<COMMIT>.tar.gz"], strip_prefix = "robolectric-<COMMIT>", sha256 = "<HASH>", ) load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories") robolectric_repositories()這項操作會提取 Robolectric 所需的
maven_jar
規則。
接著,每個 android_local_test
規則都應依附於 @robolectric//bazel:robolectric
。請見以下範例。
android_local_test( name = "SampleTest", srcs = [ "SampleTest.java", ], manifest = "LibManifest.xml", deps = [ ":sample_test_lib", "@robolectric//bazel:robolectric", ], ) android_library( name = "sample_test_lib", srcs = [ "Lib.java", ], resource_files = glob(["res/**"]), manifest = "AndroidManifest.xml", )
引數
屬性 | |
---|---|
name |
此目標的專屬名稱。 |
deps
|
|
srcs
|
系統會編譯
只要至少有一個檔案類型屬於上述的檔案類型,系統會忽略所有其他檔案。否則會發生錯誤。
除非指定 |
custom_package
|
test_class 。 |
densities
|
|
enable_data_binding
|
|
javacopts
|
這些編譯器選項會在全域編譯器選項之後傳遞至 javac。 |
jvm_flags
|
Java 二進位檔的包裝函式指令碼包含 CLASSPATH 定義 (用於尋找所有相依 jar),並叫用正確的 Java 解譯器。包裝函式指令碼產生的指令列包含主要類別名稱,後面加上 請注意,這個屬性對 |
manifest
|
AndroidManifest.xml 。必須定義 resource_files 或資產,或是受測試程式庫中是否有任何資訊清單含有 minSdkVersion 標記。
|
manifest_values
|
applicationId 、versionCode 、versionName 、minSdkVersion 、targetSdkVersion 和 maxSdkVersion 也會覆寫資訊清單和 use-sdk 標記的對應屬性。packageName 系統會忽略並系統會從 applicationId (如有指定) 或資訊清單中的套件進行設定。您不一定要在規則中加入資訊清單,才能使用 manifest_values。
|
nocompress_extensions
|
|
plugins
|
java_plugin 都會執行。程式庫也可能會繼承使用 exported_plugins 的依附元件的外掛程式。外掛程式產生的資源會納入這項規則產生的 jar 中。 |
resource_configuration_filters
|
|
resource_jars
|
|
resource_strip_prefix
|
如有指定,系統會從 |
runtime_deps
|
deps 一樣,這些項目會顯示在執行階段類別路徑上,但與編譯時間類別路徑不同,而非在編譯時間類別路徑上。這裡會列出只有執行階段所需的依附元件。依附元件分析工具應忽略同時出現在 runtime_deps 和 deps 中的目標。 |
stamp
|
除非二進位檔的依附元件變更,否則系統「不會」重新建立經過加載的二進位檔。 |
test_class
|
這項屬性會指定這項測試要執行的 Java 類別名稱。這種情況很少見。如果省略這個引數,系統會使用名稱與這項 |
use_launcher
|
如果將這項屬性設為 false,系統會忽略這個目標的啟動器屬性和相關的 |
android_device
android_device(name, cache, compatible_with, default_properties, deprecation, distribs, exec_compatible_with, exec_properties, features, horizontal_resolution, licenses, platform_apks, ram, restricted_to, screen_density, system_image, tags, target_compatible_with, testonly, vertical_resolution, visibility, vm_heap)
這項規則會建立採用指定規格的 Android 模擬器。您可以透過 bazel 執行指令或直接執行產生的指令碼來啟動這個模擬器。建議您根據現有的 android_device 規則定義,而不要自行定義規則。
這項規則是 --run_under 標記,可對 bazel 測試和 blaze 執行的 --run_under 標記而言。這項工具會啟動模擬器,將要測試/執行的目標複製到模擬器,並視情況測試或執行。
如果基礎 system_image 以 X86 為基礎,且已針對最多 I686 CPU 架構進行最佳化,則 android_device
支援建立 KVM 映像檔。如要使用 KVM,請將 tags = ['requires-kvm']
加入 android_device
規則。
隱式輸出目標
name_images/userdata.dat
:包含用於啟動模擬器的圖片檔和快照name_images/emulator-meta-data.pb
:包含傳遞至模擬器以重新啟動模擬器所需的序列化資訊。
範例
以下範例說明如何使用 android_device。//java/android/helloandroid/BUILD
包含
android_device( name = "nexus_s", cache = 32, default_properties = "nexus_s.properties", horizontal_resolution = 480, ram = 512, screen_density = 233, system_image = ":emulator_images_android_16_x86", vertical_resolution = 800, vm_heap = 32, ) filegroup( name = "emulator_images_android_16_x86", srcs = glob(["androidsdk/system-images/android-16/**"]), )
//java/android/helloandroid/nexus_s.properties
包含:
ro.product.brand=google ro.product.device=crespo ro.product.manufacturer=samsung ro.product.model=Nexus S ro.product.name=soju
這項規則會產生圖片和指令碼。您可以在本機啟動模擬器,方法是執行 bazel run :nexus_s --action=start。這個指令碼會顯示下列標記:
- --adb_port:要公開 ADB 的通訊埠。如果您想向模擬器發出 ADB 指令,這就是 ADB 連線的通訊埠。
- --emulator_port:公開模擬器 telnet 管理主控台的通訊埠。
- --enable_display:如果為 true,系統會使用螢幕啟動模擬器 (預設值為 false)。
- --action:開始或終止。
- --apks_to_install:要在模擬器上安裝的 APK 清單。
引數
屬性 | |
---|---|
name |
此目標的專屬名稱。 |
cache
|
|
default_properties
|
|
horizontal_resolution
|
|
platform_apks
|
|
ram
|
|
screen_density
|
|
system_image
|
|
vertical_resolution
|
|
vm_heap
|
|
android_ndk_repository
android_ndk_repository(name, api_level, path, repo_mapping)
將 Bazel 設為使用 Android NDK,藉此使用原生程式碼建構 Android 目標。
請注意,建構 Android 應用程式也需要 WORKSPACE
檔案中的 android_sdk_repository
規則。
詳情請參閱 將 Android NDK 與 Bazel 搭配使用的完整說明文件。
範例
android_ndk_repository( name = "androidndk", )
上述範例會從 $ANDROID_NDK_HOME
找出 Android NDK,並偵測其支援的最高 API 級別。
android_ndk_repository( name = "androidndk", path = "./android-ndk-r20", api_level = 24, )
以上範例將使用位於 ./android-ndk-r20
工作區中的 Android NDK。並在編譯 JNI 程式碼時使用 API 級別 24 程式庫。
CPU
Android NDK 包含 cpufeatures 程式庫,可用於在執行階段偵測裝置的 CPU。以下範例說明如何透過 Bazel 使用 cpufeatures。
# jni.cc #include "ndk/sources/android/cpufeatures/cpu-features.h" ...
# BUILD cc_library( name = "jni", srcs = ["jni.cc"], deps = ["@androidndk//:cpufeatures"], )
引數
屬性 | |
---|---|
name |
此目標的專屬名稱。 |
api_level
|
|
path
|
$ANDROID_NDK_HOME 環境變數。
您可以從 Android 開發人員網站 下載 Android NDK。 |
repo_mapping
|
舉例來說,項目 |
android_sdk_repository
android_sdk_repository(name, api_level, build_tools_version, path, repo_mapping)
將 Bazel 設為使用本機 Android SDK 以支援建構 Android 目標。
範例
要為 Bazel 設定 Android SDK,您至少要在WORKSPACE
檔案中將名為「androidsdk」的 android_sdk_repository
規則,並將 $ANDROID_HOME
環境變數設為 Android SDK 的路徑。根據預設,Bazel 會使用最高 Android API 級別和安裝在 Android SDK 中的建構工具版本。android_sdk_repository( name = "androidsdk", )
為確保可重現的建構作業,您可以將 path
、api_level
和 build_tools_version
屬性設為特定值。如果 Android SDK 未安裝指定的 API 級別或建構工具版本,建構作業就會失敗。
android_sdk_repository( name = "androidsdk", path = "./sdk", api_level = 19, build_tools_version = "25.0.0", )
上述範例也示範如何使用 Android SDK 的工作區相關路徑。如果 Android SDK 是 Bazel 工作區的一部分 (例如,如果 Android SDK 已檢查到版本控制),這項功能就非常實用。
支援資料庫
在 Android SDK Manager 中,支援資料庫會以「Android 支援存放區」的形式提供。這是一組已建立版本的通用 Android 程式庫 (例如 Support 和 AppCompat 程式庫),並封裝為本機 Maven 存放區。android_sdk_repository
會為每個可用於 android_binary
和 android_library
目標依附元件的程式庫產生 Bazel 目標。
系統產生的目標名稱衍生自 Android 支援存放區中程式庫的 Maven 座標,格式為 @androidsdk//${group}:${artifact}-${version}
。以下範例說明 android_library
如何依附 v7 appcompat 程式庫 25.0.0 版。
android_library( name = "lib", srcs = glob(["*.java"]), manifest = "AndroidManifest.xml", resource_files = glob(["res/**"]), deps = ["@androidsdk//com.android.support:appcompat-v7-25.0.0"], )
引數
屬性 | |
---|---|
name |
此目標的專屬名稱。 |
api_level
|
如要查看 |
build_tools_version
|
Bazel 必須使用 30.0.0 以上版本的建構工具。 |
path
|
$ANDROID_HOME 環境變數。
您可以前往 Android 開發人員網站下載 Android SDK。 |
repo_mapping
|
舉例來說,項目 |