<commit_before>package atg.tools.ant.tasks;

import atg.tools.ant.types.AtgInstallation;
import atg.tools.ant.types.ModuleCollection;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.ManifestException;
import org.apache.tools.ant.taskdefs.ManifestTask;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;

import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;

import static atg.tools.ant.util.AtgAttribute.ATG_CLASS_PATH;
import static atg.tools.ant.util.AtgAttribute.ATG_CONFIG_PATH;
import static atg.tools.ant.util.AtgAttribute.ATG_DATE;
import static atg.tools.ant.util.AtgAttribute.ATG_REQUIRED;
import static atg.tools.ant.util.AtgAttribute.ATG_TIME;
import static atg.tools.ant.util.ModuleUtils.MODULE_NAME_EXTRACTOR;
import static atg.tools.ant.util.ModuleUtils.RESOURCE_NAME_EXTRACTOR;

/**
 * Ant task to generate an ATG-compatible META-INF/MANIFEST.MF file.
 *
 * @author msicker
 * @version 2.0
 */
public class GenerateManifest
        extends ManifestTask {

    private final Format dateFormat = new SimpleDateFormat("YYYYMMdd");
    private final Format timeFormat = new SimpleDateFormat("HH mm ss");

    private AtgInstallation atg;

    private ModuleCollection modules;

    private Path classpath;

    private Path configpath;

    public void setAtg(final AtgInstallation atg) {
        this.atg = atg;
    }

    public void setAtg(final Reference reference) {
        setAtg((AtgInstallation) reference.getReferencedObject());
    }

    public void setModules(final ModuleCollection modules) {
        this.modules = modules;
    }

    public void setModules(final Reference reference) {
        setModules((ModuleCollection) reference.getReferencedObject());
    }

    public ModuleCollection createModules() {
        modules = new ModuleCollection();
        if (atg != null) {
            modules.setAtg(atg);
        }
        return modules;
    }

    public void setClasspath(final Path classpath) {
        this.classpath = classpath;
    }

    public void setClasspathRef(final Reference reference) {
        setClasspath((Path) reference.getReferencedObject());
    }

    public Path createClasspath() {
        classpath = new Path(getProject());
        return classpath;
    }

    public void setConfigpath(final Path configpath) {
        this.configpath = configpath;
    }

    public void setConfigpathRef(final Reference reference) {<commit_msg>Pre-configure project for modules.<commit_after>package atg.tools.ant.tasks;

import atg.tools.ant.types.AtgInstallation;
import atg.tools.ant.types.ModuleCollection;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.ManifestException;
import org.apache.tools.ant.taskdefs.ManifestTask;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;

import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;

import static atg.tools.ant.util.AtgAttribute.ATG_CLASS_PATH;
import static atg.tools.ant.util.AtgAttribute.ATG_CONFIG_PATH;
import static atg.tools.ant.util.AtgAttribute.ATG_DATE;
import static atg.tools.ant.util.AtgAttribute.ATG_REQUIRED;
import static atg.tools.ant.util.AtgAttribute.ATG_TIME;
import static atg.tools.ant.util.ModuleUtils.MODULE_NAME_EXTRACTOR;
import static atg.tools.ant.util.ModuleUtils.RESOURCE_NAME_EXTRACTOR;

/**
 * Ant task to generate an ATG-compatible META-INF/MANIFEST.MF file.
 *
 * @author msicker
 * @version 2.0
 */
public class GenerateManifest
        extends ManifestTask {

    private final Format dateFormat = new SimpleDateFormat("YYYYMMdd");
    private final Format timeFormat = new SimpleDateFormat("HH mm ss");

    private AtgInstallation atg;

    private ModuleCollection modules;

    private Path classpath;

    private Path configpath;

    public void setAtg(final AtgInstallation atg) {
        this.atg = atg;
    }

    public void setAtg(final Reference reference) {
        setAtg((AtgInstallation) reference.getReferencedObject());
    }

    public void setModules(final ModuleCollection modules) {
        this.modules = modules;
    }

    public void setModules(final Reference reference) {
        setModules((ModuleCollection) reference.getReferencedObject());
    }

    public ModuleCollection createModules() {
        modules = new ModuleCollection();
        modules.setProject(getProject());
        if (atg != null) {
            modules.setAtg(atg);
        }
        return modules;
    }

    public void setClasspath(final Path classpath) {
        this.classpath = classpath;
    }

    public void setClasspathRef(final Reference reference) {
        setClasspath((Path) reference.getReferencedObject());
    }

    public Path createClasspath() {
        classpath = new Path(getProject());
        return classpath;
    }

    public void setConfigpath(final Path configpath) {
        this.configpath = configpath;
    }

    public void setConfigpathRef(final Reference reference) {
{'fraction_non_alphanumeric': 0.09200872496529844, 'fraction_numerical': 0.000793178663493952, 'mean_word_length': 3.636029411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6983708', 'n_tokens_mistral': 1514, 'n_tokens_neox': 1489, 'n_words': 324}