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

com.redhat.ceylon.langtools.tools.javac.main.RecognizedOptions Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
/*
 * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package com.redhat.ceylon.langtools.tools.javac.main;

import com.redhat.ceylon.common.Constants;
import com.redhat.ceylon.common.FileUtil;
import com.redhat.ceylon.common.config.DefaultToolOptions;
import com.redhat.ceylon.javax.lang.model.SourceVersion;
import com.redhat.ceylon.langtools.tools.javac.code.Lint;
import com.redhat.ceylon.langtools.tools.javac.code.Source;
import com.redhat.ceylon.langtools.tools.javac.code.Type;
import com.redhat.ceylon.langtools.tools.javac.jvm.Target;
import com.redhat.ceylon.langtools.tools.javac.main.JavacOption.COption;
import com.redhat.ceylon.langtools.tools.javac.main.JavacOption.HiddenOption;
import com.redhat.ceylon.langtools.tools.javac.main.JavacOption.Option;
import com.redhat.ceylon.langtools.tools.javac.main.JavacOption.XOption;
import com.redhat.ceylon.langtools.tools.javac.processing.JavacProcessingEnvironment;
import com.redhat.ceylon.langtools.tools.javac.util.ListBuffer;
import com.redhat.ceylon.langtools.tools.javac.util.Options;
import com.redhat.ceylon.model.typechecker.model.Module;

import static com.redhat.ceylon.langtools.tools.javac.main.OptionName.*;

import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

/**
 * TODO: describe com.redhat.ceylon.langtools.tools.javac.main.RecognizedOptions
 *
 * 

This is NOT part of any supported API. * If you write code that depends on this, you do so at your own * risk. This code and its internal interfaces are subject to change * or deletion without notice.

*/ public class RecognizedOptions { private RecognizedOptions() {} public interface OptionHelper { void setOut(PrintWriter out); void error(String key, Object... args); void printVersion(); void printFullVersion(); void printHelp(); void printXhelp(); void addFile(File f); void addClassName(String s); } public static class GrumpyHelper implements OptionHelper { public void setOut(PrintWriter out) { throw new IllegalArgumentException(); } public void error(String key, Object... args) { throw new IllegalArgumentException(Main.getLocalizedString(key, args)); } public void printVersion() { throw new IllegalArgumentException(); } public void printFullVersion() { throw new IllegalArgumentException(); } public void printHelp() { throw new IllegalArgumentException(); } public void printXhelp() { throw new IllegalArgumentException(); } public void addFile(File f) { throw new IllegalArgumentException(f.getPath()); } public void addClassName(String s) { throw new IllegalArgumentException(s); } } static Set javacOptions = EnumSet.of( G, G_NONE, G_CUSTOM, XLINT, XLINT_CUSTOM, NOWARN, VERBOSE, VERBOSE_CUSTOM, DEPRECATION, CLASSPATH, CP, CEYLONCWD, CEYLONREPO, CEYLONSYSTEMREPO, CEYLONCACHEREPO, CEYLONNODEFREPOS, CEYLONUSER, CEYLONPASS, CEYLONNOOSGI, CEYLONOSGIPROVIDEDBUNDLES, CEYLONJIGSAW, CEYLONNOPOM, CEYLONPACK200, SOURCEPATH, CEYLONSOURCEPATH, CEYLONRESOURCEPATH, CEYLONRESOURCEROOT, BOOTCLASSPATH, XBOOTCLASSPATH_PREPEND, XBOOTCLASSPATH_APPEND, XBOOTCLASSPATH, EXTDIRS, DJAVA_EXT_DIRS, ENDORSEDDIRS, DJAVA_ENDORSED_DIRS, PROC, PROCESSOR, PROCESSORPATH, D, CEYLONOUT, CEYLONOFFLINE, CEYLONTIMEOUT, CEYLONCONTINUE, CEYLONPROGRESS, CEYLONFLATCLASSPATH, CEYLONAUTOEXPORTMAVENDEPENDENCIES, CEYLONMAVENOVERRIDES, CEYLONOVERRIDES, CEYLONDOWNGRADEDIST, S, IMPLICIT, ENCODING, SOURCE, TARGET, VERSION, FULLVERSION, DIAGS, HELP, A, X, J, MOREINFO, WERROR, // COMPLEXINFERENCE, PROMPT, DOE, PRINTSOURCE, WARNUNCHECKED, XMAXERRS, XMAXWARNS, XSTDOUT, XPKGINFO, XPRINT, XPRINTROUNDS, XPRINTPROCESSORINFO, XPREFER, O, XJCOV, XD, AT, SOURCEFILE, SRC, BOOTSTRAPCEYLON, CEYLONDISABLEOPT, CEYLONDISABLEOPT_CUSTOM, CEYLONSUPPRESSWARNINGS); static Set javacFileManagerOptions = EnumSet.of( CLASSPATH, CP, CEYLONCWD, CEYLONREPO, CEYLONSYSTEMREPO, CEYLONCACHEREPO, CEYLONNODEFREPOS, CEYLONUSER, CEYLONPASS, CEYLONNOOSGI, CEYLONOSGIPROVIDEDBUNDLES, CEYLONJIGSAW, CEYLONNOPOM, CEYLONPACK200, SOURCEPATH, CEYLONSOURCEPATH, CEYLONRESOURCEPATH, CEYLONRESOURCEROOT, BOOTCLASSPATH, XBOOTCLASSPATH_PREPEND, XBOOTCLASSPATH_APPEND, XBOOTCLASSPATH, EXTDIRS, DJAVA_EXT_DIRS, ENDORSEDDIRS, DJAVA_ENDORSED_DIRS, PROCESSORPATH, D, CEYLONOUT, CEYLONOFFLINE, CEYLONTIMEOUT, CEYLONCONTINUE, CEYLONPROGRESS, CEYLONFLATCLASSPATH, CEYLONAUTOEXPORTMAVENDEPENDENCIES, CEYLONMAVENOVERRIDES, CEYLONOVERRIDES, CEYLONDOWNGRADEDIST, S, ENCODING, SOURCE, SRC); static Set javacToolOptions = EnumSet.of( G, G_NONE, G_CUSTOM, XLINT, XLINT_CUSTOM, NOWARN, VERBOSE, VERBOSE_CUSTOM, DEPRECATION, PROC, PROCESSOR, IMPLICIT, SOURCE, TARGET, // VERSION, // FULLVERSION, // HELP, A, // X, // J, MOREINFO, WERROR, // COMPLEXINFERENCE, PROMPT, DOE, PRINTSOURCE, WARNUNCHECKED, XMAXERRS, XMAXWARNS, // XSTDOUT, XPKGINFO, XPRINT, XPRINTROUNDS, XPRINTPROCESSORINFO, XPREFER, O, XJCOV, XD, BOOTSTRAPCEYLON, CEYLONDISABLEOPT, CEYLONDISABLEOPT_CUSTOM, CEYLONSUPPRESSWARNINGS); public static Option[] getJavaCompilerOptions(OptionHelper helper) { return getOptions(helper, javacOptions); } public static Option[] getJavacFileManagerOptions(OptionHelper helper) { return getOptions(helper, javacFileManagerOptions); } public static Option[] getJavacToolOptions(OptionHelper helper) { return getOptions(helper, javacToolOptions); } static Option[] getOptions(OptionHelper helper, Set desired) { ListBuffer




© 2015 - 2024 Weber Informatics LLC | Privacy Policy