@NotNull
 public static String baseTestDiscoveryPathForProject(Project project) {
   return PathManager.getSystemPath()
       + File.separator
       + "testDiscovery"
       + File.separator
       + project.getName()
       + "."
       + project.getLocationHash();
 }
  private static File dumpModulesPaths(@NotNull Project project) throws IOException {
    ApplicationManager.getApplication().assertReadAccessAllowed();

    Properties res = new Properties();

    MavenProjectsManager manager = MavenProjectsManager.getInstance(project);

    for (Module module : ModuleManager.getInstance(project).getModules()) {
      if (manager.isMavenizedModule(module)) {
        MavenProject mavenProject = manager.findProject(module);
        if (mavenProject != null && !manager.isIgnored(mavenProject)) {
          res.setProperty(
              mavenProject.getMavenId().getGroupId()
                  + ':'
                  + mavenProject.getMavenId().getArtifactId()
                  + ":pom"
                  + ':'
                  + mavenProject.getMavenId().getVersion(),
              mavenProject.getFile().getPath());

          res.setProperty(
              mavenProject.getMavenId().getGroupId()
                  + ':'
                  + mavenProject.getMavenId().getArtifactId()
                  + ':'
                  + mavenProject.getPackaging()
                  + ':'
                  + mavenProject.getMavenId().getVersion(),
              mavenProject.getOutputDirectory());
        }
      }
    }

    File file =
        new File(
            PathManager.getSystemPath(),
            "Maven/idea-projects-state-" + project.getLocationHash() + ".properties");
    file.getParentFile().mkdirs();

    OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
    try {
      res.store(out, null);
    } finally {
      out.close();
    }

    return file;
  }
Esempio n. 3
0
 private String newSessionId() {
   return myProject.getLocationHash() + Long.toHexString(System.currentTimeMillis());
 }
Esempio n. 4
0
 @NotNull
 private static String calcLogId(
     @NotNull Project project, @NotNull final Map<VirtualFile, VcsLogProvider> logProviders) {
   int hashcode = calcLogProvidersHash(logProviders);
   return project.getLocationHash() + "." + Integer.toHexString(hashcode);
 }
Esempio n. 5
0
 /**
  * @param project
  * @return a directory under IDEA "system" directory where all files related to compiler subsystem
  *     are stored (such as compiler caches or generated files)
  */
 public static File getCompilerSystemDirectory(Project project) {
   //noinspection HardCodedStringLiteral
   String projectName = getPresentableName(project);
   return new File(getCompilerSystemDirectory(), projectName + "." + project.getLocationHash());
 }