mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
external compiler: cleanup
This commit is contained in:
@@ -142,7 +142,7 @@ public class FSOperations {
|
||||
final ModuleRootsIndex rootsIndex = context.getProjectDescriptor().rootsIndex;
|
||||
final Set<File> excludes = new HashSet<File>(rootsIndex.getModuleExcludes(target.getModule()));
|
||||
final Collection<RootDescriptor> roots = new ArrayList<RootDescriptor>();
|
||||
for (RootDescriptor rd : rootsIndex.getModuleRoots(context, target.getModuleName())) {
|
||||
for (RootDescriptor rd : rootsIndex.getModuleRoots(context, target.getModule())) {
|
||||
roots.add(rd);
|
||||
}
|
||||
for (RootDescriptor rd : roots) {
|
||||
|
||||
@@ -892,7 +892,7 @@ public class IncProjectBuilder {
|
||||
fsState.markInitialScanPerformed(target);
|
||||
}
|
||||
final Timestamps timestamps = pd.timestamps.getStorage();
|
||||
final List<RootDescriptor> roots = pd.rootsIndex.getModuleRoots(context, target.getModuleName());
|
||||
final List<RootDescriptor> roots = pd.rootsIndex.getModuleRoots(context, target.getModule());
|
||||
for (RootDescriptor rd : roots) {
|
||||
if (target.isTests() ? rd.isTestRoot : !rd.isTestRoot) {
|
||||
marked |= fsState.markAllUpToDate(context.getScope(), rd, timestamps, context.getCompilationStartStamp());
|
||||
|
||||
@@ -274,7 +274,7 @@ public abstract class ModuleLevelBuilder extends Builder {
|
||||
if (rd == null) {
|
||||
return true;
|
||||
}
|
||||
final JpsModule moduleOfFile = myContext.getProjectDescriptor().rootsIndex.getModuleByName(rd.module);
|
||||
final JpsModule moduleOfFile = rd.target.getModule();
|
||||
if (myChunkModules.contains(moduleOfFile)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -118,15 +118,6 @@ public class ModuleRootsIndex {
|
||||
return myNameToModuleMap.get(module);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<RootDescriptor> getModuleRoots(@Nullable CompileContext context, String moduleName) {
|
||||
final JpsModule module = getModuleByName(moduleName);
|
||||
if (module == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getModuleRoots(context, module);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<RootDescriptor> getModuleRoots(@Nullable CompileContext context, JpsModule module) {
|
||||
List<RootDescriptor> descriptors = myModuleToRootsMap.get(module);
|
||||
|
||||
@@ -195,7 +195,7 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
if (descriptor == null) {
|
||||
continue;
|
||||
}
|
||||
for (RootDescriptor rd : context.getProjectDescriptor().rootsIndex.getModuleRoots(context, descriptor.module)) {
|
||||
for (RootDescriptor rd : context.getProjectDescriptor().rootsIndex.getModuleRoots(context, descriptor.target.getModule())) {
|
||||
final File boundSource = getBoundSource(rd.root, form);
|
||||
if (boundSource == null) {
|
||||
continue;
|
||||
|
||||
+4
-4
@@ -201,8 +201,8 @@ public class GroovyBuilder extends ModuleLevelBuilder {
|
||||
final ModuleRootsIndex rootsIndex = context.getProjectDescriptor().rootsIndex;
|
||||
RootDescriptor descriptor = rootsIndex.getModuleAndRoot(context, new File(item.sourcePath));
|
||||
if (descriptor != null) {
|
||||
JpsModule srcModule = rootsIndex.getModuleByName(descriptor.module);
|
||||
if (srcModule != null && srcModule != chunk.representativeModule()) {
|
||||
JpsModule srcModule = descriptor.target.getModule();
|
||||
if (srcModule != chunk.representativeModule()) {
|
||||
File output = new File(item.outputPath);
|
||||
|
||||
//todo honor package prefixes
|
||||
@@ -263,9 +263,9 @@ public class GroovyBuilder extends ModuleLevelBuilder {
|
||||
final String outputPath = FileUtil.toSystemIndependentName(item.outputPath);
|
||||
final RootDescriptor moduleAndRoot = context.getProjectDescriptor().rootsIndex.getModuleAndRoot(context, new File(sourcePath));
|
||||
if (moduleAndRoot != null) {
|
||||
final String moduleName = moduleAndRoot.module;
|
||||
final JpsModule module = moduleAndRoot.target.getModule();
|
||||
context.getProjectDescriptor().dataManager.getSourceToOutputMap(moduleAndRoot.target).appendData(sourcePath, outputPath);
|
||||
String moduleOutputPath = generationOutputs.get(context.getProjectDescriptor().rootsIndex.getModuleByName(moduleName));
|
||||
String moduleOutputPath = generationOutputs.get(module);
|
||||
generatedEvent.add(moduleOutputPath, FileUtil.getRelativePath(moduleOutputPath, outputPath, '/'));
|
||||
}
|
||||
callback.associate(outputPath, sourcePath, new ClassReader(FileUtil.loadFileBytes(new File(outputPath))));
|
||||
|
||||
Reference in New Issue
Block a user