org.anarres.gradle.plugin.stdproject.StdPluginExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-stdproject-plugin Show documentation
Show all versions of gradle-stdproject-plugin Show documentation
An opinionated Gradle plugin for building Java projects.
package org.anarres.gradle.plugin.stdproject;
import groovy.lang.GroovyObjectSupport;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
import org.gradle.api.Project;
/**
* The standard plugin plugin extension.
*
* This allows configuring the standard plugin plugin using a
* stdplugin { }
block.
*
* @author shevek
*/
public class StdPluginExtension extends GroovyObjectSupport {
// public String pluginName;
// public String pluginDescription;
public Map implementations = new HashMap();
// public final Set pluginLicenses = new LinkedHashSet();
public final Set tags = new LinkedHashSet();
public StdPluginExtension(@Nonnull Project project) {
// pluginName = project.getName();
// pluginLicenses.add("Apache-2.0");
}
public void implementation(@Nonnull String id, @Nonnull String implementationClass) {
implementations.put(id, implementationClass);
}
public void implementation(@Nonnull String implementationClass) {
String id = implementationClass.
replaceAll("\\.gradle\\.", ".").
replaceAll("\\.plugin\\.", ".").
substring(0, implementationClass.lastIndexOf('.'));
implementation(id, implementationClass);
}
public void tags(Object... tags) {
for (Object tag : tags)
this.tags.add(String.valueOf(tag));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy