Change Compiler Setting & Add/Remove Excluded File in a Plugin

Answered

Hİ,

 

I'm new to IDEA plugin development and trying to find some help. I need to add/remove file to Build, Execution, Deployment/Compiler/Excludes under Preferences and also change some settings in the Build, Execution, Deployment/Java Compiler like target byte code versions. Is this possible to do in a plugin?

Thanks.

0
3 comments

Excludes can be managed using:

ExcludesConfiguration configuration = CompilerConfiguration.getInstance(project).getExcludedEntriesConfiguration();
configuration.addExcludeEntryDescription(new ExcludeEntryDescription(dirctory, true, false, project));

Java Compiler configuration is handled by the CompilerConfigurationImpl:

(CompilerConfigurationImpl) CompilerConfiguration.getInstance(project)

You can review the exact logic in JavaCompilersTab.java file

0

Thanks for the answer. But I can't seem to import com.intellij.CompilerConfiguration, com.intellij.openapi.compiler.options.ExcludesConfiguration and com.intellij.openapi.compiler.options.ExcludesConfiguration. They aren't found.

Probably there are other classes as well. It is gradle plugin project. I don't know what is wrong. Do i have some dependencies missing? Do you have any idea?

0

Do you have the Java module in your dependencies (both Gradle and plugin.xml)?

Please follow the Plugin Compatibility with IntelliJ Platform Products docs.

1

Please sign in to leave a comment.