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

org.jvnet.localizer.GeneratorTask Maven / Gradle / Ivy

There is a newer version: 1.12
Show newest version
package org.jvnet.localizer;

import org.apache.tools.ant.taskdefs.MatchingTask;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;

import java.io.File;
import java.io.IOException;

/**
 * Ant task for resource generation.
 * 
 * @author Kohsuke Kawaguchi
 */
public class GeneratorTask extends MatchingTask {
    /**
     * Source and destination.
     */
    private File dir,todir;

    public void setDir(File dir) {
        this.dir = dir;
    }

    public void setTodir(File todir) {
        this.todir = todir;
    }

    public void execute() throws BuildException {
        Generator g = new Generator(todir,new Reporter() {
            public void debug(String msg) {
                log(msg, Project.MSG_DEBUG);
            }
        });

        try {
            g.generate(dir,getDirectoryScanner(dir));
            g.build();
        } catch (IOException e) {
            throw new BuildException(e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy