use of org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions in project intellij-community by JetBrains.
the class MavenProjectImporter method removeOutdatedCompilerConfigSettings.
private void removeOutdatedCompilerConfigSettings() {
ApplicationManager.getApplication().assertWriteAccessAllowed();
final JpsJavaCompilerOptions javacOptions = JavacConfiguration.getOptions(myProject, JavacConfiguration.class);
String options = javacOptions.ADDITIONAL_OPTIONS_STRING;
// Old IDEAs saved
options = options.replaceFirst("(-target (\\S+))", "");
javacOptions.ADDITIONAL_OPTIONS_STRING = options;
}
use of org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions in project intellij-community by JetBrains.
the class JpsCompilerConfigurationTest method doTest.
private void doTest(final String path) {
loadProject(path);
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getCompilerConfiguration(myProject);
assertNotNull(configuration);
assertFalse(configuration.isClearOutputDirectoryOnRebuild());
assertFalse(configuration.isAddNotNullAssertions());
ProcessorConfigProfile defaultProfile = configuration.getDefaultAnnotationProcessingProfile();
assertTrue(defaultProfile.isEnabled());
assertFalse(defaultProfile.isObtainProcessorsFromClasspath());
assertEquals(FileUtil.toSystemDependentName(JpsPathUtil.urlToPath(getUrl("src"))), defaultProfile.getProcessorPath());
assertEquals("b", defaultProfile.getProcessorOptions().get("a"));
assertEquals("d", defaultProfile.getProcessorOptions().get("c"));
assertEquals("gen", defaultProfile.getGeneratedSourcesDirectoryName(false));
JpsCompilerExcludes excludes = configuration.getCompilerExcludes();
assertFalse(isExcluded(excludes, "src/nonrec/x/Y.java"));
assertTrue(isExcluded(excludes, "src/nonrec/Y.java"));
assertTrue(isExcluded(excludes, "src/rec/x/Y.java"));
assertTrue(isExcluded(excludes, "src/rec/Y.java"));
assertTrue(isExcluded(excludes, "src/A.java"));
assertFalse(isExcluded(excludes, "src/B.java"));
JpsJavaCompilerOptions options = configuration.getCurrentCompilerOptions();
assertNotNull(options);
assertEquals(512, options.MAXIMUM_HEAP_SIZE);
assertFalse(options.DEBUGGING_INFO);
assertTrue(options.GENERATE_NO_WARNINGS);
assertEquals("-Xlint", options.ADDITIONAL_OPTIONS_STRING);
}
use of org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions in project intellij-community by JetBrains.
the class JpsJavaCompilerOptionsSerializer method loadExtension.
@Override
public void loadExtension(@NotNull JpsProject project, @NotNull Element componentTag) {
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project);
JpsJavaCompilerOptions options = XmlSerializer.deserialize(componentTag, JpsJavaCompilerOptions.class);
configuration.setCompilerOptions(myCompilerId, options);
}
use of org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions in project intellij-community by JetBrains.
the class JavacConfiguration method getState.
@Override
@NotNull
public JpsJavaCompilerOptions getState() {
JpsJavaCompilerOptions state = new JpsJavaCompilerOptions();
XmlSerializerUtil.copyBean(mySettings, state);
state.ADDITIONAL_OPTIONS_STRING = PathMacroManager.getInstance(myProject).collapsePathsRecursively(state.ADDITIONAL_OPTIONS_STRING);
return state;
}
use of org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions in project intellij-community by JetBrains.
the class JpsJavaCompilerOptionsSerializer method loadExtensionWithDefaultSettings.
@Override
public void loadExtensionWithDefaultSettings(@NotNull JpsProject project) {
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project);
configuration.setCompilerOptions(myCompilerId, new JpsJavaCompilerOptions());
}
Aggregations