IDEA: created a infrastructure for saving any compiler settings.
Added "generate no warnings" to Settings.
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.cli.common.arguments;
|
||||
|
||||
public interface CommonArgumentConstants {
|
||||
String SUPPRESS_WARNINGS = "warnings";
|
||||
}
|
||||
+13
-1
@@ -18,7 +18,11 @@ package org.jetbrains.jet.cli.common.arguments;
|
||||
|
||||
import com.sampullara.cli.Argument;
|
||||
|
||||
import static org.jetbrains.jet.cli.common.arguments.CommonArgumentConstants.SUPPRESS_WARNINGS;
|
||||
|
||||
public abstract class CommonCompilerArguments extends CompilerArguments {
|
||||
public static final CommonCompilerArguments DUMMY = new DummyImpl();
|
||||
|
||||
@Argument(value = "tags", description = "Demarcate each compilation message (error, warning, etc) with an open and close tag")
|
||||
public boolean tags;
|
||||
@Argument(value = "verbose", description = "Enable verbose logging output")
|
||||
@@ -60,6 +64,14 @@ public abstract class CommonCompilerArguments extends CompilerArguments {
|
||||
|
||||
@Override
|
||||
public boolean suppressAllWarnings() {
|
||||
return "warnings".equalsIgnoreCase(suppress);
|
||||
return SUPPRESS_WARNINGS.equalsIgnoreCase(suppress);
|
||||
}
|
||||
|
||||
// Used only for serialize and deserialize settings. Don't use in other places!
|
||||
public static final class DummyImpl extends CommonCompilerArguments {
|
||||
@Override
|
||||
public String getSrc() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -19,6 +19,9 @@ package org.jetbrains.jet.cli.common.arguments;
|
||||
import com.sampullara.cli.Argument;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.CALL;
|
||||
import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.NO_CALL;
|
||||
|
||||
/**
|
||||
* NOTE: for now K2JSCompiler supports only minimal amount of parameters required to launch it from the plugin.
|
||||
*/
|
||||
@@ -39,7 +42,8 @@ public class K2JSCompilerArguments extends CommonCompilerArguments {
|
||||
public String target;
|
||||
|
||||
@Nullable
|
||||
@Argument(value = "main", description = "Whether a main function should be called; either 'call' or 'noCall', default 'call' (main function will be auto detected)")
|
||||
@Argument(value = "main", description = "Whether a main function should be called; either '" + CALL +
|
||||
"' or '" + NO_CALL + "', default '" + CALL + "' (main function will be auto detected)")
|
||||
public String main;
|
||||
|
||||
@Override
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.cli.common.arguments;
|
||||
|
||||
public interface K2JsArgumentConstants {
|
||||
String CALL = "call";
|
||||
String NO_CALL = "noCall";
|
||||
}
|
||||
Reference in New Issue
Block a user