methods used only in tests removed

This commit is contained in:
nik
2012-08-30 17:53:56 +04:00
parent d6bb8a041a
commit ba0635b041
2 changed files with 15 additions and 34 deletions
@@ -2,7 +2,6 @@ package org.jetbrains.jps;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Conditions;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.Consumer;
import org.jetbrains.annotations.NotNull;
@@ -35,10 +34,6 @@ public class ProjectPaths {
myProject = project;
}
public Collection<File> getCompilationClasspathFiles(ModuleChunk chunk, boolean includeTests) {
return getCompilationClasspathFiles(chunk, includeTests, true, true);
}
public Collection<File> getCompilationClasspathFiles(ModuleChunk chunk,
boolean includeTests,
final boolean excludeMainModuleOutput,
@@ -94,14 +89,6 @@ public class ProjectPaths {
}
}
public static List<String> getPathsList(Collection<File> files) {
final List<String> result = new ArrayList<String>();
for (File file : files) {
result.add(getCanonicalPath(file));
}
return result;
}
/**
*
* @param chunk
@@ -190,12 +177,6 @@ public class ProjectPaths {
return new File(parentFile, outputDir.getName() + "_" + DEFAULT_GENERATED_DIR_NAME);
}
public List<String> getProjectRuntimeClasspath(boolean includeTests) {
final JpsJavaClasspathKind kind = JpsJavaClasspathKind.runtime(includeTests);
Set<File> classpath = new LinkedHashSet<File>(JpsJavaExtensionService.dependencies(myProject).includedIn(kind).withoutDepModules().classes().getRoots());
return getPathsList(classpath);
}
private enum ClasspathPart {WHOLE, BEFORE_JDK, AFTER_JDK}
private static class BeforeSdkItemFilter implements Condition<JpsDependencyElement> {
@@ -215,9 +196,4 @@ public class ProjectPaths {
}
}
private static String getCanonicalPath(File file) {
final String path = file.getPath();
return path.contains(".")? FileUtil.toCanonicalPath(path) : FileUtil.toSystemIndependentName(path);
}
}
@@ -42,16 +42,9 @@ public class ModuleClasspathTest extends JpsRebuildTestCase {
public void testCompilationClasspath() {
ModuleChunk chunk = createChunk('main')
assertClasspath(["util/lib/exported.jar", "out/production/util", "/jdk.jar"],
ProjectPaths.getPathsList(getProjectPaths().getPlatformCompilationClasspath(chunk, true)))
getPathsList(getProjectPaths().getPlatformCompilationClasspath(chunk, true)))
assertClasspath(["main/lib/service.jar"],
ProjectPaths.getPathsList(getProjectPaths().getCompilationClasspath(chunk, true)))
}
public void testProjectClasspath() {
assertClasspath(["out/production/main", "/jdk.jar", "main/lib/service.jar",
"test-util/lib/runtime.jar", "out/production/test-util",
"util/lib/exported.jar", "/jdk15.jar", "out/production/util"],
getProjectPaths().getProjectRuntimeClasspath(false))
getPathsList(getProjectPaths().getCompilationClasspath(chunk, true)))
}
private ProjectPaths getProjectPaths() {
@@ -60,7 +53,7 @@ public class ModuleClasspathTest extends JpsRebuildTestCase {
private def assertClasspath(String moduleName, boolean includeTests, List<String> expected) {
ModuleChunk chunk = createChunk(moduleName)
final List<String> classpath = ProjectPaths.getPathsList(new ProjectPaths(myJpsProject).getCompilationClasspathFiles(chunk, includeTests))
final List<String> classpath = getPathsList(new ProjectPaths(myJpsProject).getCompilationClasspathFiles(chunk, includeTests, true, true))
assertClasspath(expected, toSystemIndependentPaths(classpath))
}
@@ -84,4 +77,16 @@ public class ModuleClasspathTest extends JpsRebuildTestCase {
}
return result
}
public static List<String> getPathsList(Collection<File> files) {
final List<String> result = new ArrayList<String>();
for (File file : files) {
result.add(getCanonicalPath(file));
}
return result;
}
private static String getCanonicalPath(File file) {
final String path = file.getPath();
return path.contains(".")? FileUtil.toCanonicalPath(path) : FileUtil.toSystemIndependentName(path);
}
}