public static List<URL> compilerOutputPathsFor(final Module module) { final CompilerModuleExtension compilerModule = CompilerModuleExtension.getInstance(module); if (compilerModule != null) { return pathsOf(compilerModule.getOutputRoots(true)); } return emptyList(); }
@Override public void configure( @NotNull final ModifiableRootModel modifiableRootModel, @NotNull final HybrisModuleDescriptor moduleDescriptor ) { Validate.notNull(modifiableRootModel); Validate.notNull(moduleDescriptor); final CompilerModuleExtension compilerModuleExtension = modifiableRootModel.getModuleExtension( CompilerModuleExtension.class ); final File outputDirectory = new File( moduleDescriptor.getRootDirectory(), HybrisConstants.JAVA_COMPILER_FAKE_OUTPUT_PATH ); compilerModuleExtension.setCompilerOutputPath(VfsUtilCore.pathToUrl(outputDirectory.getAbsolutePath())); compilerModuleExtension.setCompilerOutputPathForTests(VfsUtilCore.pathToUrl(outputDirectory.getAbsolutePath())); compilerModuleExtension.setExcludeOutput(true); compilerModuleExtension.inheritCompilerOutputPath(false); }
public void configureByModule(final Module module, @MagicConstant(valuesFromClass = MonkeyParameters.class) final int classPathType, boolean forTests) throws CantRunException { CompilerModuleExtension extension = CompilerModuleExtension.getInstance(module); if (extension != null) { outputPath = forTests ? extension.getCompilerOutputPathForTests() : extension.getCompilerOutputPath(); } final Sdk moduleSdk = getModuleSdk(module); if ((classPathType & SDK_ONLY) != 0) { if (moduleSdk == null) { throw CantRunException.noJdkConfigured(); } setSdk(moduleSdk); } }
if (getCompilerExtension().isCompilerOutputPathInherited()) return; //do not override settings if any getCompilerExtension().setCompilerOutputPath(url); }); if (getCompilerExtension().isCompilerOutputPathInherited()) return; //do not override settings if any getCompilerExtension().setCompilerOutputPathForTests(url); }); myCbExcludeOutput = new JCheckBox(ProjectBundle.message("module.paths.exclude.output.checkbox"), getCompilerExtension().isExcludeOutput()); myCbExcludeOutput.addActionListener(e -> getCompilerExtension().setExcludeOutput(myCbExcludeOutput.isSelected())); final boolean outputPathInherited = getCompilerExtension().isCompilerOutputPathInherited(); myInheritCompilerOutput.setSelected(outputPathInherited); myPerModuleCompilerOutput.setSelected(!outputPathInherited);
private void updateOutputPathPresentation() { if (getCompilerExtension().isCompilerOutputPathInherited()) { final String baseUrl = ProjectStructureConfigurable.getInstance(myProject).getProjectConfig().getCompilerOutputUrl(); moduleCompileOutputChanged(baseUrl, getModel().getModule().getName()); } else { final VirtualFile compilerOutputPath = getCompilerExtension().getCompilerOutputPath(); if (compilerOutputPath != null) { myOutputPathPanel.setText(FileUtil.toSystemDependentName(compilerOutputPath.getPath())); } else { final String compilerOutputUrl = getCompilerExtension().getCompilerOutputUrl(); if (compilerOutputUrl != null) { myOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtilCore.urlToPath(compilerOutputUrl))); } } final VirtualFile testsOutputPath = getCompilerExtension().getCompilerOutputPathForTests(); if (testsOutputPath != null) { myTestsOutputPathPanel.setText(FileUtil.toSystemDependentName(testsOutputPath.getPath())); } else { final String testsOutputUrl = getCompilerExtension().getCompilerOutputUrlForTests(); if (testsOutputUrl != null) { myTestsOutputPathPanel.setText(FileUtil.toSystemDependentName(VfsUtilCore.urlToPath(testsOutputUrl))); } } } }
@CheckForNull private static VirtualFile getCompilerOutputPath(final Module module) { final CompilerModuleExtension compilerModuleExtension = CompilerModuleExtension.getInstance(module); if (compilerModuleExtension != null) { VirtualFile file = compilerModuleExtension.getCompilerOutputPath(); // see SLI-107 if (exists(file)) { return file; } } return null; }
@CheckForNull private static VirtualFile getCompilerTestOutputPath(final Module module) { final CompilerModuleExtension compilerModuleExtension = CompilerModuleExtension.getInstance(module); if (compilerModuleExtension != null) { VirtualFile file = compilerModuleExtension.getCompilerOutputPathForTests(); if (exists(file)) { return file; } } return null; }
compilerModuleExtension.setExcludeOutput(true); compilerModuleExtension.inheritCompilerOutputPath(true);
CompilerModuleExtension compilerModuleExtension() { return CompilerModuleExtension.getInstance(module); }
@Override public void setupRootModel(ModifiableRootModel rootModel) { final CompilerModuleExtension compilerModuleExtension = rootModel.getModuleExtension(CompilerModuleExtension.class); compilerModuleExtension.setExcludeOutput(true); if (myJdk != null) { rootModel.setSdk(myJdk);
private void enableCompilerSettings(final boolean enabled) { UIUtil.setEnabled(myOutputPathPanel, enabled, true); UIUtil.setEnabled(myOutputLabel, enabled, true); UIUtil.setEnabled(myTestsOutputPathPanel, enabled, true); UIUtil.setEnabled(myTestOutputLabel, enabled, true); myCbExcludeOutput.setEnabled(enabled); getCompilerExtension().inheritCompilerOutputPath(!enabled); updateOutputPathPresentation(); }
for (VirtualFile virtualFile : compilerExtension.getOutputRoots(true)) { classpathElements.add(new File(virtualFile.getPath()));