本文整理汇总了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());
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}