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


Java AndroidManifest.setPackageName方法代码示例

本文整理汇总了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;
 }
 
开发者ID:benwilcock,项目名称:android-alltest-gradle-sample,代码行数:18,代码来源:RobolectricGradleTestRunner.java

示例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>&lt;application/&gt;</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;
}
 
开发者ID:mapzen,项目名称:open,代码行数:15,代码来源:MapzenTestRunner.java

示例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);
}
 
开发者ID:mapzen,项目名称:open,代码行数:16,代码来源:MapzenTestRunner.java


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