private SonarLintProject getSonarProject() {
   IProject project = getProject();
   if (project != null) {
     return SonarLintProject.getInstance(project);
   }
   return null;
 }
 @Override
 public boolean performOk() {
   List<String> keyValuePairs = new ArrayList<String>(sonarProperties.size());
   for (SonarLintProperty prop : sonarProperties) {
     keyValuePairs.add(prop.getName() + "=" + prop.getValue());
   }
   String props = StringUtils.join(keyValuePairs, "\r\n");
   if (isGlobal()) {
     getPreferenceStore().setValue(PreferencesUtils.PREF_EXTRA_ARGS, props);
   } else {
     SonarLintProject sonarProject = getSonarProject();
     sonarProject.setExtraProperties(sonarProperties);
     sonarProject.save();
   }
   return true;
 }
コード例 #3
0
 public AnalyzeProjectJob(AnalyzeProjectRequest request) {
   super(jobTitle(request), SonarLintProject.getInstance(request.getProject()));
   this.request = request;
   this.extraProps = PreferencesUtils.getExtraPropertiesForLocalAnalysis(request.getProject());
 }
 @BeforeClass
 public static void importProject() throws Exception {
   project = importEclipseProject("SimpleProject");
   // Configure the project
   SonarLintProject.getInstance(project);
 }