Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 55353

Summary: [workspace] generated build script should use preference setting for source and target
Product: [Eclipse Project] PDE Reporter: Sebastian Davids <sdavids>
Component: BuildAssignee: Andrew Niefer <aniefer>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: chris, emissary, frederic, wassim.melhem
Version: 3.0   
Target Milestone: 3.2 M4   
Hardware: PC   
OS: All   
Whiteboard:

Description Sebastian Davids CLA 2004-03-19 07:48:45 EST
The values for "Source Compatibility" and "Generated .class files compatibility"
(entered on pref page Window/Preferences/Plug-in Development/Build Options)
should be used when creating a build script through PDE Tools/Create Ant Build
File (from context menu of plugin.xml).

At the momement the script will contain

	<property name="javacSource" value="1.3"/>
	<property name="javacTarget" value="1.1"/>

No matter what the preferences are.

The build options should be the same whether I build within Eclipse or through
an ANT script in my opinion.
Comment 1 Wassim Melhem CLA 2004-03-19 09:30:00 EST
Yes, but when PDE creates the ant launch configuration for you, we override 
these values in the config using the ones specified on the pref page.
Also, when we export, we use the values on the pref page to override the ones 
in the script.

Moving to PDE/Build to close or continue this discussion.
Comment 2 Pascal Rapicault CLA 2004-03-19 09:40:20 EST
Keep open as an enhancement.
Comment 3 Pascal Rapicault CLA 2004-03-22 22:03:43 EST
*** Bug 49338 has been marked as a duplicate of this bug. ***
Comment 4 Frederic Fays CLA 2004-04-09 06:26:39 EDT
Clements Drews have located the two lines of code making the trouble since ... the 13th october 2003:

see http://dev.eclipse.org/newslists/news.eclipse.platform/msg07878.html

"
OK, did a little more research... I guess the culprit is in
org.eclipse.pde.internal.build.builder.ModelBuildScriptGenerator

----

449: script.printProperty(PROPERTY_JAVAC_SOURCE, "1.4"); //$NON-NLS-1$

450: script.printProperty(PROPERTY_JAVAC_TARGET, "1.4"); //$NON-NLS-1$

---
Is this worth filing a bug report?
- Clemens
"

So, why is it so difficult to resolve once and for all this issue ?

Every time I make a release for my project, the generated build files are wrong, and it definitively very 
annoying !

Please, please, made the required corrections and ship them !!!

Thanks,

Frédéric
Comment 5 Wassim Melhem CLA 2004-04-09 12:26:09 EDT
Pascal, since PDE/UI knows what the user preferences are, couldn't we just 
pass you a map for the desired values of the following properties and you 
could set them correctly in the generated build.xml:

basews,baseos, basenl, basearch, javacFailOnError, javacDebugInfo, 
javacVerbose, javacSource, javacTarget.

If a map is not passed in (i.e. as during the RelEng build), then it's 
business as usual for you.
Comment 6 Pascal Rapicault CLA 2004-04-29 09:55:56 EDT
*** Bug 38067 has been marked as a duplicate of this bug. ***
Comment 7 Frederic Fays CLA 2004-04-30 04:22:39 EDT
I don't understand the point to transfer a custom map with the required properties as you can found 
every one of them in the preference store of the PDE Plugin !

e.g.

PDEPlugin.getDefault().getPreferenceStore().getString("javacSource");
PDEPlugin.getDefault().getPreferenceStore().getString("javacTarget");

Comment 8 Wassim Melhem CLA 2004-04-30 10:05:51 EDT
Regarding comment #7, pde-build (the plugin generating the script) is a non-UI 
plug-in, has no access to preference pages and is lower than pde-ui in the 
dependency chain.  That is why it has no access to the preferences owned by 
PDE-UI.

So if this bug is to be resolved, the only way I could see it happening is if 
pde-ui passed in the value preferences to pde-build before the build script 
gets generated.
Comment 9 Pascal Rapicault CLA 2005-06-02 12:14:18 EDT
*** Bug 97512 has been marked as a duplicate of this bug. ***
Comment 10 Pascal Rapicault CLA 2005-11-27 10:34:53 EST
The PDE Build part of the problem has been addressed.
Closing as fixed.