public ComponentDescriptor analyze(ASTType astType) { Application applicationAnnotation = astType.getAnnotation(Application.class); PackageClass inputType = astType.getPackageClass(); PackageClass applicationClassName; if (StringUtils.isBlank(applicationAnnotation.name())) { applicationClassName = inputType.append("Application"); } else { applicationClassName = inputType.replaceName(applicationAnnotation.name()); } ComponentDescriptor applicationDescriptor = new ComponentDescriptor(android.app.Application.class.getName(), applicationClassName); // analyze delegate AnalysisContext analysisContext = analysisContextFactory.buildAnalysisContext(buildVariableBuilderMap()); // application generation profile setupApplicationProfile(applicationDescriptor, astType, analysisContext); // add manifest elements setupManifest( applicationAnnotation, applicationDescriptor.getPackageClass().getFullyQualifiedName(), applicationAnnotation.label()); return applicationDescriptor; }
private void setupManifest(Application annotation, String name, String label) { org.androidtransfuse.model.manifest.Application manifestApplication = buildManifest(name); manifestApplication.setLabel(checkBlank(label)); manifestApplication.setAllowTaskReparenting( checkDefault(annotation.allowTaskReparenting(), false)); manifestApplication.setBackupAgent(checkBlank(annotation.backupAgent())); manifestApplication.setDebuggable(checkDefault(annotation.debuggable(), false)); manifestApplication.setDescription(checkBlank(annotation.description())); manifestApplication.setEnabled(checkDefault(annotation.enabled(), true)); manifestApplication.setHasCode(checkDefault(annotation.hasCode(), true)); manifestApplication.setHardwareAccelerated( checkDefault(annotation.hardwareAccelerated(), false)); manifestApplication.setIcon(checkBlank(annotation.icon())); manifestApplication.setKillAfterRestore(checkDefault(annotation.killAfterRestore(), true)); manifestApplication.setLogo(checkBlank(annotation.logo())); manifestApplication.setManageSpaceActivity(checkBlank(annotation.manageSpaceActivity())); manifestApplication.setPermission(checkBlank(annotation.permission())); manifestApplication.setPersistent(checkDefault(annotation.persistent(), false)); manifestApplication.setProcess(checkBlank(annotation.process())); manifestApplication.setRestoreAnyVersion(checkDefault(annotation.restoreAnyVersion(), false)); manifestApplication.setTaskAffinity(checkBlank(annotation.taskAffinity())); manifestApplication.setTheme(checkBlank(annotation.theme())); manifestApplication.setUiOptions(checkDefault(annotation.uiOptions(), UIOptions.NONE)); manifestManager.setApplication(manifestApplication); }