protected SourceFile findSourceFile(IFile file, boolean mustExist) { if (mustExist && !file.exists()) return null; ClasspathMultiDirectory md = null; if (this.sourceLocations.length > 0) { IPath sourceFileFullPath = file.getFullPath(); for (int j = 0, m = this.sourceLocations.length; j < m; j++) { if (this.sourceLocations[j].sourceFolder.getFullPath().isPrefixOf(sourceFileFullPath)) { md = this.sourceLocations[j]; if (md.exclusionPatterns == null && md.inclusionPatterns == null) break; if (!Util.isExcluded(file, md.inclusionPatterns, md.exclusionPatterns)) break; } } } return md == null ? null: new SourceFile(file, md); }
protected SourceFile findSourceFile(IFile file, boolean mustExist) { if (mustExist && !file.exists()) return null; // assumes the file exists in at least one of the source folders & is not excluded ClasspathMultiDirectory md = this.sourceLocations[0]; if (this.sourceLocations.length > 1) { IPath sourceFileFullPath = file.getFullPath(); for (int j = 0, m = this.sourceLocations.length; j < m; j++) { if (this.sourceLocations[j].sourceFolder.getFullPath().isPrefixOf(sourceFileFullPath)) { md = this.sourceLocations[j]; if (md.exclusionPatterns == null && md.inclusionPatterns == null) break; if (!Util.isExcluded(file, md.inclusionPatterns, md.exclusionPatterns)) break; } } } return new SourceFile(file, md); }
protected SourceFile findSourceFile(IFile file, boolean mustExist) { if (mustExist && !file.exists()) return null; // assumes the file exists in at least one of the source folders & is not excluded ClasspathMultiDirectory md = this.sourceLocations[0]; if (this.sourceLocations.length > 1) { IPath sourceFileFullPath = file.getFullPath(); for (int j = 0, m = this.sourceLocations.length; j < m; j++) { if (this.sourceLocations[j].sourceFolder.getFullPath().isPrefixOf(sourceFileFullPath)) { md = this.sourceLocations[j]; if (md.exclusionPatterns == null && md.inclusionPatterns == null) break; if (!Util.isExcluded(file, md.inclusionPatterns, md.exclusionPatterns)) break; } } } return new SourceFile(file, md); }
protected SourceFile findSourceFile(IFile file, boolean mustExist) { if (mustExist && !file.exists()) return null; // assumes the file exists in at least one of the source folders & is not excluded ClasspathMultiDirectory md = this.sourceLocations[0]; if (this.sourceLocations.length > 1) { IPath sourceFileFullPath = file.getFullPath(); for (int j = 0, m = this.sourceLocations.length; j < m; j++) { if (this.sourceLocations[j].sourceFolder.getFullPath().isPrefixOf(sourceFileFullPath)) { md = this.sourceLocations[j]; if (md.exclusionPatterns == null && md.inclusionPatterns == null) break; if (!Util.isExcluded(file, md.inclusionPatterns, md.exclusionPatterns)) break; } } } return new SourceFile(file, md); }
protected SourceFile findSourceFile(IFile file, boolean mustExist) { if (mustExist && !file.exists()) return null; // assumes the file exists in at least one of the source folders & is not excluded ClasspathMultiDirectory md = this.sourceLocations[0]; if (this.sourceLocations.length > 1) { IPath sourceFileFullPath = file.getFullPath(); for (int j = 0, m = this.sourceLocations.length; j < m; j++) { if (this.sourceLocations[j].sourceFolder.getFullPath().isPrefixOf(sourceFileFullPath)) { md = this.sourceLocations[j]; if (md.exclusionPatterns == null && md.inclusionPatterns == null) break; if (!Util.isExcluded(file, md.inclusionPatterns, md.exclusionPatterns)) break; } } } return new SourceFile(file, md); }
protected SourceFile findSourceFile(IFile file, boolean mustExist) { if (mustExist && !file.exists()) return null; // assumes the file exists in at least one of the source folders & is not excluded ClasspathMultiDirectory md = this.sourceLocations[0]; if (this.sourceLocations.length > 1) { IPath sourceFileFullPath = file.getFullPath(); for (int j = 0, m = this.sourceLocations.length; j < m; j++) { if (this.sourceLocations[j].sourceFolder.getFullPath().isPrefixOf(sourceFileFullPath)) { md = this.sourceLocations[j]; if (md.exclusionPatterns == null && md.inclusionPatterns == null) break; if (!Util.isExcluded(file, md.inclusionPatterns, md.exclusionPatterns)) break; } } } return new SourceFile(file, md); }
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; SourceFile unit = new SourceFile((IFile) resource, sourceLocation); sourceFiles.add(unit);
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; SourceFile unit = new SourceFile((IFile) resource, sourceLocation); sourceFiles.add(unit);
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));
public byte[] compileWithAttributes(IModuleDescription module, Map<String,String> classFileAttributes) throws JavaModelException { IJavaProject javaProject = module.getJavaProject(); NameEnvironment nameEnvironment = new NameEnvironment(javaProject); addModuleUpdates(module, nameEnvironment.moduleUpdater, classFileAttributes); ClasspathMultiDirectory sourceLocation = getSourceLocation(javaProject, nameEnvironment, module); IFile file = (IFile) module.getCompilationUnit().getCorrespondingResource(); ICompilationUnit[] sourceUnits = { new SourceFile(file, sourceLocation) }; BytecodeCollector collector = new BytecodeCollector(); Compiler newCompiler = new Compiler( nameEnvironment, DefaultErrorHandlingPolicies.exitOnFirstError(), new CompilerOptions(javaProject.getOptions(true)), collector, ProblemFactory.getProblemFactory(Locale.getDefault())); newCompiler.compile(sourceUnits); return collector.bytes; }
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));
public byte[] compileWithAttributes(IModuleDescription module, Map<String,String> classFileAttributes) throws JavaModelException { IJavaProject javaProject = module.getJavaProject(); NameEnvironment nameEnvironment = new NameEnvironment(javaProject, CompilationGroup.MAIN); addModuleUpdates(module, nameEnvironment.moduleUpdater, classFileAttributes); ClasspathMultiDirectory sourceLocation = getSourceLocation(javaProject, nameEnvironment, module); IFile file = (IFile) module.getCompilationUnit().getCorrespondingResource(); ICompilationUnit[] sourceUnits = { new SourceFile(file, sourceLocation) }; BytecodeCollector collector = new BytecodeCollector(); Compiler newCompiler = new Compiler( nameEnvironment, DefaultErrorHandlingPolicies.exitOnFirstError(), new CompilerOptions(javaProject.getOptions(true)), collector, ProblemFactory.getProblemFactory(Locale.getDefault())); newCompiler.compile(sourceUnits); return collector.bytes; }
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; SourceFile unit = new SourceFile((IFile) resource, sourceLocation); sourceFiles.add(unit);
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; SourceFile unit = new SourceFile((IFile) resource, sourceLocation); sourceFiles.add(unit);
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));
if (Util.isExcluded(resource.getFullPath(), inclusionPatterns, exclusionPatterns, false)) return false; sourceFiles.add(new SourceFile((IFile) resource, sourceLocation));