Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Đối tượng cấu hình Tradefed
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Cấu hình XML Tradefed được phân tích cú pháp và một đối tượng Configuration
được tạo từ cấu hình đó để mô tả cấu hình hoàn chỉnh.
Đối tượng này được mô tả bằng giao diện IConfiguration. Đối tượng này sẽ chứa một thực thể của tất cả các đối tượng được xác định trong XML.
Ví dụ này:
<configuration description="<description of the configuration>">
<!-- A build provider that takes local device information -->
<build_provider class="com.android.tradefed.build.BootstrapBuildProvider" />
<!-- Some target preparation, disabled by default -->
<target_preparer class="com.android.tradefed.targetprep.PreloadedClassesPreparer">
<option name="disable" value="true" />
</target_preparer>
<!-- One test running some unit tests -->
<test class="com.android.tradefed.testtype.HostTest">
<option name="class" value="com.android.tradefed.build.BuildInfoTest" />
</test>
</configuration>
Sẽ dẫn đến:
IConfiguration#getBuildProvider()
để trả về một thực thể BootstrapBuildProvider
.
IConfiguration#getTargetPreparers()
để trả về danh sách ITargetPreparer
chứa một thực thể của PreloadedClassesPreparer
.
IConfiguration#getTests()
để trả về danh sách IRemoteTest
chứa một bản sao của HostTest
.
Mọi đối tượng trong đối tượng cấu hình đều có thể được liên kết với định nghĩa XML, vì vậy, việc hiểu định nghĩa XML thường giúp bạn hiểu được những gì cần mong đợi từ đối tượng cấu hình.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Tradefed configuration object\n\n[Tradefed XML configuration](/docs/core/tests/tradefed/architecture/xml-config)\nis parsed, and a `Configuration` object is created from it that describes the\ncomplete configuration.\n\nThe object is described by the\n[IConfiguration interface.](https://android.googlesource.com/platform/tools/tradefederation/+/refs/heads/android16-release/src/com/android/tradefed/config/IConfiguration.java)\nit will contain an instance of all the objects defined in the XML.\n\nThis example: \n\n \u003cconfiguration description=\"\u003cdescription of the configuration\u003e\"\u003e\n \u003c!-- A build provider that takes local device information --\u003e\n \u003cbuild_provider class=\"com.android.tradefed.build.BootstrapBuildProvider\" /\u003e\n\n \u003c!-- Some target preparation, disabled by default --\u003e\n \u003ctarget_preparer class=\"com.android.tradefed.targetprep.PreloadedClassesPreparer\"\u003e\n \u003coption name=\"disable\" value=\"true\" /\u003e\n \u003c/target_preparer\u003e\n\n \u003c!-- One test running some unit tests --\u003e\n \u003ctest class=\"com.android.tradefed.testtype.HostTest\"\u003e\n \u003coption name=\"class\" value=\"com.android.tradefed.build.BuildInfoTest\" /\u003e\n \u003c/test\u003e\n \u003c/configuration\u003e\n\nWill result in:\n\n- `IConfiguration#getBuildProvider()` to return a `BootstrapBuildProvider` instance.\n- `IConfiguration#getTargetPreparers()` to return a list of `ITargetPreparer` containing an instance of `PreloadedClassesPreparer`.\n- `IConfiguration#getTests()` to return a list of `IRemoteTest` containing an instance of `HostTest`.\n\nEvery single object in the configuration object can be mapped to the XML\ndefinition, so understanding the XML definition usually helps to understand\nwhat to expect from the configuration object."]]