use of org.jetbrains.jps.model.java.compiler.JpsJavaCompilerConfiguration 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.JpsJavaCompilerConfiguration in project intellij-community by JetBrains.
the class JpsCompilerValidationExcludeSerializer method loadExtension.
@Override
public void loadExtension(@NotNull JpsProject project, @NotNull Element componentTag) {
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project);
JpsJavaCompilerConfigurationSerializer.readExcludes(componentTag, configuration.getValidationExcludes());
}
use of org.jetbrains.jps.model.java.compiler.JpsJavaCompilerConfiguration in project intellij-community by JetBrains.
the class JpsEclipseCompilerOptionsSerializer method loadExtension.
@Override
public void loadExtension(@NotNull JpsProject project, @NotNull Element componentTag) {
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project);
EclipseCompilerOptions options = XmlSerializer.deserialize(componentTag, EclipseCompilerOptions.class);
configuration.setCompilerOptions(myCompilerId, options);
}
use of org.jetbrains.jps.model.java.compiler.JpsJavaCompilerConfiguration 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.JpsJavaCompilerConfiguration in project intellij-community by JetBrains.
the class JpsJavaCompilerWorkspaceConfigurationSerializer method loadExtension.
@Override
public void loadExtension(@NotNull JpsProject project, @NotNull Element componentTag) {
JpsJavaCompilerConfiguration configuration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(project);
String assertNotNull = JDOMExternalizerUtil.readField(componentTag, "ASSERT_NOT_NULL");
if (assertNotNull != null) {
configuration.setAddNotNullAssertions(Boolean.parseBoolean(assertNotNull));
}
String clearOutputDirectory = JDOMExternalizerUtil.readField(componentTag, "CLEAR_OUTPUT_DIRECTORY");
configuration.setClearOutputDirectoryOnRebuild(clearOutputDirectory == null || Boolean.parseBoolean(clearOutputDirectory));
}
Aggregations