CommandLineProcessor infrastructure added

This commit is contained in:
Andrey Breslav
2014-09-23 18:19:48 +04:00
committed by Yan Zhulanow
parent 565ce5a781
commit d961e2f5b4
5 changed files with 165 additions and 5 deletions
+1
View File
@@ -8,6 +8,7 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="intellij-core" level="project" />
<orderEntry type="library" name="kotlin-runtime" level="project" />
</component>
</module>
@@ -0,0 +1,37 @@
/*
* Copyright 2010-2014 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.kotlin.compiler.plugin
import org.jetbrains.jet.config.CompilerConfiguration
public class CliOption(
public val name: String,
public val valueDescription: String,
public val description: String,
public val required: Boolean = true,
public val allowMultipleOccurrences: Boolean = false
)
public class CliOptionProcessingException(message: String, cause: Throwable? = null): RuntimeException(message, cause)
public trait CommandLineProcessor {
public val pluginId: String
public val pluginOptions: Collection<CliOption>
[throws(javaClass<CliOptionProcessingException>())]
public fun processOption(option: CliOption, value: String, configuration: CompilerConfiguration)
}