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


Java AndroidManifest.getAndroidManifestFile方法代码示例

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


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

示例1: getAppManifest

import org.robolectric.manifest.AndroidManifest; //导入方法依赖的package包/类
@Override
protected AndroidManifest getAppManifest(Config config) {
  AndroidManifest appManifest = super.getAppManifest(config);
  FsFile androidManifestFile = appManifest.getAndroidManifestFile();

  if (androidManifestFile.exists()) {
    return appManifest;
  } else {
    androidManifestFile = FileFsFile.from(appManifest.getAndroidManifestFile().getPath()
        .replace("manifests/full", "manifests/aapt"));
    return new AndroidManifest(androidManifestFile, appManifest.getResDirectory(), appManifest.getAssetsDirectory());
  }
}
 
开发者ID:andrewlord1990,项目名称:materialandroid,代码行数:14,代码来源:LibraryRobolectricTestRunner.java

示例2: getAppManifest

import org.robolectric.manifest.AndroidManifest; //导入方法依赖的package包/类
protected AndroidManifest getAppManifest(Config config) {
	AndroidManifest appManifest = super.getAppManifest(config);
	FsFile androidManifestFile = appManifest.getAndroidManifestFile();

	if (androidManifestFile.exists()) {
		return appManifest;
	} else {
		String moduleRoot = getModuleRootPath(config);
		androidManifestFile = FileFsFile.from(moduleRoot, appManifest.getAndroidManifestFile().getPath().replace("bundles", "manifests/full"));
		FsFile resDirectory = FileFsFile.from(moduleRoot, appManifest.getResDirectory().getPath());
		FsFile assetsDirectory = FileFsFile.from(moduleRoot, appManifest.getAssetsDirectory().getPath());
		return new AndroidManifest(androidManifestFile, resDirectory, assetsDirectory);
	}
}
 
开发者ID:Stocard,项目名称:markdown-to-spanned,代码行数:15,代码来源:ManifestedRobolectricGradeTestRunner.java

示例3: getAppManifest

import org.robolectric.manifest.AndroidManifest; //导入方法依赖的package包/类
protected AndroidManifest getAppManifest(Config config) {
    AndroidManifest appManifest = super.getAppManifest(config);
    FsFile androidManifestFile = appManifest.getAndroidManifestFile();

    if (androidManifestFile.exists()) {
        return appManifest;
    } else {
        String moduleRoot = getModuleRootPath(config);
        androidManifestFile = FileFsFile.from(moduleRoot, appManifest.getAndroidManifestFile().getPath().replace("bundles", "manifests/full"));
        FsFile resDirectory = FileFsFile.from(moduleRoot, appManifest.getResDirectory().getPath());
        FsFile assetsDirectory = FileFsFile.from(moduleRoot, appManifest.getAssetsDirectory().getPath());
        return new AndroidManifest(androidManifestFile, resDirectory, assetsDirectory);
    }
}
 
开发者ID:richardradics,项目名称:MVPAndroidBootstrap,代码行数:15,代码来源:AppRobolectricRunner.java

示例4: getAppManifest

import org.robolectric.manifest.AndroidManifest; //导入方法依赖的package包/类
protected AndroidManifest getAppManifest(Config config) {
    AndroidManifest appManifest = super.getAppManifest(config);
    FsFile androidManifestFile = appManifest.getAndroidManifestFile();

    if (androidManifestFile.exists()) {
        return appManifest;
    } else {
        String moduleRoot = getModuleRootPath(config);
        androidManifestFile = FileFsFile.from(moduleRoot, appManifest.getAndroidManifestFile().getPath().replace("bundles", "manifests/full"));
        FsFile resDirectory = FileFsFile.from(moduleRoot, appManifest.getResDirectory().getPath().replace("/res", "").replace("bundles", "res"));
        FsFile assetsDirectory = FileFsFile.from(moduleRoot, appManifest.getAssetsDirectory().getPath().replace("/assets", "").replace("bundles", "assets"));
        return new AndroidManifest(androidManifestFile, resDirectory, assetsDirectory);
    }
}
 
开发者ID:nightscout,项目名称:lasso,代码行数:15,代码来源:CustomRobolectricRunner.java

示例5: getAppManifest

import org.robolectric.manifest.AndroidManifest; //导入方法依赖的package包/类
protected AndroidManifest getAppManifest(Config config) {
    AndroidManifest appManifest = super.getAppManifest(config);
    FsFile androidManifestFile = appManifest.getAndroidManifestFile();

    if (androidManifestFile.exists()) {
        return appManifest;
    } else {
        androidManifestFile = FileFsFile.from(MODULE_ROOT, "src/main/AndroidManifest.xml");
        FsFile resDirectory = FileFsFile.from(MODULE_ROOT, "src/main/res");
        FsFile assetsDirectory = FileFsFile.from(MODULE_ROOT, "src/main/assets");

        return new AndroidManifest(androidManifestFile, resDirectory, assetsDirectory);
    }
}
 
