当前位置: 首页>>代码示例>>Java>>正文


Java SdkConstants.FN_ADB属性代码示例

本文整理汇总了Java中com.android.SdkConstants.FN_ADB属性的典型用法代码示例。如果您正苦于以下问题:Java SdkConstants.FN_ADB属性的具体用法?Java SdkConstants.FN_ADB怎么用?Java SdkConstants.FN_ADB使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.android.SdkConstants的用法示例。


在下文中一共展示了SdkConstants.FN_ADB属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AdbWrapper

/**
 * Creates a new lightweight ADB wrapper.
 *
 * @param osSdkPath The root OS path of the SDK. Cannot be null.
 * @param monitor A logger object. Cannot be null.
 */
public AdbWrapper(String osSdkPath, ITaskMonitor monitor) {
    mMonitor = monitor;

    if (!osSdkPath.endsWith(File.separator)) {
        osSdkPath += File.separator;
    }
    mAdbOsLocation = osSdkPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_FOLDER
            + SdkConstants.FN_ADB;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:15,代码来源:AdbWrapper.java

示例2: create

/**
 * Manually create a new package with one archive and the given attributes or properties.
 * This is used to create packages from local directories in which case there must be
 * one archive which URL is the actual target location.
 * <p/>
 * By design, this creates a package with one and only one archive.
 */
public static Package create(
        SdkSource source,
        Properties props,
        int revision,
        String license,
        String description,
        String descUrl,
        String archiveOsPath) {

    PlatformToolPackage ptp = new PlatformToolPackage(source, props, revision, license,
            description, descUrl, archiveOsPath);

    File platformToolsFolder = new File(archiveOsPath);
    String error = null;
    if (!platformToolsFolder.isDirectory()) {
        error = "platform-tools folder is missing";
    } else {
        File[] files = platformToolsFolder.listFiles();
        if (files == null || files.length == 0) {
            error = "platform-tools folder is empty";
        } else {
            Set<String> names = new HashSet<String>();
            for (File file : files) {
                names.add(file.getName());
            }

            // Package-tools revision 17+ matches sdk-repository-8 and above
            // and only requires adb (other tools moved to the build-tool packages.)
            String[] expected = new String[] { SdkConstants.FN_ADB };
            if (ptp.getRevision().getMajor() < 17) {
                // Platform-tools before revision 17 should have adb, aapt, aidl and dx.
                expected = new String[] { SdkConstants.FN_ADB,
                                          SdkConstants.FN_AAPT,
                                          SdkConstants.FN_AIDL,
                                          SdkConstants.FN_DX };
            }

            for (String name : expected) {
                if (!names.contains(name)) {
                    if (error == null) {
                        error = "platform-tools folder is missing ";
                    } else {
                        error += ", ";
                    }
                    error += name;
                }
            }
        }
    }

    if (error != null) {
        String shortDesc = ptp.getShortDescription() + " [*]";  //$NON-NLS-1$

        String longDesc = String.format(
                "Broken Platform-Tools Package: %1$s\n" +
                "[*] Package cannot be used due to error: %2$s",
                description,
                error);

        BrokenPackage ba = new BrokenPackage(props, shortDesc, longDesc,
                IMinApiLevelDependency.MIN_API_LEVEL_NOT_SPECIFIED,
                IExactApiLevelDependency.API_LEVEL_INVALID,
                archiveOsPath,
                PkgDesc.Builder.newPlatformTool(ptp.getRevision())
                               .setDescriptionShort(shortDesc)
                               .create());
        return ba;
    }


    return ptp;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:79,代码来源:PlatformToolPackage.java


注:本文中的com.android.SdkConstants.FN_ADB属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。