use of org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException in project tycho by eclipse.
the class TargetPlatformFilterConfigurationReader method parseFilter.
private void parseFilter(Xpp3Dom filterDom, List<TargetPlatformFilter> result) {
CapabilityPattern scopePattern = parseScopePattern(filterDom);
Xpp3Dom restrictToDom = getComplexValue(filterDom, "restrictTo");
Xpp3Dom removeAllDom = getMarker(filterDom, "removeAll");
if (removeAllDom == null && restrictToDom == null) {
throw new TargetPlatformFilterSyntaxException("Filter action is required: specify either 'filters.filter.removeAll' or 'filters.filter.restrictTo'");
} else if (removeAllDom != null && restrictToDom != null) {
throw new TargetPlatformFilterSyntaxException("Only one filter action may be specified: either 'filters.filter.removeAll' or 'filters.filter.restrictTo'");
}
final TargetPlatformFilter filter;
if (removeAllDom != null) {
filter = TargetPlatformFilter.removeAllFilter(scopePattern);
} else {
CapabilityPattern restrictionPattern = parseRestrictionPattern(restrictToDom);
filter = TargetPlatformFilter.restrictionFilter(scopePattern, restrictionPattern);
}
result.add(filter);
}
use of org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException in project tycho by eclipse.
the class TargetPlatformFilterConfigurationReaderTest method testMissingIdException.
public void testMissingIdException() throws Exception {
try {
Xpp3Dom filterConfig = getTargetFilters("targetfilter/missing_scope_id/pom.xml");
subject.parseFilterConfiguration(filterConfig);
fail();
} catch (TargetPlatformFilterSyntaxException e) {
}
}
use of org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException in project tycho by eclipse.
the class TargetPlatformFilterConfigurationReaderTest method testMissingTypeException.
public void testMissingTypeException() throws Exception {
try {
Xpp3Dom filterConfig = getTargetFilters("targetfilter/missing_scope_type/pom.xml");
subject.parseFilterConfiguration(filterConfig);
fail();
} catch (TargetPlatformFilterSyntaxException e) {
}
}
use of org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException in project tycho by eclipse.
the class TargetPlatformFilterConfigurationReaderTest method testMissingActionException.
public void testMissingActionException() throws Exception {
try {
Xpp3Dom filterConfig = getTargetFilters("targetfilter/missing_action/pom.xml");
subject.parseFilterConfiguration(filterConfig);
fail();
} catch (TargetPlatformFilterSyntaxException e) {
}
}
use of org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException in project tycho by eclipse.
the class TargetPlatformFilterConfigurationReaderTest method testDuplicateVersionException.
public void testDuplicateVersionException() throws Exception {
try {
Xpp3Dom filterConfig = getTargetFilters("targetfilter/duplicate_scope_version/pom.xml");
subject.parseFilterConfiguration(filterConfig);
fail();
} catch (TargetPlatformFilterSyntaxException e) {
}
}
Aggregations