קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
BuildInfo הוא אובייקט נפוץ ב-TF שמשמש להעברת משאבים להגדרה ולהרצה של בדיקות.
כל מה שצריך, החל מתמונות של מכשירים ועד לחבילות APK לבדיקה, מאוחסן או מקושר ב-BuildInfo.
כך אפשר לגשת למשאבי הבדיקה מתוך הבדיקה, ולנתק את הבדיקה מהשימוש במשאבי הבדיקה.
מאפייני BuildInfo
שני המאפיינים העיקריים של אובייקטים מסוג BuildInfo הם מאפיינים וקבצים:
אפשר להוסיף מאפיינים באמצעות #addBuildAttribute(). הם מייצגים תוויות ומידע על מחרוזות לגרסאות ה-build. אפשר להשתמש במאפיינים כדי לאחסן מידע שקשור לגרסה.
אפשר להוסיף קבצים באמצעות setFile(). BuildInfo עוקב אחרי הקובץ ומנהל אותו במהלך מחזור החיים של הקריאה (לדוגמה, מטפל בו כראוי במהלך חלוקה למקטעים). כך אין צורך לדעת בבדיקה משהו על מערכת הקבצים, ובמקום זאת אפשר להסתמך על האובייקט המופשט BuildInfo כדי לקבל את המשאבים.
BuildInfo במספר מכשירים
כשמגדירים הגדרת בדיקה עם כמה מכשירים, קיים אובייקט BuildInfo אחד לכל מכשיר. כך אפשר לבקש קבצים ולטרגט אותם ממכשיר אחד למכשיר אחר.
BuildInfo במספר גרסאות build
אפשר לדרוש גרסאות build מכמה יעדים. במקרים כאלה, קיים אובייקט BuildInfo אחד לכל יעד. כך אפשר לבקש קבצים מכל יעד ולטרגט אותם.
פורמט Proto
אפשר לסדר את BuildInfo בפורמט protobuf כדי להקל על השימוש בו במערכות שונות, אם יש צורך.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# BuildInfo in Tradefed\n\n[`BuildInfo`](https://android.googlesource.com/platform/tools/tradefederation/+/refs/heads/android16-release/src/com/android/tradefed/build/BuildInfo.java)\nin TF is a widely used object to carry resources for test setup and runs.\nEverything from device images to test APKs are stored or linked in `BuildInfo`.\nThis allows a unified way to access test resources from a test\nand decouple the test from getting test resources.\n\nBuildInfo properties\n--------------------\n\nThe two main properties of `BuildInfo` objects are attributes and files:\n\n- *Attributes* can be added with `#addBuildAttribute()`; they represent labels and string information to the builds. Attributes can be used to store information related to the build.\n- *Files* can be added with `setFile()`; the file is tracked and managed by `BuildInfo` during the invocation lifecycle (for example, properly handled during sharding). This avoids the need for the test to know anything about the file system and instead can rely on the abstracted `BuildInfo` object to get their resources.\n\n| **Note:** Files should always be stored in `Files` and not in `Attributes` as an absolute path. Attributes are treated as pure Java strings, and the reference could be invalidated during part of the invocation lifecycle.\n\nBuildInfo in multi-devices\n--------------------------\n\nWhen a test configuration is set up with multiple devices, one `BuildInfo`\nobject exists per device. This allows requesting and targeting files from one\ndevice to another.\n\nBuildInfo in multi-builds\n-------------------------\n\nIt's possible to require builds from several targets. In these cases, one\n`BuildInfo` object exists per target. This allows requesting and targeting\nfiles from any target.\n\nProto format\n------------\n\n`BuildInfo` is serializable in a protobuf format to make its usage easier across\nsystems if needed."]]