Determine source roots from external builder
Hi,
In my external builder I need to access a properties file with some configuration information. By convention I know it is located in the root of the "source root" as it is called in the module settings.
Unfortunately I don't find a way to get a hold on this information.
- The code below almost gets me there but it give the path to the individuals file while I look for the top level source directory
for (ModuleBuildTarget target : chunk.getTargets()) {
try {
final SourceToOutputMapping srcToOut = context.getProjectDescriptor().dataManager.getSourceToOutputMap(target);
- I read about the use of ProjectFileIndex.SERVICE in http://devnet.jetbrains.com/message/5490787#5490787 but that does not do the trick for me
Any help would be much appreciated.
Regards,
Johan
Please sign in to leave a comment.
Hello,
you can get all source roots by calling
target.getModule().getSourceRoots(JavaSourceRootType.SOURCE).
--
Nikolay Chashnikov
Software Developer
JetBrains
http://www.jetbrains.com
"Develop with pleasure!"