@Override public Collection<File> classpath() { return javaClasspath.getElements(); }
@Override public Collection<File> classFilesToAnalyze() { ImmutableList.Builder<File> result = ImmutableList.builder(); for (String key : classKeys()) { String filePath = key + ".class"; for (File binaryDir : javaClasspath.getBinaryDirs()) { File classFile = new File(binaryDir, filePath); if (classFile.isFile()) { result.add(classFile); break; } } } return result.build(); }
Profiler profiler = Profiler.create(LOG).startInfo("JavaClasspath initialization"); initialized = true; binaries = new ArrayList<>(getFilesFromProperty(JavaClasspathProperties.SONAR_JAVA_BINARIES)); Set<File> libraries = getFilesFromProperty(JavaClasspathProperties.SONAR_JAVA_LIBRARIES); if (binaries.isEmpty() && libraries.isEmpty() && useDeprecatedProperties()) { throw new AnalysisException( "sonar.binaries and sonar.libraries are not supported since version 4.0 of sonar-java-plugin, please use sonar.java.binaries and sonar.java.libraries instead"); if (binaries.isEmpty() && hasMoreThanOneJavaFile()) { if(isSonarLint()) { LOG.warn("sonar.java.binaries is empty, please double check your configuration"); } else { if (libraries.isEmpty() && hasJavaSources()) { String warning = "Bytecode of dependencies was not provided for analysis of source files, " + "you might end up with less precise results. Bytecode can be provided using sonar.java.libraries property.";
@Override protected void init() { if (!initialized) { initialized = true; validateLibraries = project.getModules().isEmpty(); binaries = getFilesFromProperty(JavaClasspathProperties.SONAR_JAVA_BINARIES); List<File> libraries = getFilesFromProperty(JavaClasspathProperties.SONAR_JAVA_LIBRARIES); boolean useDeprecatedProperties = binaries.isEmpty() && libraries.isEmpty(); if (useDeprecatedProperties) { binaries = getFilesFromProperty("sonar.binaries"); libraries = getFilesFromProperty("sonar.libraries"); } if (pom != null && libraries.isEmpty()) { //check mojo elements = getLibrariesFromMaven(pom); } else { elements = Lists.newArrayList(binaries); elements.addAll(libraries); if (useDeprecatedProperties && !elements.isEmpty()) { LOG.warn("sonar.binaries and sonar.libraries are deprecated since version 2.5 of sonar-java-plugin, please use sonar.java.binaries and sonar.java.libraries instead"); } } } }
@Override protected void init() { if (!initialized) { TimeProfiler profiler = new TimeProfiler(getClass()).start("JavaClasspath initialization"); initialized = true; validateLibraries = project.getModules().isEmpty(); binaries = getFilesFromProperty(JavaClasspathProperties.SONAR_JAVA_BINARIES); List<File> libraries = getFilesFromProperty(JavaClasspathProperties.SONAR_JAVA_LIBRARIES); boolean useDeprecatedProperties = binaries.isEmpty() && libraries.isEmpty(); if (useDeprecatedProperties) { binaries = getFilesFromProperty("sonar.binaries"); libraries = getFilesFromProperty("sonar.libraries"); } elements = Lists.newArrayList(binaries); if(libraries.isEmpty()) { LOG.warn("Bytecode of dependencies was not provided for analysis of source files, " + "you might end up with less precise results. Bytecode can be provided using sonar.java.libraries property"); } elements.addAll(libraries); if (useDeprecatedProperties && !elements.isEmpty()) { LOG.warn("sonar.binaries and sonar.libraries are deprecated since version 2.5 of sonar-java-plugin, please use sonar.java.binaries and sonar.java.libraries instead"); } profiler.stop(); } }
@Override public Collection<File> classFilesToAnalyze() { ImmutableList.Builder<File> result = ImmutableList.builder(); for (String key : classKeys()) { String filePath = key + ".class"; for (File binaryDir : javaClasspath.getBinaryDirs()) { File classFile = new File(binaryDir, filePath); if (classFile.isFile()) { result.add(classFile); break; } } } return result.build(); }
Profiler profiler = Profiler.create(LOG).startInfo("JavaClasspath initialization"); initialized = true; binaries = new ArrayList<>(getFilesFromProperty(JavaClasspathProperties.SONAR_JAVA_BINARIES)); Set<File> libraries = getFilesFromProperty(JavaClasspathProperties.SONAR_JAVA_LIBRARIES); if (binaries.isEmpty() && libraries.isEmpty() && useDeprecatedProperties()) { throw new AnalysisException( "sonar.binaries and sonar.libraries are not supported since version 4.0 of sonar-java-plugin, please use sonar.java.binaries and sonar.java.libraries instead"); if (binaries.isEmpty() && hasMoreThanOneJavaFile()) { if(isSonarLint()) { LOG.warn("sonar.java.binaries is empty, please double check your configuration"); } else { if (libraries.isEmpty() && hasJavaSources()) { String warning = "Bytecode of dependencies was not provided for analysis of source files, " + "you might end up with less precise results. Bytecode can be provided using sonar.java.libraries property.";
@Override public Collection<File> classFilesToAnalyze() { ImmutableList.Builder<File> result = ImmutableList.builder(); for (String key : classKeys()) { String filePath = key + ".class"; for (File binaryDir : javaClasspath.getBinaryDirs()) { File classFile = new File(binaryDir, filePath); if (classFile.isFile()) { result.add(classFile); break; } } } return result.build(); }
@Override public Collection<File> classpath() { return javaClasspath.getElements(); }
@Override public Collection<File> classFilesToAnalyze() { ImmutableList.Builder<File> result = ImmutableList.builder(); for (String key : classKeys()) { String filePath = key + ".class"; for (File binaryDir : javaClasspath.getBinaryDirs()) { File classFile = new File(binaryDir, filePath); if (classFile.isFile()) { result.add(classFile); break; } } } return result.build(); }
@Override public Collection<File> classpath() { return javaClasspath.getElements(); }
public final void analyse(SensorContext context) { classFilesCache = Maps.newHashMap(); for (File classesDir : javaClasspath.getBinaryDirs()) { populateClassFilesCache(classesDir, ""); } if (classFilesCache.isEmpty()) { JaCoCoExtensions.LOG.info("No JaCoCo analysis of project coverage can be done since there is no class files."); return; } readExecutionData(report, context); classFilesCache = null; }
@Override public Collection<File> classpath() { return javaClasspath.getElements(); }
public final void analyse(Project project, SensorContext context) { classFilesCache = Maps.newHashMap(); for (File classesDir : javaClasspath.getBinaryDirs()) { populateClassFilesCache(classesDir, ""); } if (classFilesCache.isEmpty()) { JaCoCoExtensions.LOG.info("No JaCoCo analysis of project coverage can be done since there is no class files."); return; } String path = getReportPath(project); File jacocoExecutionData = pathResolver.relativeFile(fileSystem.baseDir(), path); try { readExecutionData(jacocoExecutionData, context); } catch (IOException e) { throw new SonarException(e); } classFilesCache = null; }
public List<File> getJavaClasspath() { if (javaClasspath == null) { return Lists.newArrayList(); } return javaClasspath.getElements(); }
public List<File> getJavaClasspath() { if (javaClasspath == null) { return Lists.newArrayList(); } return javaClasspath.getElements(); }
public List<File> getJavaClasspath() { if (javaClasspath == null) { return Lists.newArrayList(); } return javaClasspath.getElements(); }
public List<File> getJavaClasspath() { if (javaClasspath == null) { return Lists.newArrayList(); } return javaClasspath.getElements(); }
private List<File> getBytecodeFiles() { if (settings.getBoolean(CoreProperties.DESIGN_SKIP_DESIGN_PROPERTY)) { return Collections.emptyList(); } return javaClasspath.getElements(); }