/** * @param exclusionsFile file holding class hierarchy exclusions. may be null * @throws IllegalStateException if there are problmes reading wala properties */ public static AnalysisScope makePrimordialScopeFromPlugin(File exclusionsFile, @SuppressWarnings("unused") Plugin plugIn) throws IOException { return read(AnalysisScope.createJavaAnalysisScope(), BASIC_FILE, exclusionsFile, EclipseAnalysisScopeReader.class.getClassLoader()); }
/** * read in an analysis scope for a Java application from a text file * @param scopeFileName the text file specifying the scope * @param exclusionsFile a file specifying code to be excluded from the scope; can be {@code null} * @param javaLoader the class loader used to read in files referenced in the scope file, via {@link ClassLoader#getResource(String)} * @return the analysis scope */ public static AnalysisScope readJavaScope(String scopeFileName, File exclusionsFile, ClassLoader javaLoader) throws IOException { AnalysisScope scope = AnalysisScope.createJavaAnalysisScope(); return read(scope, scopeFileName, exclusionsFile, javaLoader); }
/** * read in an analysis scope for a Java application from a text file * @param scopeFileName the text file specifying the scope * @param exclusionsFile a file specifying code to be excluded from the scope; can be {@code null} * @param javaLoader the class loader used to read in files referenced in the scope file, via {@link ClassLoader#getResource(String)} * @return the analysis scope */ public static AnalysisScope readJavaScope(String scopeFileName, File exclusionsFile, ClassLoader javaLoader) throws IOException { AnalysisScope scope = AnalysisScope.createJavaAnalysisScope(); return read(scope, scopeFileName, exclusionsFile, javaLoader); }
public static AnalysisScope readJavaScopeFromPlugin(String scopeFileName, File exclusionsFile, ClassLoader javaLoader, @SuppressWarnings("unused") Plugin plugIn) throws IOException { AnalysisScope scope = AnalysisScope.createJavaAnalysisScope(); return read(scope, scopeFileName, exclusionsFile, javaLoader); }
public AnalysisScope toAnalysisScope() throws IOException { AnalysisScope analysisScope = AnalysisScope.createJavaAnalysisScope(); analysisScope.setExclusions(exclusions); for (String moduleLine : moduleLinesList) { AnalysisScopeReader.processScopeDefLine(analysisScope, this.getClass().getClassLoader(), moduleLine); } for (String ldrLine : ldrImplLinesList) { AnalysisScopeReader.processScopeDefLine(analysisScope, this.getClass().getClassLoader(), ldrLine); } return analysisScope; }
public AnalysisScope toAnalysisScope() throws IOException { AnalysisScope analysisScope = AnalysisScope.createJavaAnalysisScope(); analysisScope.setExclusions(exclusions); for (String moduleLine : moduleLinesList) { AnalysisScopeReader.processScopeDefLine(analysisScope, this.getClass().getClassLoader(), moduleLine); } for (String ldrLine : ldrImplLinesList) { AnalysisScopeReader.processScopeDefLine(analysisScope, this.getClass().getClassLoader(), ldrLine); } return analysisScope; }
private IClassHierarchy createClassHierarchy(File libCodeFile) throws ClassHierarchyException, IOException, ClassNotFoundException { // create analysis scope and generate class hierarchy final AnalysisScope scope = AnalysisScope.createJavaAnalysisScope(); JarFile jf = libCodeFile.getName().endsWith(".aar")? new AarFile(libCodeFile).getJarFile() : new JarFile((libCodeFile)); scope.addToScope(ClassLoaderReference.Application, jf); scope.addToScope(ClassLoaderReference.Primordial, new JarFile(LibScoutConfig.pathToAndroidJar)); IClassHierarchy cha = ClassHierarchyFactory.makeWithRoot(scope); // cleanup tmp files if library input was an .aar file if (libCodeFile.getName().endsWith(".aar")) { File tmpJar = new File(jf.getName()); tmpJar.delete(); logger.trace(Utils.indent() + "tmp jar-file deleted at " + tmpJar.getName()); } return cha; }
final AnalysisScope scope = AnalysisScope.createJavaAnalysisScope();
scope = AnalysisScopeReader.readJavaScope(BASIC_FILE, exclusionsFile, loader); } else { scope = AnalysisScope.createJavaAnalysisScope();
/** * create an analysis scope as the union of a bunch of EclipseProjectPath */ private static AnalysisScope mergeProjectPaths(Collection<EclipseProjectPath<?, ?>> projectPaths) throws IOException { AnalysisScope scope = AnalysisScope.createJavaAnalysisScope(); Collection<Module> seen = HashSetFactory.make(); // to avoid duplicates, we first add all application modules, then // extension // modules, then primordial buildScope(ClassLoaderReference.Application, projectPaths, scope, seen); buildScope(ClassLoaderReference.Extension, projectPaths, scope, seen); buildScope(ClassLoaderReference.Primordial, projectPaths, scope, seen); return scope; }
scope = AnalysisScopeReader.readJavaScope(BASIC_FILE, exclusionsFile, loader); } else { scope = AnalysisScope.createJavaAnalysisScope();