Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Getting the project for a PRE_BUILD event

Hi all,

 

I’ve registered a PRE_BUILD listener and I need to work out which project is being built so I can make some changes (if needed) to the project environment. I know I can’t use getResource() on PRE_BUILD events but if I use getSource() then I always seem to get a workspace. My code looks something like this:

 

public void resourceChanged(IResourceChangeEvent event) {

                                Object res = event.getSource();

                                if(res instanceof IProject)

                                {

                                                // Some code here

}

}

 

Can anybody point me at how to get the right project.

 

Thanks

 

Phil


Back to the top