开发者ID:lordi,项目名称:tickmate,代码行数:15,代码来源:TickmateTestRunner.java

示例6: getAppManifest

import org.robolectric.manifest.AndroidManifest; //导入方法依赖的package包/类
protected AndroidManifest getAppManifest(Config config) {
    AndroidManifest appManifest = super.getAppManifest(config);
    FsFile androidManifestFile = appManifest.getAndroidManifestFile();

    if (androidManifestFile.exists()) {
        return appManifest;
    } else {
        String moduleRoot = getModuleRootPath(config);
        androidManifestFile = FileFsFile.from(moduleRoot, appManifest.getAndroidManifestFile().getPath());
        FsFile resDirectory = FileFsFile.from(moduleRoot, appManifest.getAndroidManifestFile().getPath().replace("AndroidManifest.xml", "res"));
        FsFile assetsDirectory = FileFsFile.from(moduleRoot, appManifest.getAndroidManifestFile().getPath().replace("AndroidManifest.xml", "assets"));
        return new AndroidManifest(androidManifestFile, resDirectory, assetsDirectory);
    }
}
 
开发者ID:rysiekblah,项目名称:crom,代码行数:15,代码来源:CustomRobolectricRunner.java

示例7: getAppManifest

import org.robolectric.manifest.AndroidManifest; //导入方法依赖的package包/类
protected AndroidManifest getAppManifest(Config config) {
    AndroidManifest appManifest = super.getAppManifest(config);
    FsFile androidManifestFile = appManifest.getAndroidManifestFile();
    FsFile resDirectory;
    FsFile assetsDirectory;


    String moduleRoot = getModuleRootPath(config);
    androidManifestFile = FileFsFile.from(moduleRoot, appManifest.getAndroidManifestFile().getPath().replace("bundles", "manifests/aapt"));

    if(appManifest.getResDirectory().getPath().contains("release")) {
        resDirectory = FileFsFile.from(moduleRoot, appManifest.getResDirectory().getPath().replace("release", "default"));
        assetsDirectory = FileFsFile.from(moduleRoot, appManifest.getAssetsDirectory().getPath().replace("release", "default"));
    }else{
        resDirectory = FileFsFile.from(moduleRoot, appManifest.getResDirectory().getPath().replace("bundles/debug/res", "res/merged/debug"));
        assetsDirectory = FileFsFile.from(moduleRoot, appManifest.getAssetsDirectory().getPath());
    }


    System.out.print(androidManifestFile.getPath() + '\n');
    System.out.print(resDirectory.getPath() + '\n');
    System.out.print(assetsDirectory.getPath() + '\n');


    return new AndroidManifest(androidManifestFile, resDirectory, assetsDirectory);

}
 
开发者ID:appnexus,项目名称:mobile-sdk-android,代码行数:28,代码来源:RoboelectricTestRunnerWithResources.java

示例8: getAppManifest

import org.robolectric.manifest.AndroidManifest; //导入方法依赖的package包/类
protected AndroidManifest getAppManifest(Config config) {
    AndroidManifest appManifest = super.getAppManifest(config);
    FsFile androidManifestFile = appManifest.getAndroidManifestFile();
    FsFile resDirectory;
    FsFile assetsDirectory;


        String moduleRoot = getModuleRootPath(config);
        androidManifestFile = FileFsFile.from(moduleRoot, appManifest.getAndroidManifestFile().getPath().replace("bundles", "manifests/aapt"));

        if(appManifest.getResDirectory().getPath().contains("release")) {
            resDirectory = FileFsFile.from(moduleRoot, appManifest.getResDirectory().getPath().replace("release", "default"));
            assetsDirectory = FileFsFile.from(moduleRoot, appManifest.getAssetsDirectory().getPath().replace("release", "default"));
        }else{
            resDirectory = FileFsFile.from(moduleRoot, appManifest.getResDirectory().getPath());
            assetsDirectory = FileFsFile.from(moduleRoot, appManifest.getAssetsDirectory().getPath());
        }


        System.out.print(androidManifestFile.getPath() + '\n');
        System.out.print(resDirectory.getPath() + '\n');
        System.out.print(assetsDirectory.getPath() + '\n');


        return new AndroidManifest(androidManifestFile, resDirectory, assetsDirectory);

}
 
开发者ID:appnexus,项目名称:mobile-sdk-android,代码行数:28,代码来源:RoboelectricTestRunnerWithResources.java


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