todos added

This commit is contained in:
Eugene Zhuravlev
2011-11-21 13:49:56 +01:00
parent 681d42a549
commit 737dbe3402
5 changed files with 15 additions and 3 deletions

View File

@@ -103,6 +103,7 @@ public abstract class Builder {
private static boolean chunkContainsAffectedFiles(CompileContext context, ModuleChunk chunk, final Set<File> affected) throws Exception {
final Ref<Boolean> result = new Ref<Boolean>(false);
// todo: avoid calling processFiles to implement this logic
context.processFiles(chunk, new FileProcessor() {
public boolean apply(Module module, File file, String sourceRoot) throws Exception {
if (affected.contains(file)) {

View File

@@ -42,7 +42,10 @@ public class IncProjectBuilder {
public void addMessageHandler(MessageHandler handler) {
myMessageHandlers.add(handler);
}
// todo: pass dirty and removed sources from outside
public void build(CompileScope scope, final boolean isMake) {
final CompileContext context = createContext(scope, isMake);
@@ -223,6 +226,8 @@ public class IncProjectBuilder {
// TODO: check how the output-source storage is filled and!
if (context.isMake()) {
// cleanup outputs
// todo: use dirty and removed paths passed from IDEA instead of collecting all chunk sources
final HashSet<File> allChunkSources = new HashSet<File>();
context.processFiles(chunk, new FilesCollector(allChunkSources, FilesCollector.ALL_FILES));

View File

@@ -20,7 +20,7 @@ import org.jetbrains.jps.incremental.storage.TimestampStorage;
import org.jetbrains.jps.server.ClasspathBootstrap;
import org.objectweb.asm.ClassReader;
import java.io.*;
import java.io.File;
import java.util.*;
/**
@@ -46,6 +46,7 @@ public class GroovyBuilder extends Builder {
final List<File> toCompile = new ArrayList<File>();
try {
final TimestampStorage tsStorage = context.getBuildDataManager().getTimestampStorage(getName());
// todo: use dirty files passed from outside
context.processFiles(chunk, new FileProcessor() {
@Override
public boolean apply(Module module, File file, String sourceRoot) throws Exception {

View File

@@ -118,10 +118,11 @@ public class JavaBuilder extends Builder{
final Set<File> filesToCompile = new LinkedHashSet<File>();
final List<File> formsToCompile = new ArrayList<File>();
final List<File> upToDateForms = new ArrayList<File>();
// todo: read srcRoots from JPS model
final Set<String> srcRoots = new HashSet<String>();
final boolean wholeModuleRebuildRequired = context.isDirty(chunk);
// todo: only process all sources if wholeModuleRebuild == true
context.processFiles(chunk, new FileProcessor() {
public boolean apply(Module module, File file, String sourceRoot) throws Exception {
if (JAVA_SOURCES_FILTER.accept(file)) {
@@ -142,6 +143,8 @@ public class JavaBuilder extends Builder{
}
});
// todo: change logic below so that complete forms list is not required
// force compilation of bound source file if the form is dirty
for (File form : formsToCompile) {
for (String root : srcRoots) {

View File

@@ -50,6 +50,8 @@ public class ResourcesBuilder extends Builder{
final TimestampStorage tsStorage = context.getBuildDataManager().getTimestampStorage(BUILDER_NAME);
final OutputToSourceMapping outputToSourceMapping = context.getBuildDataManager().getOutputToSourceStorage();
final ResourcePatterns finalPatterns = patterns;
// todo: process all files in case of rebuild or wholeModuleDirty
// todo: otherwise avoid traverwing the whole module and use dirty file list taken from params
context.processFiles(chunk, new FileProcessor() {
public boolean apply(final Module module, final File file, final String sourceRoot) throws Exception {
if (finalPatterns.isResourceFile(file, sourceRoot)) {