mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
IDEA-110316 Compilation fails when including a .form file from another jar
This commit is contained in:
+14
-3
@@ -144,8 +144,7 @@ public class FormsInstrumenter extends FormsBuilder {
|
||||
final Map<File, Collection<File>> instrumented = new THashMap<File, Collection<File>>(FileUtil.FILE_HASHING_STRATEGY);
|
||||
final Map<String, File> class2form = new HashMap<String, File>();
|
||||
|
||||
final MyNestedFormLoader nestedFormsLoader =
|
||||
new MyNestedFormLoader(chunkSourcePath, ProjectPaths.getOutputPathsWithDependents(chunk));
|
||||
final MyNestedFormLoader nestedFormsLoader = new MyNestedFormLoader(chunkSourcePath, ProjectPaths.getOutputPathsWithDependents(chunk), finder);
|
||||
|
||||
for (File formFile : forms) {
|
||||
final LwRootContainer rootContainer;
|
||||
@@ -266,15 +265,17 @@ public class FormsInstrumenter extends FormsBuilder {
|
||||
private static class MyNestedFormLoader implements NestedFormLoader {
|
||||
private final Map<File, String> mySourceRoots;
|
||||
private final Collection<File> myOutputRoots;
|
||||
private final InstrumentationClassFinder myClassFinder;
|
||||
private final HashMap<String, LwRootContainer> myCache = new HashMap<String, LwRootContainer>();
|
||||
|
||||
/**
|
||||
* @param sourceRoots all source roots for current module chunk and all dependent recursively
|
||||
* @param outputRoots output roots for this module chunk and all dependent recursively
|
||||
*/
|
||||
public MyNestedFormLoader(Map<File, String> sourceRoots, Collection<File> outputRoots) {
|
||||
public MyNestedFormLoader(Map<File, String> sourceRoots, Collection<File> outputRoots, InstrumentationClassFinder classFinder) {
|
||||
mySourceRoots = sourceRoots;
|
||||
myOutputRoots = outputRoots;
|
||||
myClassFinder = classFinder;
|
||||
}
|
||||
|
||||
public LwRootContainer loadForm(String formFileName) throws Exception {
|
||||
@@ -303,6 +304,16 @@ public class FormsInstrumenter extends FormsBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
InputStream fromLibraries = null;
|
||||
try {
|
||||
fromLibraries = myClassFinder.getResourceAsStream(relPath);
|
||||
}
|
||||
catch (IOException ignored) {
|
||||
}
|
||||
if (fromLibraries != null) {
|
||||
return loadForm(formFileName, fromLibraries);
|
||||
}
|
||||
|
||||
throw new Exception("Cannot find nested form file " + formFileName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user