mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-89176 mark generated files dirty manually, because they can be marked by native fs listener too late
This commit is contained in:
@@ -131,6 +131,7 @@ public class AndroidAptCompiler implements SourceGeneratingCompiler {
|
||||
// we use copyDir instead of moveDirWithContent here, because tmp directory may be located on other disk and
|
||||
// moveDirWithContent doesn't work for such case
|
||||
FileUtil.copyDir(tmpOutputDir, genRootDir);
|
||||
AndroidCompileUtil.markDirty(outputRootDirectory, true);
|
||||
}
|
||||
results.add(aptItem);
|
||||
}
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ public class AndroidBuildConfigGeneratingCompiler implements SourceGeneratingCom
|
||||
}
|
||||
|
||||
if (result.size() > 0) {
|
||||
outputRootDirectory.refresh(false, true);
|
||||
AndroidCompileUtil.markDirtyAndRefresh(outputRootDirectory, true);
|
||||
}
|
||||
return result.toArray(new GenerationItem[result.size()]);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.artifacts.ArtifactProperties;
|
||||
import com.intellij.packaging.impl.compiler.ArtifactCompileScope;
|
||||
@@ -887,4 +888,22 @@ public class AndroidCompileUtil {
|
||||
public static void reportException(@NotNull CompileContext context, @NotNull String messagePrefix, @NotNull Exception e) {
|
||||
context.addMessage(CompilerMessageCategory.ERROR, messagePrefix + e.getClass().getSimpleName() + ": " + e.getMessage(), null, -1, -1);
|
||||
}
|
||||
|
||||
public static void markDirtyAndRefresh(VirtualFile f, boolean recursively) {
|
||||
markDirty(f, recursively);
|
||||
f.refresh(false, recursively);
|
||||
}
|
||||
|
||||
public static void markDirty(VirtualFile f, boolean recursively) {
|
||||
if (f instanceof NewVirtualFile) {
|
||||
final NewVirtualFile newF = (NewVirtualFile)f;
|
||||
|
||||
if (recursively) {
|
||||
newF.markDirtyRecursively();
|
||||
}
|
||||
else {
|
||||
newF.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -108,7 +108,7 @@ public class AndroidExternalApklibExtractingCompiler implements SourceGenerating
|
||||
|
||||
final VirtualFile vSrcRoot = LocalFileSystem.getInstance().findFileByIoFile(srcRoot);
|
||||
if (vSrcRoot != null) {
|
||||
vSrcRoot.getParent().refresh(false, true);
|
||||
AndroidCompileUtil.markDirtyAndRefresh(vSrcRoot, true);
|
||||
AndroidUtils.collectFiles(vSrcRoot, visited, generatedVFiles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ public class AndroidIdlCompiler implements SourceGeneratingCompiler {
|
||||
}
|
||||
|
||||
if (toRefresh) {
|
||||
outputRootDirectory.refresh(false, true);
|
||||
AndroidCompileUtil.markDirtyAndRefresh(outputRootDirectory, true);
|
||||
}
|
||||
return results.toArray(new GenerationItem[results.size()]);
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ public class AndroidIncludingCompiler implements SourceGeneratingCompiler {
|
||||
}
|
||||
|
||||
if (toRefresh) {
|
||||
outputRootDirectory.refresh(false, true);
|
||||
AndroidCompileUtil.markDirtyAndRefresh(outputRootDirectory, true);
|
||||
}
|
||||
return result.toArray(new GenerationItem[result.size()]);
|
||||
}
|
||||
|
||||
+4
-5
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.jetbrains.android.compiler;
|
||||
|
||||
import com.intellij.compiler.impl.CompilerUtil;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.compiler.*;
|
||||
import com.intellij.openapi.compiler.ex.CompileContextEx;
|
||||
@@ -77,10 +76,10 @@ public class AndroidMavenResourcesCompiler implements SourceGeneratingCompiler {
|
||||
for (GenerationItem item : generationItems) {
|
||||
File generatedFile = ((MyGenerationItem)item).myGeneratedFile;
|
||||
if (generatedFile != null) {
|
||||
CompilerUtil.refreshIOFile(generatedFile);
|
||||
VirtualFile generatedVFile = LocalFileSystem.getInstance().findFileByIoFile(generatedFile);
|
||||
if (generatedVFile != null) {
|
||||
generatedVFiles.add(generatedVFile);
|
||||
final VirtualFile vFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(generatedFile);
|
||||
if (vFile != null) {
|
||||
AndroidCompileUtil.markDirtyAndRefresh(vFile, false);
|
||||
generatedVFiles.add(vFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,6 +197,7 @@ public class AndroidRenderscriptCompiler implements SourceGeneratingCompiler {
|
||||
.execute(genItem.mySdkLocation, genItem.myAndroidTarget, sourceFile.getPath(), genRootPath,
|
||||
depFolderOsPath,
|
||||
genItem.myRawDirPath));
|
||||
AndroidCompileUtil.markDirty(outputRootDirectory, true);
|
||||
|
||||
ApplicationManager.getApplication().runReadAction(new Runnable() {
|
||||
public void run() {
|
||||
|
||||
Reference in New Issue
Block a user