yahoo / squidb

SquiDB is a SQLite database library for Android and iOS
https://github.com/yahoo/squidb/wiki
Apache License 2.0
1.31k stars 132 forks source link

Plugin options handling #203

Closed jdkoren closed 8 years ago

jdkoren commented 8 years ago

With this change, only options declared by SquiDB should be passed to APT in the list keyed by squidbOptions. Any others won't cause an error but a warning will be printed during builds.

Custom plugins should use their own option key(s) if they need to inspect APT options. This has always been the intended approach, but it was never clear; this change adds appropriate messaging to this effect.

Custom plugins should specify what option key(s) they support by using the @SupportedOptions annotation. This is not specifically required, but it does allow SquiDB to report those back to the toolchain so that the toolchain does not warn about seemingly unused options. Example:

package com.fancy.plugins;

@SupportedOptions("fancyOptions")
public class FancyPlugin extends Plugin {
    /* ... */
}
apt {
    arguments {
        squidbPlugins 'com.fancy.plugins.FancyPlugin:high'
        fancyOptions 'foo'
    }
}

Addresses #183. Replaces #198.

sbosley commented 8 years ago

LGTM