Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Build variables in CDT

Thank you for the quick review, Sergey!

I have fixed the suggested points and attached the fixed patches:
[1] - https://bugs.eclipse.org/bugs/show_bug.cgi?id=180256
[2] - https://bugs.eclipse.org/bugs/show_bug.cgi?id=375814


I am wondering whether these changes could be available for Juno. The [2] patch is quite small (176 lines) and does not require IP review, so it seems there is no problem with it. The [1] patch is more than the limit (556 lines), however, as I said above, I can divide it on GUI/non-GUI part (which will practically in half) and provide a separate patches.


Thanks,
Anton

-------- Original message --------
One more thing.

On Sun, Apr 1, 2012 at 5:39 PM, Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx> wrote:
Anton,

The patches look good. Couple minor points:
1. "cdt_" prefix is not needed in cdt_config_name and cdt_config_description.
2. Please don't create (non-javadoc) comments for overriden methods. They don't add any value.
3. Please externalize descriptions of the new variables in plugin.xml. 

Could you please attach cdt_vars_in_capplication_path.patch to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=180256, file another feature request for the new build variables and attach cdt_build_variables.patch to it. 

-sergey

On Fri, Mar 30, 2012 at 3:31 AM, xgsa <xgsa@xxxxxxxxx> wrote:
Hi,

As nobody answered on my suggestions in previous mail I decided to provide the patches implementing them. I haven't file the bugs yet just because I am not sure that these suggestions will be accepted by the community. If they are I'll do it.

The "cdt_vars_in_capplication_path.patch" implements variables substitution for "C/C++ Application" field in Launch Configuration dialog. It also adds the "Variables..." buttons for the Main tab (actually they are two different patches merged in one to be logically completed, however I can provide them separately if necessary).

The "cdt_build_variables.patch" implements a few Eclipse variables "cdt_config_name" and "cdt_config_description" which return the CDT active configuration name/description for the project specified as an argument.

Please let me know whether such suggestions (and solutions) are accepteble and if they are I'll file the bugs and we'll discuss the details there.


Thanks,
Anton

-------- Original message --------
Hi,

Recently I investigated how the CDT build variables work in different places. I discovered the following:
  • in Launch Configuration dialog only Eclipse Platform variables work and only in "Arguments" and "Working directory" fields, but not in "C/C++ Application".
  • in project properties --> "C/C++ Build" and "Paths and Symbols" there are also a lot of useful variables (ConfigName, ConfigDescription, CDTVersion and others).
  • in "Modify Make Target" dialog the Eclipse and CDT variables work fine, however there is no "Variables..." button.
Probably there are also other places where variables are substituted, but I want to discuss these ones.

Firstly, I am wondering why variable substitution does not work for "C/C++ Application". It seems it is easy to implement the necessary functionality similarly to the "Working directory". If it was not implemented just because nobody need it and there is no objections I can file a bug and provide a patch.

Secondly, I cannot understand why CDT variables are implemented via the own manager, but not as Eclipse Platform variables. I also found the bug 180256 ("Launch configurations should support build variables") in which Doug describes the problem with platform variables extension. However I cannot see the problem. I tried to implement ConfigName as a Platform variable like this:
public class MyCDTVersion implements IDynamicVariableResolver {
    @Override
    public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
        IDynamicVariable projectName = VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable("project_name");
        IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName.getValue(null));
        ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(project);
        return projectDescription.getActiveConfiguration().getName();
    }
}
And it works fine. It seems that other variables can also be implemented. So is that comment actual for now? I want to have at least ConfigName and ConfigDescription to use them in Launch Configuration Dialog. I can provide a patch for that.

An the last one, probably "Modify Make Target" dialog should be updated. I cannot find the corresponding bug. Did I miss it or should I create a new one?


Thanks,
Anton.
_______________________________________________ cdt-dev mailing list cdt-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________ cdt-dev mailing list cdt-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top