コード例 #1
0
 /** Returns the min SDK version to use */
 int getMinSdk() {
   if (project == null) {
     return -1;
   }
   ManifestInfo manifest = ManifestInfo.get(project);
   return manifest.getMinSdkVersion();
 }
コード例 #2
0
  /** Computes the changes this wizard will make */
  @NonNull
  List<Change> computeChanges() {
    if (project == null) {
      return Collections.emptyList();
    }

    ManifestInfo manifest = ManifestInfo.get(project);
    parameters.put(ATTR_PACKAGE_NAME, manifest.getPackage());
    parameters.put(ATTR_MIN_API, manifest.getMinSdkVersion());
    parameters.put(ATTR_MIN_API_LEVEL, manifest.getMinSdkName());
    parameters.put(ATTR_TARGET_API, manifest.getTargetSdkVersion());
    IAndroidTarget target = Sdk.getCurrent().getTarget(project);
    int buildApi;
    if (target != null) {
      buildApi = target.getVersion().getApiLevel();
    } else {
      buildApi = manifest.getTargetSdkVersion();
    }
    parameters.put(NewProjectWizard.ATTR_BUILD_API, buildApi);

    return getTemplateHandler().render(project, parameters);
  }