AntBuildTarget (final AntConfiguration antConfiguration) { String fileUrl = getFileUrl(); String targetName = getTargetName(); if (fileUrl == null || targetName == null) return null; for (AntBuildFile buildFile : antConfiguration.getBuildFileList()) { final VirtualFile file = buildFile.getVirtualFile(); if (file != null && file.getUrl().equals(fileUrl)) { final AntBuildModel buildModel = buildFile.getModel(); return buildModel != null ? buildModel.findTarget(targetName) : null; } } return null; }