All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.freefair.gradle.plugins.maven.plugin.AbstractGeneratorTask Maven / Gradle / Ivy

There is a newer version: 8.10.2
Show newest version
package io.freefair.gradle.plugins.maven.plugin;

import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
import org.apache.maven.plugin.plugin.AbstractGeneratorMojo;
import org.apache.maven.tools.plugin.extractor.ExtractionException;
import org.apache.maven.tools.plugin.generator.GeneratorException;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.gradle.api.DefaultTask;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.TaskAction;

import java.io.IOException;

/**
 * @author Lars Grefer
 * @see AbstractGeneratorMojo
 */
@SuppressWarnings("JavadocReference")
public abstract class AbstractGeneratorTask extends DefaultTask {

    /**
     * The goal prefix that will appear before the ":".
     *
     * @see AbstractGeneratorMojo#goalPrefix
     */
    @Optional
    @Input
    public abstract Property getGoalPrefix();

    /**
     * @see AbstractGeneratorMojo#execute()
     */
    @TaskAction
    public void execute() throws GeneratorException, IOException, XmlPullParserException, InvalidPluginDescriptorException, ExtractionException {

        generate();
    }

    protected abstract void generate() throws ExtractionException, InvalidPluginDescriptorException, XmlPullParserException, IOException, GeneratorException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy