void (List<? super AntBuildTargetBase> list, AntBuildModelBase model, AntDomProject project, VirtualFile sourceFile) { if (myProcessed.contains(sourceFile)) { return; } myProcessed.add(sourceFile); if (!myIsImported) { final TargetResolver.Result result = project.getDefaultTarget().getValue(); if (result != null) { final Pair<AntDomTarget,String> targetWithName = result.getResolvedTarget(project.getDefaultTarget().getRawText()); myDefaultTarget = Pair.getFirst(targetWithName); } } for (final AntDomTarget target : project.getDeclaredTargets()) { list.add(new AntBuildTargetImpl(target, model, sourceFile, myIsImported, target.equals(myDefaultTarget))); } myIsImported = true; final Iterable<AntDomIncludingDirective> allIncludes = ContainerUtil.concat(project.getDeclaredImports(), project.getDeclaredIncludes()); for (AntDomIncludingDirective incl : allIncludes) { final PsiFileSystemItem includedFile = incl.getFile().getValue(); if (includedFile instanceof PsiFile) { final PsiFile included = includedFile.getContainingFile().getOriginalFile(); dependencies.add(included); final AntDomProject includedProject = AntSupport.getAntDomProject((PsiFile)includedFile); if (includedProject != null) { fillTargets(list, model, includedProject, included.getVirtualFile()); } } else { if (includedFile == null) { // if not resolved yet, it's possible that the file will be created later, // thus we need to recalculate the cached value dependencies.add(PsiModificationTracker.MODIFICATION_COUNT); } } } }