Search in sources :

Example 1 with CloudGitDeploymentDetector

use of com.intellij.remoteServer.util.CloudGitDeploymentDetector in project intellij-community by JetBrains.

the class CloudGitProjectStructureDetector method detectApplicationRoot.

private static void detectApplicationRoot(@NotNull File dir, @NotNull List<DetectedProjectRoot> result) {
    VirtualFile repositoryRoot = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(dir);
    if (repositoryRoot == null) {
        return;
    }
    if (GitUtil.findGitDir(repositoryRoot) == null) {
        return;
    }
    Project project = ProjectManager.getInstance().getDefaultProject();
    GitRepository repository = GitRepositoryImpl.getInstance(repositoryRoot, project, false);
    for (CloudGitDeploymentDetector deploymentDetector : CloudGitDeploymentDetector.EP_NAME.getExtensions()) {
        String applicationName = deploymentDetector.getFirstApplicationName(repository);
        if (applicationName != null) {
            result.add(new CloudGitProjectRoot(deploymentDetector, dir, repositoryRoot, applicationName));
        }
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Project(com.intellij.openapi.project.Project) GitRepository(git4idea.repo.GitRepository) CloudGitDeploymentDetector(com.intellij.remoteServer.util.CloudGitDeploymentDetector)

Aggregations

Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 CloudGitDeploymentDetector (com.intellij.remoteServer.util.CloudGitDeploymentDetector)1 GitRepository (git4idea.repo.GitRepository)1