use of com.intellij.openapi.roots.CompilerModuleExtension in project android by JetBrains.
the class CompilerSettingsSetup method setOutputPaths.
public void setOutputPaths(@NotNull ModifiableRootModel moduleModel, @NotNull File mainOutputPath, @Nullable File testOutputPath) {
CompilerModuleExtension compilerSettings = moduleModel.getModuleExtension(CompilerModuleExtension.class);
if (compilerSettings == null) {
String msg = String.format("No compiler extension is found for module '%1$s'", moduleModel.getModule().getName());
Logger.getInstance(getClass()).warn(msg);
return;
}
compilerSettings.inheritCompilerOutputPath(false);
compilerSettings.setCompilerOutputPath(pathToIdeaUrl(mainOutputPath));
if (testOutputPath != null) {
compilerSettings.setCompilerOutputPathForTests(pathToIdeaUrl(testOutputPath));
}
}
use of com.intellij.openapi.roots.CompilerModuleExtension in project android by JetBrains.
the class ModuleClassLoader method loadClassFromModule.
@Nullable
private Class<?> loadClassFromModule(Module module, String name) {
if (module.isDisposed()) {
return null;
}
final CompilerModuleExtension extension = CompilerModuleExtension.getInstance(module);
if (extension == null) {
return null;
}
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("loadClassFromModule(%s, %s)", anonymize(module), anonymizeClassName(name)));
}
VirtualFile vOutFolder = extension.getCompilerOutputPath();
VirtualFile classFile = null;
if (vOutFolder == null) {
AndroidFacet facet = AndroidFacet.getInstance(module);
if (facet != null && facet.requiresAndroidModel()) {
AndroidModel androidModel = facet.getAndroidModel();
if (androidModel != null) {
classFile = androidModel.getClassJarProvider().findModuleClassFile(name, module);
}
}
} else {
classFile = ClassJarProvider.findClassFileInPath(vOutFolder, name);
}
if (classFile != null) {
return loadClassFile(name, classFile);
}
if (LOG.isDebugEnabled()) {
LOG.debug(" Class not found");
}
return null;
}
Aggregations