@Override public void saveExtension(@NotNull JpsProject project, @NotNull Element componentTag) { JpsJavaProjectExtension extension = getService().getProjectExtension(project); if (extension == null) return; String outputUrl = extension.getOutputUrl(); if (outputUrl != null) { componentTag.addContent(new Element(OUTPUT_TAG).setAttribute(URL_ATTRIBUTE, outputUrl)); } LanguageLevel level = extension.getLanguageLevel(); componentTag.setAttribute(LANGUAGE_LEVEL_ATTRIBUTE, level.name()); componentTag.setAttribute( "assert-keyword", Boolean.toString(level.compareTo(LanguageLevel.JDK_1_4) >= 0)); componentTag.setAttribute( "jdk-15", Boolean.toString(level.compareTo(LanguageLevel.JDK_1_5) >= 0)); }
private static void loadJavaModuleExtension(JpsModule module, Element rootModelComponent) { final JpsJavaModuleExtension extension = getService().getOrCreateModuleExtension(module); final Element outputTag = rootModelComponent.getChild(OUTPUT_TAG); if (outputTag != null) { extension.setOutputUrl(outputTag.getAttributeValue(URL_ATTRIBUTE)); } final Element testOutputTag = rootModelComponent.getChild(TEST_OUTPUT_TAG); if (testOutputTag != null) { extension.setTestOutputUrl(testOutputTag.getAttributeValue(URL_ATTRIBUTE)); } extension.setInheritOutput( Boolean.parseBoolean( rootModelComponent.getAttributeValue(INHERIT_COMPILER_OUTPUT_ATTRIBUTE))); extension.setExcludeOutput(rootModelComponent.getChild(EXCLUDE_OUTPUT_TAG) != null); final String languageLevel = rootModelComponent.getAttributeValue(MODULE_LANGUAGE_LEVEL_ATTRIBUTE); if (languageLevel != null) { extension.setLanguageLevel(LanguageLevel.valueOf(languageLevel)); } loadAdditionalRoots(rootModelComponent, ANNOTATION_PATHS_TAG, extension.getAnnotationRoots()); loadAdditionalRoots(rootModelComponent, JAVADOC_PATHS_TAG, extension.getJavadocRoots()); }