BuildRootDescriptors

Hi all,

I'm working on a plugin, the work is based on the study of the Erlang plugin.
I have a problem with the method findParentDescriptor of the BuildRootIndex class.

In my code, I have the following

BuildRootIndex buildRootIndex = context.getProjectDescriptor().getBuildRootIndex();
root = buildRootIndex.findParentDescriptor(new File(filePath), targetTypes, context);

I always get null value for root. I guess it is because I'm missing something about when the table used by this function should be populated. My question is
- what is the purpose of the class BuildRootDescriptors
- do I have to populate the table manually, if so when am I suppose to do it
- is there some entry to add to the file plugin.xml to have this doing the job

Best regards

3 comments
Comment actions Permalink
Official comment

Hello,

findParentDescriptor searches for a input root of a build target (returned by BuildTarget.computeRootDescriptors). What kind of root do you want to get? What is passed as 'targetTypes' parameter?

Comment actions Permalink

Thanks for your Help,

My objective was to obtain SourceRootDescriptor in order to call its method getTarget.

targetTypes is a simple customized targetType.

 

0
Comment actions Permalink

So is a proper root directory returned from 'computeRootDescriptors' for your custom target? You can also debug BuildRootIndexImpl class, it's quite simple (here is described how to debug the build process).

 
0

Please sign in to leave a comment.