List of usage examples for org.eclipse.jdt.core IJavaProject getOptions
Map<String, String> getOptions(boolean inheritJavaCoreOptions);
From source file:com.google.gdt.eclipse.designer.builders.GwtBuilder.java
License:Open Source License
/** * Generates Async type for given <code>RemoteService</code>. *///from w w w . jav a2 s .c om private void generateAsync(IPackageFragment servicePackage, ICompilationUnit serviceUnit) throws Exception { IJavaProject javaProject = serviceUnit.getJavaProject(); // parse service unit CompilationUnit serviceRoot = Utils.parseUnit(serviceUnit); // prepare AST and start modifications recording AST ast = serviceRoot.getAST(); serviceRoot.recordModifications(); // modify imports (-com.google.gwt.*, -*Exception, +AsyncCallback) { List<ImportDeclaration> imports = DomGenerics.imports(serviceRoot); // remove useless imports for (Iterator<ImportDeclaration> I = imports.iterator(); I.hasNext();) { ImportDeclaration importDeclaration = I.next(); String importName = importDeclaration.getName().getFullyQualifiedName(); if (importName.startsWith("com.google.gwt.user.client.rpc.") || importName.equals("com.google.gwt.core.client.GWT") || importName.endsWith("Exception")) { I.remove(); } } } // add Async to the name TypeDeclaration serviceType = (TypeDeclaration) serviceRoot.types().get(0); String remoteServiceAsyncName = serviceType.getName().getIdentifier() + "Async"; serviceType.setName(serviceRoot.getAST().newSimpleName(remoteServiceAsyncName)); // update interfaces updateInterfacesOfAsync(javaProject, serviceRoot, serviceType); // change methods, fields and inner classes { List<BodyDeclaration> bodyDeclarations = DomGenerics.bodyDeclarations(serviceType); for (Iterator<BodyDeclaration> I = bodyDeclarations.iterator(); I.hasNext();) { BodyDeclaration bodyDeclaration = I.next(); if (bodyDeclaration instanceof MethodDeclaration) { MethodDeclaration methodDeclaration = (MethodDeclaration) bodyDeclaration; // make return type void Type returnType; { returnType = methodDeclaration.getReturnType2(); methodDeclaration.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID)); } // process JavaDoc { Javadoc javadoc = methodDeclaration.getJavadoc(); if (javadoc != null) { List<TagElement> tags = DomGenerics.tags(javadoc); for (Iterator<TagElement> tagIter = tags.iterator(); tagIter.hasNext();) { TagElement tag = tagIter.next(); if ("@gwt.typeArgs".equals(tag.getTagName())) { tagIter.remove(); } else if ("@return".equals(tag.getTagName())) { if (!tag.fragments().isEmpty()) { tag.setTagName("@param callback the callback to return"); } else { tagIter.remove(); } } else if ("@wbp.gwt.Request".equals(tag.getTagName())) { tagIter.remove(); addImport(serviceRoot, "com.google.gwt.http.client.Request"); methodDeclaration.setReturnType2(ast.newSimpleType(ast.newName("Request"))); } } // remove empty JavaDoc if (tags.isEmpty()) { methodDeclaration.setJavadoc(null); } } } // add AsyncCallback parameter { addImport(serviceRoot, "com.google.gwt.user.client.rpc.AsyncCallback"); // prepare "callback" type Type callbackType; { callbackType = ast.newSimpleType(ast.newName("AsyncCallback")); Type objectReturnType = getObjectType(returnType); ParameterizedType parameterizedType = ast.newParameterizedType(callbackType); DomGenerics.typeArguments(parameterizedType).add(objectReturnType); callbackType = parameterizedType; } // prepare "callback" parameter SingleVariableDeclaration asyncCallback = ast.newSingleVariableDeclaration(); asyncCallback.setType(callbackType); asyncCallback.setName(ast.newSimpleName("callback")); // add "callback" parameter DomGenerics.parameters(methodDeclaration).add(asyncCallback); } // remove throws methodDeclaration.thrownExceptions().clear(); } else if (bodyDeclaration instanceof FieldDeclaration || bodyDeclaration instanceof TypeDeclaration) { // remove the fields and inner classes I.remove(); } } } // apply modifications to prepare new source code String newSource; { String source = serviceUnit.getBuffer().getContents(); Document document = new Document(source); // prepare text edits MultiTextEdit edits = (MultiTextEdit) serviceRoot.rewrite(document, javaProject.getOptions(true)); removeAnnotations(serviceType, source, edits); // prepare new source code edits.apply(document); newSource = document.get(); } // update compilation unit { ICompilationUnit unit = servicePackage.createCompilationUnit(remoteServiceAsyncName + ".java", newSource, true, null); unit.getBuffer().save(null, true); } }
From source file:com.google.gwt.eclipse.core.editors.java.GWTSourceViewerConfiguration.java
License:Open Source License
@Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { if (GWTPartitions.JSNI_METHOD.equals(contentType)) { // Get project's formatting settings IJavaProject javaProject = ((GWTJavaEditor) getEditor()).getInputJavaProject(); Map<?, ?> prefs = (javaProject != null ? javaProject.getOptions(true) : JavaCore.getOptions()); return new IAutoEditStrategy[] { new JsniAutoEditStrategy(prefs) }; }//from w ww .java2 s . co m return super.getAutoEditStrategies(sourceViewer, contentType); }
From source file:com.google.gwt.eclipse.core.editors.java.JsniFormattingUtil.java
License:Open Source License
/** * Same as format(IDocument, Map, String[]), except the formatting options * are taken from the given project./* ww w .j a va2s . c o m*/ * */ public static TextEdit format(IDocument document, IJavaProject project, String[] originalJsniMethods) { @SuppressWarnings("unchecked") // safe by IJavaScriptProject.getOptions spec Map<String, String> jsOptions = JavaScriptCore.create(project.getProject()).getOptions(true); @SuppressWarnings("unchecked") // safe by IJavaScriptProject.getOptions spec Map<String, String> jOptions = project.getOptions(true); return format(document, jOptions, jsOptions, originalJsniMethods); }
From source file:com.google.gwt.eclipse.core.editors.java.JsniMethodBodyCompletionProposalComputer.java
License:Open Source License
/** * Returns the indentation units for a given project, document, line and line * offset.//from w ww . jav a2 s . c o m */ static int measureIndentationUnits(IDocument document, int lineOfInvocationOffset, int lineOffset, IJavaProject project) throws BadLocationException { Map<?, ?> options = project.getOptions(true); String lineText = document.get(lineOffset, document.getLineLength(lineOfInvocationOffset)); int indentationUnits = IndentManipulation.measureIndentUnits(lineText, IndentManipulation.getTabWidth(options), IndentManipulation.getIndentWidth(options)); return indentationUnits; }
From source file:com.motorola.studio.android.codeutils.db.utils.DatabaseUtils.java
License:Apache License
/** * Formats the code using the Eclipse Java settings if possible, * otherwise returns original document not indented. * @param destinationFile Destination file. * @param databaseHelperText Text to generate. * @param monitor A progress monitor to be used to show operation status. * @return Created document./* ww w . ja v a 2s . c o m*/ */ @SuppressWarnings({ "rawtypes", "unchecked" }) public static IDocument formatCode(IFile destinationFile, String databaseHelperText, IProgressMonitor monitor) { IDocument document = new Document(); File file = new File(destinationFile.getLocation().toOSString()); try { document.set(databaseHelperText); try { IJavaProject p = JavaCore.create(destinationFile.getProject()); Map mapOptions = p.getOptions(true); TextEdit textEdit = CodeFormatterUtil.format2( CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.F_INCLUDE_COMMENTS, document.get(), 0, System.getProperty("line.separator"), mapOptions); if (textEdit != null) { textEdit.apply(document); } } catch (Exception ex) { //do nothing } BufferedWriter out = new BufferedWriter(new FileWriter(file)); try { out.write(document.get()); out.flush(); } finally { try { out.close(); } catch (IOException e) { /* ignore */ } } // the refresh is needed in order to avoid the user to have to press F5 destinationFile.getParent().refreshLocal(IResource.DEPTH_INFINITE, monitor); } catch (Exception e) { String errMsg = NLS.bind(CodeUtilsNLS.EXC_JavaClass_ErrorFormattingSourceCode, destinationFile.getName()); StudioLogger.error(DatabaseUtils.class, errMsg, e); } return document; }
From source file:com.redhat.ceylon.eclipse.code.preferences.CeylonBuildPathsBlock.java
License:Open Source License
private static void setOptionsFromJavaProject(IJavaProject javaProject, String newProjectCompliance) { @SuppressWarnings("unchecked") Map<String, String> options = javaProject.getOptions(false); JavaModelUtil.setComplianceOptions(options, newProjectCompliance); JavaModelUtil.setDefaultClassfileOptions(options, newProjectCompliance); // complete compliance options javaProject.setOptions(options);/*from www . ja v a 2 s .com*/ }
From source file:com.redhat.ceylon.eclipse.code.wizard.BuildPathsBlock.java
License:Open Source License
/** * Sets the configured build path and output location to the given Java project. * If the project already exists, only build paths are updated. * <p>//from ww w.j a va 2s . c om * If the classpath contains an Execution Environment entry, the EE's compiler compliance options * are used as project-specific options (unless the classpath already contained the same Execution Environment) * * @param classPathEntries the new classpath entries (list of {@link CPListElement}) * @param javaOutputLocation the output location * @param javaProject the Java project * @param newProjectCompliance compliance to set for a new project, can be <code>null</code> * @param monitor a progress monitor, or <code>null</code> * @throws CoreException if flushing failed * @throws OperationCanceledException if flushing has been cancelled */ public static void flush(List<CPListElement> classPathEntries, IPath javaOutputLocation, IJavaProject javaProject, String newProjectCompliance, IProgressMonitor monitor) throws CoreException, OperationCanceledException { if (monitor == null) { monitor = new NullProgressMonitor(); } monitor.setTaskName(NewWizardMessages.BuildPathsBlock_operationdesc_java); monitor.beginTask("", classPathEntries.size() * 4 + 4); //$NON-NLS-1$ try { IProject project = javaProject.getProject(); IPath projPath = project.getFullPath(); IPath oldOutputLocation; try { oldOutputLocation = javaProject.getOutputLocation(); } catch (CoreException e) { oldOutputLocation = projPath.append( PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME)); } if (oldOutputLocation.equals(projPath) && !javaOutputLocation.equals(projPath)) { if (BuildPathsBlock.hasClassfiles(project)) { if (BuildPathsBlock.getRemoveOldBinariesQuery(JavaPlugin.getActiveWorkbenchShell()) .doQuery(false, projPath)) { BuildPathsBlock.removeOldClassfiles(project); } } } else if (!javaOutputLocation.equals(oldOutputLocation)) { IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(oldOutputLocation); if (folder.exists()) { if (folder.members().length == 0) { BuildPathsBlock.removeOldClassfiles(folder); } else { if (BuildPathsBlock.getRemoveOldBinariesQuery(JavaPlugin.getActiveWorkbenchShell()) .doQuery(folder.isDerived(), oldOutputLocation)) { BuildPathsBlock.removeOldClassfiles(folder); } } } } //TODO: more robust clean up the "old" ceylon output location! project.getFolder("modules").delete(true, monitor); monitor.worked(1); IWorkspaceRoot fWorkspaceRoot = JavaPlugin.getWorkspace().getRoot(); //create and set the output path first if (!fWorkspaceRoot.exists(javaOutputLocation)) { CoreUtility.createDerivedFolder(fWorkspaceRoot.getFolder(javaOutputLocation), true, true, new SubProgressMonitor(monitor, 1)); } else { monitor.worked(1); } if (monitor.isCanceled()) { throw new OperationCanceledException(); } int nEntries = classPathEntries.size(); IClasspathEntry[] classpath = new IClasspathEntry[nEntries]; int i = 0; for (Iterator<CPListElement> iter = classPathEntries.iterator(); iter.hasNext();) { CPListElement entry = iter.next(); classpath[i] = entry.getClasspathEntry(); i++; IResource res = entry.getResource(); //1 tick if (res instanceof IFolder && entry.getLinkTarget() == null && !res.exists()) { CoreUtility.createFolder((IFolder) res, true, true, new SubProgressMonitor(monitor, 1)); } else { monitor.worked(1); } //3 ticks if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) { IPath folderOutput = (IPath) entry.getAttribute(CPListElement.OUTPUT); if (folderOutput != null && folderOutput.segmentCount() > 1) { IFolder folder = fWorkspaceRoot.getFolder(folderOutput); CoreUtility.createDerivedFolder(folder, true, true, new SubProgressMonitor(monitor, 1)); } else { monitor.worked(1); } IPath path = entry.getPath(); if (projPath.equals(path)) { monitor.worked(2); continue; } if (projPath.isPrefixOf(path)) { path = path.removeFirstSegments(projPath.segmentCount()); } IFolder folder = project.getFolder(path); IPath orginalPath = entry.getOrginalPath(); if (orginalPath == null) { if (!folder.exists()) { //New source folder needs to be created if (entry.getLinkTarget() == null) { CoreUtility.createFolder(folder, true, true, new SubProgressMonitor(monitor, 2)); } else { folder.createLink(entry.getLinkTarget(), IResource.ALLOW_MISSING_LOCAL, new SubProgressMonitor(monitor, 2)); } } } else { if (projPath.isPrefixOf(orginalPath)) { orginalPath = orginalPath.removeFirstSegments(projPath.segmentCount()); } IFolder orginalFolder = project.getFolder(orginalPath); if (entry.getLinkTarget() == null) { if (!folder.exists()) { //Source folder was edited, move to new location IPath parentPath = entry.getPath().removeLastSegments(1); if (projPath.isPrefixOf(parentPath)) { parentPath = parentPath.removeFirstSegments(projPath.segmentCount()); } if (parentPath.segmentCount() > 0) { IFolder parentFolder = project.getFolder(parentPath); if (!parentFolder.exists()) { CoreUtility.createFolder(parentFolder, true, true, new SubProgressMonitor(monitor, 1)); } else { monitor.worked(1); } } else { monitor.worked(1); } orginalFolder.move(entry.getPath(), true, true, new SubProgressMonitor(monitor, 1)); } } else { if (!folder.exists() || !entry.getLinkTarget().equals(entry.getOrginalLinkTarget())) { orginalFolder.delete(true, new SubProgressMonitor(monitor, 1)); folder.createLink(entry.getLinkTarget(), IResource.ALLOW_MISSING_LOCAL, new SubProgressMonitor(monitor, 1)); } } } } else { if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { IPath path = entry.getPath(); if (!path.equals(entry.getOrginalPath())) { String eeID = JavaRuntime.getExecutionEnvironmentId(path); if (eeID != null) { BuildPathSupport.setEEComplianceOptions(javaProject, eeID, newProjectCompliance); newProjectCompliance = null; // don't set it again below } } if (newProjectCompliance != null) { Map<String, String> options = javaProject.getOptions(false); JavaModelUtil.setComplianceOptions(options, newProjectCompliance); JavaModelUtil.setDefaultClassfileOptions(options, newProjectCompliance); // complete compliance options javaProject.setOptions(options); } } monitor.worked(3); } if (monitor.isCanceled()) { throw new OperationCanceledException(); } } javaProject.setRawClasspath(classpath, javaOutputLocation, new SubProgressMonitor(monitor, 2)); } finally { monitor.done(); } }
From source file:com.sabre.buildergenerator.TestHelper.java
License:Open Source License
/** * @param projectName name of the project * @param sourcePath e.g. "src"//w ww . j av a2s. c om * @param javaVMVersion e.g. JavaCore.VERSION_1_6; null indicates default * @param targetPlatform e.g. JavaCore.VERSION_1_5; must not be null * @throws CoreException error * @throws JavaModelException error */ @SuppressWarnings("unchecked") public static IJavaProject createJavaProject(String projectName, String sourcePath, String javaVMVersion, String targetPlatform) throws CoreException, JavaModelException { // create project IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); project.create(null); project.open(null); // create source folder IPath srcPath = new Path(sourcePath); IFolder srcFolder = project.getFolder(srcPath); srcFolder.create(true, true, null); // class path IClasspathEntry sourceEntry = JavaCore.newSourceEntry(project.getFullPath().append(srcPath)); IClasspathEntry[] jreLibrary = null; if (javaVMVersion != null) { vmType: for (IVMInstallType vmInstallType : JavaRuntime.getVMInstallTypes()) { for (IVMInstall vmInstall : vmInstallType.getVMInstalls()) { if (javaVMVersion.equals(((AbstractVMInstall) vmInstall).getJavaVersion())) { IPath containerPath = new Path(JavaRuntime.JRE_CONTAINER); IPath vmPath = containerPath.append(vmInstall.getVMInstallType().getId()) .append(vmInstall.getName()); jreLibrary = new IClasspathEntry[] { JavaCore.newContainerEntry(vmPath) }; break vmType; } } } } if (jreLibrary == null) { jreLibrary = PreferenceConstants.getDefaultJRELibrary(); } // create java project IJavaProject javaProject = JavaCore.create(project); IProjectDescription description = project.getDescription(); String[] natureIds = description.getNatureIds(); String[] newNatureIds = new String[natureIds.length + 1]; System.arraycopy(natureIds, 0, newNatureIds, 0, natureIds.length); newNatureIds[newNatureIds.length - 1] = JavaCore.NATURE_ID; description.setNatureIds(newNatureIds); project.setDescription(description, null); // create binary folder String binName = PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME); IFolder binFolder = project.getFolder(binName); binFolder.create(IResource.FORCE | IResource.DERIVED, true, null); binFolder.setDerived(true); project.refreshLocal(IResource.DEPTH_INFINITE, null); // set project class path javaProject.setRawClasspath(merge(jreLibrary, new IClasspathEntry[] { sourceEntry }), binFolder.getFullPath(), null); // set options Map<String, String> options = javaProject.getOptions(true); options.put(JavaCore.COMPILER_COMPLIANCE, targetPlatform); options.put(JavaCore.COMPILER_SOURCE, targetPlatform); options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, targetPlatform); options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR); options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR); javaProject.setOptions(options); return javaProject; }
From source file:com.siteview.mde.internal.core.builders.BuildErrorReporter.java
License:Open Source License
/** * Checks that if the project has java compiler settings that build.properties contains a use project settings * entry so that the compiler picks up the settings using the .pref file. * /* w w w. j av a 2 s .co m*/ * @param useJavaProjectSettings a build entry for using the project's compiler warning preferences file */ private void validateJavaCompilerSettings(IBuildEntry useJavaProjectSettings) { // Check if the project has compiler warnings set IJavaProject project = JavaCore.create(fProject); if (project.exists()) { Map options = project.getOptions(false); // If project specific options are turned on, all options will be stored. Only need to check if at least one compiler option is set. Currently using the second option on the property page. if (options.containsKey(JavaCore.COMPILER_PB_INDIRECT_STATIC_ACCESS)) { if (useJavaProjectSettings != null) { boolean entryCorrect = false; String[] tokens = useJavaProjectSettings.getTokens(); if (tokens != null && tokens.length == 1) { if (Boolean.TRUE.toString().equalsIgnoreCase(tokens[0])) { // True is valid if the bundle root is the default (the project) entryCorrect = fProject.equals(PDEProject.getBundleRoot(fProject)); } else { IPath prefFile = null; prefFile = new Path(tokens[0]); if (prefFile.isAbsolute()) { entryCorrect = prefFile.toFile().exists(); } else { IContainer root = PDEProject.getBundleRoot(fProject); entryCorrect = root.getFile(prefFile).exists(); } } } if (!entryCorrect) { String token = null; String message = null; IContainer root = PDEProject.getBundleRoot(fProject); if (fProject.equals(root)) { // Default project root, just use 'true' token = Boolean.TRUE.toString(); message = NLS.bind(MDECoreMessages.BuildErrorReporter_buildEntryMissingValidPath, PROPERTY_PROJECT_SETTINGS); } else { // Non default bundle root, make a relative path IPath prefFile = fProject.getFullPath().append(".settings") //$NON-NLS-1$ .append(JavaCore.PLUGIN_ID + ".prefs"); //$NON-NLS-1$ prefFile = prefFile.makeRelativeTo(root.getFullPath()); token = prefFile.toString(); message = NLS.bind( MDECoreMessages.BuildErrorReporter_buildEntryMissingValidRelativePath, PROPERTY_PROJECT_SETTINGS); } prepareError(PROPERTY_PROJECT_SETTINGS, token, message, MDEMarkerFactory.B_REPLACE, fJavaCompilerSeverity, MDEMarkerFactory.CAT_EE); } } else { String token = null; IContainer root = PDEProject.getBundleRoot(fProject); if (fProject.equals(root)) { // Default project root, just use 'true' token = Boolean.TRUE.toString(); } else { // Non default bundle root, make a relative path IPath prefFile = fProject.getFullPath().append(".settings") //$NON-NLS-1$ .append(JavaCore.PLUGIN_ID + ".prefs"); //$NON-NLS-1$ prefFile = prefFile.makeRelativeTo(root.getFullPath()); token = prefFile.toString(); } String message = NLS.bind( MDECoreMessages.BuildErrorReporter_buildEntryMissingProjectSpecificSettings, PROPERTY_PROJECT_SETTINGS); prepareError(PROPERTY_PROJECT_SETTINGS, token, message, MDEMarkerFactory.B_JAVA_ADDDITION, fJavaCompilerSeverity, MDEMarkerFactory.CAT_EE); } } else if (useJavaProjectSettings != null) { String message = NLS.bind(MDECoreMessages.BuildErrorReporter_buildEntryInvalidWhenNoProjectSettings, PROPERTY_PROJECT_SETTINGS); prepareError(PROPERTY_PROJECT_SETTINGS, null, message, MDEMarkerFactory.B_REMOVAL, fJavaCompilerSeverity, MDEMarkerFactory.CAT_EE); } } }
From source file:com.siteview.mde.internal.core.ClasspathComputer.java
License:Open Source License
/** * Sets compiler compliance options on the given project to match the default compliance settings * for the specified execution environment. Only sets options that do not already have an explicit * setting based on the given override flag. * <p>/*from www . ja v a 2 s .com*/ * If the specified execution environment is <code>null</code> and override is <code>true</code>, * all compliance options are removed from the options map before applying to the project. * </p> * @param project project to set compiler compliance options for * @param eeId execution environment identifier, or <code>null</code> * @param overrideExisting whether to override a setting if already present */ public static void setComplianceOptions(IJavaProject project, String eeId, boolean overrideExisting) { Map projectMap = project.getOptions(false); IExecutionEnvironment ee = null; Map options = null; if (eeId != null) { ee = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(eeId); if (ee != null) { options = ee.getComplianceOptions(); } } if (options == null) { if (overrideExisting && projectMap.size() > 0) { projectMap.remove(JavaCore.COMPILER_COMPLIANCE); projectMap.remove(JavaCore.COMPILER_SOURCE); projectMap.remove(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM); projectMap.remove(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER); projectMap.remove(JavaCore.COMPILER_PB_ENUM_IDENTIFIER); } else { return; } } else { String compliance = (String) options.get(JavaCore.COMPILER_COMPLIANCE); Iterator iterator = options.entrySet().iterator(); while (iterator.hasNext()) { Entry entry = (Entry) iterator.next(); String option = (String) entry.getKey(); String value = (String) entry.getValue(); if (JavaCore.VERSION_1_3.equals(compliance) || JavaCore.VERSION_1_4.equals(compliance)) { if (JavaCore.COMPILER_PB_ASSERT_IDENTIFIER.equals(option) || JavaCore.COMPILER_PB_ENUM_IDENTIFIER.equals(option)) { // for 1.3 & 1.4 projects, only override the existing setting if the default setting // is a greater severity than the existing setting setMinimumCompliance(projectMap, option, value, overrideExisting); } else { setCompliance(projectMap, option, value, overrideExisting); } } else { setCompliance(projectMap, option, value, overrideExisting); } } } project.setOptions(projectMap); }