IDEA-132257 idea 14 eap cannot compile project which is based on gradle

(cherry picked from commit fbacfb3)
This commit is contained in:
Vladislav.Soroka
2015-01-16 15:08:50 +03:00
parent 9c8c1362a9
commit eec8758a06
2 changed files with 16 additions and 9 deletions
@@ -126,13 +126,16 @@ public class ExternalProjectDataService implements ProjectDataService<ExternalPr
ExternalProject externalProject = myExternalRootProjects.get(Pair.create(systemId, projectRootDir));
if (LOG.isDebugEnabled()) {
LOG.debug("Can not find data for project at: " + projectRootDir);
LOG.debug("Existing imported projects paths: " + ContainerUtil.map(myExternalRootProjects.entrySet(),
new Function<Map.Entry<Pair<ProjectSystemId, File>, ExternalProject>, Object>() {
@Override
public Object fun(Map.Entry<Pair<ProjectSystemId, File>, ExternalProject> entry) {
return Pair.create(entry.getKey(), entry.getValue().getProjectDir());
}
}));
LOG.debug("Existing imported projects paths: " + ContainerUtil.map(
myExternalRootProjects.entrySet(),
new Function<Map.Entry<Pair<ProjectSystemId, File>, ExternalProject>, Object>() {
@Override
public Object fun(Map.Entry<Pair<ProjectSystemId, File>, ExternalProject> entry) {
//noinspection ConstantConditions
if (!(entry.getValue() instanceof ExternalProject)) return null;
return Pair.create(entry.getKey(), entry.getValue().getProjectDir());
}
}));
}
return externalProject;
}
@@ -133,13 +133,13 @@ class ExternalProjectBuilderImpl implements ModelBuilderService {
ExternalSourceDirectorySet resourcesDirectorySet = new DefaultExternalSourceDirectorySet()
resourcesDirectorySet.name = sourceSet.resources.name
resourcesDirectorySet.srcDirs = sourceSet.resources.srcDirs
resourcesDirectorySet.outputDir = sourceSet.output.resourcesDir
resourcesDirectorySet.outputDir = chooseNotNull(sourceSet.output.resourcesDir, sourceSet.output.classesDir, project.buildDir)
resourcesDirectorySet.inheritedCompilerOutput = inheritOutputDirs
ExternalSourceDirectorySet javaDirectorySet = new DefaultExternalSourceDirectorySet()
javaDirectorySet.name = sourceSet.allJava.name
javaDirectorySet.srcDirs = sourceSet.allJava.srcDirs
javaDirectorySet.outputDir = sourceSet.output.classesDir
javaDirectorySet.outputDir = chooseNotNull(sourceSet.output.classesDir, project.buildDir);
javaDirectorySet.inheritedCompilerOutput = inheritOutputDirs
// javaDirectorySet.excludes = javaExcludes + sourceSet.java.excludes;
// javaDirectorySet.includes = javaIncludes + sourceSet.java.includes;
@@ -173,6 +173,10 @@ class ExternalProjectBuilderImpl implements ModelBuilderService {
result
}
static <T> T chooseNotNull(T ... params) {
params.findResult("", { it })
}
static getFilters(Project project, String taskName) {
def includes = []
def excludes = []