自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release 而非 aosp-main 建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
SearchArtifactUtil
public
class
SearchArtifactUtil
extends Object
| java.lang.Object
|
| ↳ |
com.android.tradefed.util.SearchArtifactUtil
|
可用於搜尋測試構件的公用程式類別。
摘要
公用方法 |
static
File
|
findModuleDir(String moduleName, boolean targetFirst)
找出與指定模組名稱相符的模組目錄
|
static
File
|
getModuleDirFromConfig(IInvocationContext moduleContext)
|
static
File
|
getModuleDirFromConfig()
如果在模組範圍內呼叫,則會傳回模組目錄 (如有)。
|
static
File
|
getModuleDirFromConfig(ConfigurationDescriptor descriptor)
|
static
File
|
searchFile(String fileName, boolean targetFirst)
從測試目錄搜尋測試構件/依附元件檔案。
|
static
File
|
searchFile(String fileName, boolean targetFirst, IAbi abi)
從測試目錄搜尋測試構件/依附元件檔案。
|
static
File
|
searchFile(String fileName, boolean targetFirst, TestInformation testInfo)
從測試目錄搜尋測試構件/依附元件檔案。
|
static
File
|
searchFile(String fileName, boolean targetFirst, IAbi abi, altDirs, AltDirBehavior altDirBehavior, TestInformation testInfo, boolean includeDirectory)
從測試目錄搜尋測試構件/依附元件檔案。
|
static
File
|
searchFile(String fileName, boolean targetFirst, IAbi abi, altDirs, AltDirBehavior altDirBehavior, TestInformation testInfo)
從測試目錄搜尋測試構件/依附元件檔案。
|
static
File
|
searchFile(String fileName, boolean targetFirst, altDirs, AltDirBehavior altDirBehavior)
從測試目錄搜尋測試構件/依附元件檔案。
|
static
File
|
searchFile(String fileName, boolean targetFirst, IAbi abi, altDirs, AltDirBehavior altDirBehavior, TestInformation testInfo, IBuildInfo buildInfo, boolean includeDirectory)
從測試目錄搜尋測試構件/依附元件檔案。
|
欄位
公用建構函式
SearchArtifactUtil
public SearchArtifactUtil ()
公用方法
findModuleDir
public static File findModuleDir (String moduleName,
boolean targetFirst)
找出與指定模組名稱相符的模組目錄
| 參數 |
moduleName |
String:模組名稱。 |
targetFirst |
boolean:我們是否偏好目標端或主機端的搜尋。 |
getModuleDirFromConfig
public static File getModuleDirFromConfig (IInvocationContext moduleContext)
| 參數 |
moduleContext |
IInvocationContext |
getModuleDirFromConfig
public static File getModuleDirFromConfig ()
在模組範圍內呼叫時,會傳回模組目錄 (如有)。
getModuleDirFromConfig
public static File getModuleDirFromConfig (ConfigurationDescriptor descriptor)
| 參數 |
descriptor |
ConfigurationDescriptor |
searchFile
public static File searchFile (String fileName,
boolean targetFirst)
從測試目錄搜尋測試構件/依附元件檔案。
| 參數 |
fileName |
String:要尋找的檔案名稱。 |
targetFirst |
boolean:我們是否偏好目標端檔案,而非主機端檔案。 |
| 傳回 |
File |
找到的構件檔案,如果沒有則為空值。 |
searchFile
public static File searchFile (String fileName,
boolean targetFirst,
IAbi abi)
從測試目錄搜尋測試構件/依附元件檔案。
| 參數 |
fileName |
String:要尋找的檔案名稱。 |
targetFirst |
boolean:我們是否偏好目標端檔案,而非主機端檔案。 |
abi |
IAbi:要比對檔案的 IAbi。 |
| 傳回 |
File |
找到的構件檔案,如果沒有則為空值。 |
public static File searchFile (String fileName,
boolean targetFirst,
TestInformation testInfo)
從測試目錄搜尋測試構件/依附元件檔案。
| 參數 |
fileName |
String:要尋找的檔案名稱。 |
targetFirst |
boolean:我們是否偏好目標端檔案,而非主機端檔案。 |
testInfo |
TestInformation:目前測試的 TestInformation (如有)。 |
| 傳回 |
File |
找到的構件檔案,如果沒有則為空值。 |
public static File searchFile (String fileName,
boolean targetFirst,
IAbi abi,
altDirs,
AltDirBehavior altDirBehavior,
TestInformation testInfo,
boolean includeDirectory)
從測試目錄搜尋測試構件/依附元件檔案。
| 參數 |
fileName |
String:要尋找的檔案名稱。 |
targetFirst |
boolean:我們是否偏好目標端檔案,而非主機端檔案。 |
abi |
IAbi:要比對檔案的 IAbi。 |
altDirs |
:預設搜尋路徑以外的替代搜尋路徑。 |
altDirBehavior |
AltDirBehavior:如何根據預設路徑使用替代搜尋路徑:做為備用路徑或覆寫路徑;如未指定,則會使用備用路徑 |
testInfo |
TestInformation:目前測試的 TestInformation (如有)。 |
includeDirectory |
boolean:是否要在搜尋結果中加入目錄。 |
| 傳回 |
File |
找到的構件檔案,如果沒有則為空值。 |
public static File searchFile (String fileName,
boolean targetFirst,
IAbi abi,
altDirs,
AltDirBehavior altDirBehavior,
TestInformation testInfo)
從測試目錄搜尋測試構件/依附元件檔案。
| 參數 |
fileName |
String:要尋找的檔案名稱。 |
targetFirst |
boolean:我們是否偏好目標端檔案,而非主機端檔案。 |
abi |
IAbi:要比對檔案的 IAbi。 |
altDirs |
:預設搜尋路徑以外的替代搜尋路徑。 |
altDirBehavior |
AltDirBehavior:如何根據預設路徑使用替代搜尋路徑:做為備用路徑或覆寫路徑;如未指定,則會使用備用路徑 |
testInfo |
TestInformation:目前測試的 TestInformation (如有)。 |
| 傳回 |
File |
找到的構件檔案,如果沒有則為空值。 |
searchFile
public static File searchFile (String fileName,
boolean targetFirst,
altDirs,
AltDirBehavior altDirBehavior)
從測試目錄搜尋測試構件/依附元件檔案。
| 參數 |
fileName |
String:要尋找的檔案名稱。 |
targetFirst |
boolean:我們是否偏好目標端檔案,而非主機端檔案。 |
altDirs |
:預設搜尋路徑以外的替代搜尋路徑。 |
altDirBehavior |
AltDirBehavior:如何根據預設路徑使用替代搜尋路徑:做為備用路徑或覆寫路徑;如未指定,則會使用備用路徑 |
| 傳回 |
File |
找到的構件檔案,如果沒有則為空值。 |
public static File searchFile (String fileName,
boolean targetFirst,
IAbi abi,
altDirs,
AltDirBehavior altDirBehavior,
TestInformation testInfo,
IBuildInfo buildInfo,
boolean includeDirectory)
從測試目錄搜尋測試構件/依附元件檔案。
| 參數 |
fileName |
String:要尋找的檔案名稱。 |
targetFirst |
boolean:我們是否偏好目標端檔案,而非主機端檔案。 |
abi |
IAbi:要比對檔案的 IAbi。 |
altDirs |
:預設搜尋路徑以外的替代搜尋路徑。 |
altDirBehavior |
AltDirBehavior:如何根據預設路徑使用替代搜尋路徑:做為備用路徑或覆寫路徑;如未指定,則會使用備用路徑 |
testInfo |
TestInformation:目前測試的 TestInformation (如有)。 |
buildInfo |
IBuildInfo:目前測試的 IBuildInfo (如有)。 |
includeDirectory |
boolean:是否要在搜尋結果中加入目錄。 |
| 傳回 |
File |
找到的構件檔案,如果沒有則為空值。 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-12-04 (世界標準時間)。
[[["容易理解","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-12-04 (世界標準時間)。"],[],[]]