本文整理汇总了Java中org.robolectric.AndroidManifest.setPackageName方法的典型用法代码示例。如果您正苦于以下问题:Java AndroidManifest.setPackageName方法的具体用法?Java AndroidManifest.setPackageName怎么用?Java AndroidManifest.setPackageName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.robolectric.AndroidManifest
的用法示例。
在下文中一共展示了AndroidManifest.setPackageName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAppManifest
import org.robolectric.AndroidManifest; //导入方法依赖的package包/类
@Override
protected AndroidManifest getAppManifest(Config config) {
String appRoot = "../app/src/main/";
String manifestPath = appRoot + "AndroidManifest.xml";
String resDir = appRoot + "res";
String assetsDir = appRoot + "assets";
AndroidManifest manifest = createAppManifest(Fs.fileFromPath(manifestPath),
Fs.fileFromPath(resDir),
Fs.fileFromPath(assetsDir));
// If you change the package - don't forget to change the build.gradle and the AndroidManifest.xml
manifest.setPackageName("com.soagrowers.android");
// Robolectric is already going to look in the 'app' dir ...
// so no need to add to package name
return manifest;
}
开发者ID:benwilcock,项目名称:android-couchbase-dagger-robolectric,代码行数:19,代码来源:RobolectricGradleTestRunner.java
示例2: getAppManifest
import org.robolectric.AndroidManifest; //导入方法依赖的package包/类
@Override
protected AndroidManifest getAppManifest(Config config) {
//String appRoot = "D:\\TmpCodingProjects\\TripComputer\\app\\src\\main\\";
String appRoot = "../app/src/main/";
String manifestPath = appRoot + "AndroidManifest.xml";
String resDir = appRoot + "res";
String assetsDir = appRoot + "assets";
AndroidManifest manifest = createAppManifest(Fs.fileFromPath(manifestPath),
Fs.fileFromPath(resDir),
Fs.fileFromPath(assetsDir));
// If you change the package - don't forget to change the build.gradle and the AndroidManifest.xml
manifest.setPackageName("com.soagrowers.android");
// Robolectric is already going to look in the 'app' dir ...
// so no need to add to package name
return manifest;
}
示例3: createAppManifest
import org.robolectric.AndroidManifest; //导入方法依赖的package包/类
/**
* Uses custom manifest as workaround to maintain backward compatibility with library projects
* that do not yet include the <code><application/></code> tag in AndroidManifest.xml.
* <p />
* See https://github.com/robolectric/robolectric/pull/1309 for more info.
*/
@Override
protected AndroidManifest createAppManifest(FsFile manifestFile,
FsFile resDir, FsFile assetsDir) {
AndroidManifest manifest = new MapzenAndroidManifest(manifestFile, resDir, assetsDir);
String packageName = System.getProperty("android.package");
manifest.setPackageName(packageName);
return manifest;
}
示例4: getAppManifest
import org.robolectric.AndroidManifest; //导入方法依赖的package包/类
@Override
protected AndroidManifest getAppManifest(Config config) {
String manifestProperty = System.getProperty("android.manifest");
if (config.manifest().equals(Config.DEFAULT) && manifestProperty != null) {
String resProperty = System.getProperty("android.resources");
String assetsProperty = System.getProperty("android.assets");
AndroidManifest androidManifest = new AndroidManifest(
Fs.fileFromPath(manifestProperty),
Fs.fileFromPath(resProperty),
Fs.fileFromPath(assetsProperty));
androidManifest.setPackageName("com.mapzen.open");
return androidManifest;
}
return super.getAppManifest(config);
}