Fixes #5982: In API/rules include/exclude is ordered for target parameter
Merge pull request #717 from fanf/bug_5982/in_api_rules_include_exclude_is_ordered_for_target_parameter

Fixes #5982: In API/rules include/exclude is ordered for target parameter