Package ideah.util

Source Code of ideah.util.LocationUtil

package ideah.util;

import com.intellij.execution.configurations.CommandLineTokenizer;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

abstract class LocationUtil {

    private final String exe;
    private final String libPath;
    private final String ghcOptions;

    protected LocationUtil(String exe, String libPath, String ghcOptions) {
        this.exe = exe;
        this.libPath = libPath;
        this.ghcOptions = ghcOptions;
    }

    public final List<String> getCompileOptionsList(String... additionalArgs) {
        List<String> args = new ArrayList<String>();
        args.add(exe);
        args.addAll(Arrays.asList("-g", libPath));
        CommandLineTokenizer tokenizer = new CommandLineTokenizer(ghcOptions == null ? "" : ghcOptions);
        while (tokenizer.hasMoreTokens()) {
            args.addAll(Arrays.asList("-c", tokenizer.nextToken()));
        }
        args.addAll(Arrays.asList(additionalArgs));
        return args;
    }
}
TOP

Related Classes of ideah.util.LocationUtil

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.