How can I modify the project compiler output directory of a project?

Answered

Using this:

val p = ProjectRootManager.getInstance(project)

I can see the `sdkName` and other properties of that project but not the project compiler output. How can I modify it?

 

 

0
4 comments
Official comment

It's CompilerProjectExtension.getInstance(project).setCompilerOutputUrl(...). There's also CompilerModuleExtension.

Official comment

Hi Cedric,

 

I believe it should be something like this:

CompilerProjectExtension.getInstance(project).setCompilerOutputUrl(VfsUtilCore.pathToUrl(path))

Indeed it is, thanks Alexander and Peter!

What could I have done to find this in the documentation? I spent a while trying to find it :-)

 

 

0

The only thing that comes to mind is Goto Symbol "setCompilerOutput". We can mention it in documentation somewhere, but I've no idea where. CompilerProjectExtension is java-specific and ProjectRootManager isn't, so the latter probably shouldn't refer to the former.

0

Please sign in to leave a comment.