Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to pass compiler plugin options? #415

Unanswered
NeonMika asked this question in Q&A
Discussion options

Hello!

I want to also use my commandLineProcessor together with my compilerPluginRegistrar, yet I struggle to provide the compiler plugin options (in the form of -P plugin:<plugin id>:<key>=<value>) to the compiler.

What I have tried so far:

// ...
KotlinCompilation().apply {
 sources = sourceFiles
 commandLineProcessors = listOf(MyCliProcessor())
 compilerPluginRegistrars = listOf(MyCompilerPluginRegistrar())
 // how do I pass compiler plugin options?
 // neither of the following works:
 // kotlincArguments = listOf(""-P plugin:mypluginid:enabled=true")
 // kotlincArguments = listOf(""-P plugin:com.tschuchort.compiletesting.maincommandlineprocessor.mypluginid:enabled=true")
 // kotlincArguments = listOf(""-P plugin:com.tschuchort.compiletesting.maincommandlineprocessor:mypluginid:enabled=true")
}

Providing no compiler plugin option results in the following error, thus I came up with the above mentioned versions:

e: Required plugin option not present: com.tschuchort.compiletesting.maincommandlineprocessor:myplugin:enabled
Plugin "com.tschuchort.compiletesting.maincommandlineprocessor" usage:
 mypluginid:enabled <true|false>
 whether plugin is enabled (required)

Can you help me to correctly configure my commandLineProcessor?

Thank you!

Best,
Markus

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /