@Override protected IApiDescription createLocalApiDescription() throws CoreException { long time = System.currentTimeMillis(); if (Util.isApiProject(getJavaProject())) { setHasApiDescription(true); } IApiDescription apiDesc = ApiDescriptionManager.getManager().getApiDescription(this, getBundleDescription()); if (ApiPlugin.DEBUG_PROJECT_COMPONENT) { System.out.println("Time to create api description for: [" + fProject.getElementName() + "] " + (System.currentTimeMillis() - time) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } return apiDesc; }
/** * Cleans the .api_settings file for the given project * * @param project */ void cleanupApiDescription(IProject project) { if (project != null && project.exists()) { ApiDescriptionManager.getManager().clean(JavaCore.create(project), true, false); } }
public Change perform(IProgressMonitor pm) throws CoreException { SubMonitor localmonitor = SubMonitor.convert(pm); localmonitor.beginTask(IApiToolsConstants.EMPTY_STRING, 1); localmonitor.setTaskName(WizardMessages.ProjectUpdateChange_adding_nature_and_builder); IProjectDescription description = this.fProject.getDescription(); String[] prevNatures = description.getNatureIds(); String[] newNatures = new String[prevNatures.length + 1]; System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); newNatures[prevNatures.length] = ApiPlugin.NATURE_ID; description.setNatureIds(newNatures); this.fProject.setDescription(description, localmonitor); IJavaProject javaProject = JavaCore.create(this.fProject); // make sure we get rid of the previous api description file ApiDescriptionManager.getManager().clean(javaProject, true, true); // we want a full build of the converted project next time a build is triggered if (ResourcesPlugin.getWorkspace().isAutoBuilding()) { Util.getBuildJob(new IProject[] { this.fProject }).schedule(); } else { /* * If autobuild is off, clear the last build state to force a full build of * this project on the next build. */ BuildState.setLastBuiltState(this.fProject, null); } Util.updateMonitor(localmonitor, 1); return null; } }
@Override public Change perform(IProgressMonitor pm) throws CoreException { SubMonitor localmonitor = SubMonitor.convert(pm); localmonitor.beginTask(IApiToolsConstants.EMPTY_STRING, 1); localmonitor.setTaskName(WizardMessages.ProjectUpdateChange_adding_nature_and_builder); IProjectDescription description = this.fProject.getDescription(); String[] prevNatures = description.getNatureIds(); String[] newNatures = new String[prevNatures.length + 1]; System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); newNatures[prevNatures.length] = ApiPlugin.NATURE_ID; description.setNatureIds(newNatures); this.fProject.setDescription(description, localmonitor); IJavaProject javaProject = JavaCore.create(this.fProject); // make sure we get rid of the previous api description file ApiDescriptionManager.getManager().clean(javaProject, true, true); // we want a full build of the converted project next time a build is // triggered if (ResourcesPlugin.getWorkspace().isAutoBuilding()) { Util.getBuildJob(new IProject[] { this.fProject }).schedule(); } else { /* * If autobuild is off, clear the last build state to force a full * build of this project on the next build. */ BuildState.setLastBuiltState(this.fProject, null); } localmonitor.split(1); return null; } }