| Summary: | Add ability to set autotools options in templates | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Jon Beniston <jon> | ||||||
| Component: | Autotools | Assignee: | Jeff Johnston <jjohnstn> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 169364 [details]
Patch to add support for SetAutotoolsStringOptionValue process
Add suggested patch to implement this feature. (In reply to comment #2) > Add suggested patch to implement this feature. Not sure why you have a double-loop in setOptionValue. The call to get the project description and get the configurations does not use the outer loop. As well, do the user advanced options occur before or after this setting operation. If it is after, then you don't need to synchronize configurations as you are creating the configurations via the template and the user cannot throw you any curves. If the user can do Advanced Settings and play around with Project properties, then you need to do the sync before you access the AutotoolConfigurationManager. The following is what I think it should be if the user can throw you a curve: private void setOptionValue(IProject projectHandle, String id, String value) throws BuildException, ProcessFailureException { AutotoolsConfigurationManager.getInstance().syncConfigurations(projectHandle); ICConfigurationDescription[] cfgds = CoreModel.getDefault().getProjectDescription(projectHandle).getConfigurations(); if (cfgds != null && cfgds.length >= 1) { IAConfiguration iaConfig = AutotoolsConfigurationManager.getInstance().getConfiguration(projectHandle, cfgds[0].getId()); iaConfig.setOption(id, value); } } If not, then the sync call can be removed. Have you tried testing this? The outer loop was just a cut and paste error from the MSB code. It should be removed. I just tried your version of the function and it seemed to work ok (at least for the template I tried it with). (In reply to comment #4) > The outer loop was just a cut and paste error from the MSB code. It should be > removed. > > I just tried your version of the function and it seemed to work ok (at least > for the template I tried it with). Can you try using the Advanced Settings button to verify that the initial options are already set up for the default configuration? This will verify that there is no need for a sync operation and I will check in the patch without it. Just a note that we can't accept patch contributions for Helios beyond tomorrow :) If I don't have the call to the syncConfigurations() and run the wizard without pressing the "Advanced settings..." button, then none of the settings appear in the .autotools file. So it looks like in this case it (or something else) is needed. If I do press the advance settings button, then settings to appear in the GUI and .autotools file. It does appear that using syncConfigurations does cause a problem with the advanced settings page. If the call to syncConfigurations comes before the call to setOption - then it appears that none of the of the changes you make in the GUI appear in the .autotools file. If the call to syncConfigurations comes after the call to setOption - the the user can only change settings which aren't set by setOption. (In reply to comment #8) > It does appear that using syncConfigurations does cause a problem with the > advanced settings page. > > If the call to syncConfigurations comes before the call to setOption - then it > appears that none of the of the changes you make in the GUI appear in the > .autotools file. > > If the call to syncConfigurations comes after the call to setOption - the the > user can only change settings which aren't set by setOption. Can you provide your test template for reference? Created attachment 170114 [details]
Example template
Here's the template I've been using - the variables are set by a Java class, so you might not be able to use this on it's own.
Comment on attachment 169364 [details]
Patch to add support for SetAutotoolsStringOptionValue process
Setting iplog flag.
Patch has been applied with the original modification shown earlier. Any problems with Advanced Settings can be opened as a separate bug. |
Build Identifier: M20090917-0800 When creating a template for an autotools project, there doesn't appear to be a way to set any of the autotools options as part of the template, as you can do for the managed builder projects, with the org.eclipse.cdt.managedbuilder.core.SetMBSStringOptionValue process. I propose adding a org.eclipse.linuxtools.cdt.autotools.core.SetAutotoolsStringOptionValue process. This could be used in templates as follows: <process type="org.eclipse.linuxtools.cdt.autotools.core.SetAutotoolsStringOptionValue"> <simple name="name" value= "$(projectName)"/> <complex-array name="resourcePaths"> <element> <simple name="id" value="configure" /> <simple name="value" value="configure CC_FOR_TARGET="$(target)-gcc"" /> </element> <element> <simple name="id" value="configdir" /> <simple name="value" value="$(src_dir)" /> </element> </complex-array> </process> Reproducible: Always