Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Querying project build configurations

Hi all,

I'm trying to determine whether the given resource is excluded from
build in the active build configuration. The code is like that:

    private static boolean isExcludedFromBuild(IResource resource) {
        IProject prj = resource.getProject();
        // Read-only project description
        ICProjectDescription cProjDescr =
CoreModel.getDefault().getProjectDescription(prj, false);
        ICConfigurationDescription activeConf =
cProjDescr.getActiveConfiguration();
        IPath path = resource.getProjectRelativePath();
        // Can use parent description if absent
        ICResourceDescription cResDescr =
activeConf.getResourceDescription(path, false);
        return cResDescr.isExcluded();
    }

Problem: configuration 'activeConf' appears to contain no resource
descriptions besides the project root, although the project indeed
contains some excluded files and folders, and the configuration
instance updated by the corresponding CDT widget looks just as
expected (and ids of configurations in question are same).

Looks like I'm missing something important. So, what am I doing wrong?


Back to the top