
dev.lajoscseppento.ruthless.plugin.RuthlessPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ruthless-plugin Show documentation
Show all versions of ruthless-plugin Show documentation
Ruthless conventions for Gradle projects to keep them DRY
package dev.lajoscseppento.ruthless.plugin;
import dev.lajoscseppento.ruthless.plugin.impl.RuthlessBasePlugin;
import dev.lajoscseppento.ruthless.plugin.impl.RuthlessGradlePlugin;
import dev.lajoscseppento.ruthless.plugin.impl.RuthlessSettingsPlugin;
import lombok.NonNull;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.initialization.Settings;
import org.gradle.api.invocation.Gradle;
import org.gradle.api.plugins.PluginAware;
/**
* Meta-plugin which can be applied to any {@link PluginAware object} and applies in the
* corresponding plugin. This allows to re-use a plugin id for different Gradle components.
*/
public class RuthlessPlugin implements Plugin {
@Override
public void apply(@NonNull PluginAware target) {
if (target instanceof Project) {
target.getPlugins().apply(RuthlessBasePlugin.class);
} else if (target instanceof Settings) {
target.getPlugins().apply(RuthlessSettingsPlugin.class);
} else if (target instanceof Gradle) {
target.getPlugins().apply(RuthlessGradlePlugin.class);
} else {
throw new AssertionError("Unsupported target class: " + target.getClass().getName());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy