private void validateUnpack(Element parent) { int severity = CompilerFlags.getFlag(fProject, CompilerFlags.F_UNRESOLVED_PLUGINS); if (severity == CompilerFlags.IGNORE) { return; } if (severity == CompilerFlags.ERROR) { // this might not be an error, so max the flag at WARNING level. severity = CompilerFlags.WARNING; } String unpack = parent.getAttribute("unpack"); // $NON-NLS-1$ IPluginModelBase pModel = PluginRegistry.findModel(parent.getAttribute("id")); // $NON-NLS-1$ if (pModel == null) { return; } if (pModel instanceof IBundlePluginModel) { IBundlePluginModel bModel = (IBundlePluginModel) pModel; IManifestHeader header = bModel .getBundleModel() .getBundle() .getManifestHeader(ICoreConstants.ECLIPSE_BUNDLE_SHAPE); if (header != null) { String value = header.getValue(); String unpackValue = "true".equals(unpack) ? "jar" : "dir"; // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (value != null && !value.equalsIgnoreCase(unpackValue)) { String message = NLS.bind( PDECoreMessages.Builders_Feature_mismatchUnpackBundleShape, (new String[] { "unpack=" + unpack, parent.getAttribute("id"), "Eclipse-BundleShape: " + value })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ report(message, getLine(parent), severity, PDEMarkerFactory.CAT_OTHER); } } } if ("true".equals(unpack) && !CoreUtility.guessUnpack(pModel.getBundleDescription())) { // $NON-NLS-1$ String message = NLS.bind( PDECoreMessages.Builders_Feature_missingUnpackFalse, (new String[] { parent.getAttribute("id"), "unpack=\"false\"" })); //$NON-NLS-1$ //$NON-NLS-2$ report(message, getLine(parent), severity, PDEMarkerFactory.CAT_OTHER); } }
private void validatePluginID(Element element, Attr attr, boolean isFragment) { String id = attr.getValue(); if (!validatePluginID(element, attr)) { return; } int severity = CompilerFlags.getFlag(fProject, CompilerFlags.F_UNRESOLVED_PLUGINS); if (severity != CompilerFlags.IGNORE) { IPluginModelBase model = PluginRegistry.findModel(id); if (model == null || !model.isEnabled() || (isFragment && !model.isFragmentModel()) || (!isFragment && model.isFragmentModel())) { report( NLS.bind(PDECoreMessages.Builders_Feature_reference, id), getLine(element, attr.getName()), severity, PDEMarkerFactory.CAT_OTHER); } } }