Merge remote-tracking branch 'origin/master'

This commit is contained in:
Vladimir.Orlov
2014-08-04 12:17:46 +04:00
2 changed files with 19 additions and 11 deletions
@@ -39,6 +39,7 @@ import com.intellij.openapi.roots.ModuleRootModificationUtil;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packaging.artifacts.Artifact;
import com.intellij.packaging.impl.compiler.ArtifactCompileScope;
@@ -455,9 +456,11 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase {
}
protected void assertArtifactOutput(String artifactName, TestFileSystemItem fs) {
final String outputPath = ArtifactsTestUtil.findArtifact(myProject, artifactName).getOutputPath();
assert outputPath != null;
fs.assertDirectoryEqual(new File(outputPath));
final Artifact artifact = ArtifactsTestUtil.findArtifact(myProject, artifactName);
final VirtualFile outputFile = artifact.getOutputFile();
assert outputFile != null;
final File file = VfsUtilCore.virtualToIoFile(outputFile);
fs.assertFileEqual(file);
}
private static void setFileContent(final VirtualFile file, final String content, final boolean advanceStamps) throws IOException {
@@ -88,20 +88,25 @@ class WarModelBuilderImpl implements ModelBuilderService {
if (resolver.metaClass.respondsTo(resolver, 'getSourcePaths')) {
sourcePaths = resolver.getSourcePaths()
} else if (resolver.this$0.metaClass.respondsTo(resolver, 'getSourcePaths')) {
} else if (resolver.hasProperty('sourcePaths')) {
sourcePaths = resolver.sourcePaths
} else if (resolver.hasProperty('this$0') && resolver.this$0.metaClass.respondsTo(resolver, 'getSourcePaths')) {
sourcePaths = resolver.this$0.getSourcePaths()
} else {
} else if (resolver.hasProperty('this$0') && resolver.this$0.hasProperty('sourcePaths')) {
sourcePaths = resolver.this$0.sourcePaths
} /*else {
throw new RuntimeException("${GradleVersion.current()} is not supported by web artifact importer")
}
}*/
(sourcePaths.flatten() as List).each { def path ->
if (path instanceof String) {
def file = new File(warTask.project.projectDir, path)
addPath(webResources, relativePath, "", file)
if(sourcePaths) {
(sourcePaths.flatten() as List).each { def path ->
if (path instanceof String) {
def file = new File(warTask.project.projectDir, path)
addPath(webResources, relativePath, "", file)
}
}
}
resolver.source.visit(new FileVisitor() {
@Override
public void visitDir(FileVisitDetails dirDetails) {