mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
external build: support $MODULE_DIR$ macro in java compiler properties to allow per-module properties for Eclipse compiler (ZD-48434)
This commit is contained in:
@@ -56,6 +56,8 @@ import org.jetbrains.jps.model.java.compiler.*;
|
||||
import org.jetbrains.jps.model.library.sdk.JpsSdk;
|
||||
import org.jetbrains.jps.model.module.JpsModule;
|
||||
import org.jetbrains.jps.model.module.JpsModuleType;
|
||||
import org.jetbrains.jps.model.serialization.JpsModelSerializationDataService;
|
||||
import org.jetbrains.jps.model.serialization.PathMacroUtil;
|
||||
import org.jetbrains.jps.service.JpsServiceManager;
|
||||
|
||||
import javax.tools.*;
|
||||
@@ -594,7 +596,19 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
assert cached != null : context;
|
||||
}
|
||||
|
||||
List<String> options = new ArrayList<String>(cached);
|
||||
List<String> options = new ArrayList<String>();
|
||||
JpsModule module = chunk.representativeTarget().getModule();
|
||||
File baseDirectory = JpsModelSerializationDataService.getBaseDirectory(module);
|
||||
if (baseDirectory != null) {
|
||||
//this is a temporary workaround to allow passing per-module compiler options for Eclipse compiler in form
|
||||
// -properties $MODULE_DIR$/.settings/org.eclipse.jdt.core.prefs
|
||||
for (String s : cached) {
|
||||
options.add(StringUtil.replace(s, "$" + PathMacroUtil.MODULE_DIR_MACRO_NAME + "$", baseDirectory.getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
options.addAll(cached);
|
||||
}
|
||||
addCompilationOptions(options, context, chunk, profile);
|
||||
return options;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user