Package com.redhat.ceylon.ant

Source Code of com.redhat.ceylon.ant.CeylonConfigAntTask

package com.redhat.ceylon.ant;

import org.apache.tools.ant.BuildException;

import com.redhat.ceylon.common.config.CeylonConfig;

public class CeylonConfigAntTask extends CeylonConfigBaseTask {
   
    private String prefix;
    private String infix;
   
    public String getPrefix() {
        return (prefix != null) ? prefix : "CEYLON.";
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public String getInfix() {
        return (infix != null) ? infix : ",";
    }

    public void setInfix(String infix) {
        this.infix = infix;
    }

    @Override
    public void execute() throws BuildException {
        Java7Checker.check();
        CeylonConfig config = getConfig();
        for (String key : config.getOptionNames(null)) {
            String[] values = config.getOptionValues(key);
            setConfigValueAsProperty(values, getPrefix() + key);
        }
    }

}
TOP

Related Classes of com.redhat.ceylon.ant.CeylonConfigAntTask

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.