Good news!

 

Windup rules, when written in Java syntax (instead of XML), is now much nicer, after we did [WINDUP-409] in PR #380 @Rules( phase = ..., .... by OndraZizka .

 

Before, metadata were provided by callback methods. Combined with our insisting on space-wasting formatting, each piece of metadata required 5 lines in class source.

 

public class SkipArchivesRules extends WindupRuleProvider
{
    private static final Logger log = Logging.get(SkipArchivesRules.class);

    @Override
    public void enhanceMetadata(Context context)
    {
        super.enhanceMetadata(context);
        context.put(RuleMetadata.CATEGORY, "Java");
    }

    @Override
    public List<Class<? extends WindupRuleProvider>> getExecuteAfter()
    {
        return asClassList(IdentifyArchivesRules.class, SkipArchivesLoadConfigRules.class);
    }

    @Override
    public List<Class<? extends WindupRuleProvider>> getExecuteBefore()
    {
        return asClassList(DecompileArchivesRuleProvider.class);
    }

    @Override
    public Class<? extends RulePhase> getPhase()
    {
        return Implicit.class;
    }
...

 

Now it's just one line with annotations:

 

@RuleMetadata(tags = "java", after = {IdentifyArchivesRules.class, SkipArchivesLoadConfigRules.class}, before = {DecompileArchivesRuleProvider.class}, phase = DependentPhase.class)
public class SkipArchivesRules extends AbstractRuleProvider
{
    private static final Logger log = Logging.get(SkipArchivesRules.class);
...

 

Isn't it great improvement?