Bug 112418 - PDE generate build file and ant task eclipse.buildScript ignore javaSource and javaTarget
Summary: PDE generate build file and ant task eclipse.buildScript ignore javaSource a...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 112419 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-12 20:11 EDT by Adrian Grealish CLA
Modified: 2005-10-31 06:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Grealish CLA 2005-10-12 20:11:05 EDT
The PDE Create Ant build file option and the <eclipse.buildScript> ant task 
both create a build file with 

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

I want to override these values so they are 

<property name="javacSource" value="1.5"/>
<property name="javacTarget" value="1.5"/>

I have placed these values in teh build.properties file and they seem to be 
ignored.
Comment 1 Adrian Grealish CLA 2005-10-12 20:18:27 EDT
*** Bug 112419 has been marked as a duplicate of this bug. ***
Comment 2 Pascal Rapicault CLA 2005-10-12 21:34:10 EDT
We are currently working on a support that will derive those values from the
Bundle-RequireExecutionEnvironment header provided in bundle manifests and that
will also let people override that value in the build.properties of each plugin.
Stay tuned here, it should be ready for next week I build.
Comment 3 Pascal Rapicault CLA 2005-10-18 09:40:41 EDT

*** This bug has been marked as a duplicate of 109510 ***
Comment 4 Sonia Dimitrov CLA 2005-10-18 10:41:21 EDT
Moving to JDT Core for comment.  If I hard-code the source and target values 
in the Ant javac call to 1.5, I get the following error:
"Compliance level '1.4' is incompatible with source level '1.5'. A compliance 
level '1.5' or better is required"

The debug output below does not show source or target as compiler args and it 
includes the 1.4 java runtime libraries in the classpath.

    [javac] Using JDT compiler
FileSet: Setup scanner in 
dir /builds/eclipsebuilder200510171607/jdk/linuxppc/IBMJava2-ppc-
142/jre/lib/ext with patternSet{ includes: [*] excludes: [] }
    [javac] Compilation arguments:
    [javac] '-noExit'
    [javac] '-bootclasspath'
    
[javac] '/builds/eclipsebuilder200510171607/eclipseInternalBuildTools/jdks/jdk1
.5.0_03/jre/lib/rt.jar'
    [javac] '-classpath'
    [javac] '/builds/eclipsebuilder200510171607/jdk/linuxppc/IBMJava2-ppc-
142/jre/lib/ext/dumpfmt.jar:/builds/eclipsebuilder200510171607/jdk/linuxppc/IBM
Java2-ppc-
142/jre/lib/ext/gskikm.jar:/builds/eclipsebuilder200510171607/jdk/linuxppc/IBMJ
ava2-ppc-
142/jre/lib/ext/ibmjcefips.jar:/builds/eclipsebuilder200510171607/jdk/linuxppc/
IBMJava2-ppc-
142/jre/lib/ext/ibmjceprovider.jar:/builds/eclipsebuilder200510171607/jdk/linux
ppc/IBMJava2-ppc-
142/jre/lib/ext/ibmjsseprovider2.jar:/builds/eclipsebuilder200510171607/jdk/lin
uxppc/IBMJava2-ppc-
142/jre/lib/ext/ibmpkcs11impl.jar:/builds/eclipsebuilder200510171607/jdk/linuxp
pc/IBMJava2-ppc-
142/jre/lib/ext/indicim.jar:/builds/eclipsebuilder200510171607/jdk/linuxppc/IBM
Java2-ppc-
142/jre/lib/ext/jaccess.jar:/builds/eclipsebuilder200510171607/jdk/linuxppc/IBM
Java2-ppc-
142/jre/lib/ext/ldapsec.jar:/builds/eclipsebuilder200510171607/jdk/linuxppc/IBM
Java2-ppc-
142/jre/lib/ext/oldcertpath.jar:/builds/eclipsebuilder200510171607/src/plugins/
org.eclipse.core.filesystem/temp.folder/@dot.bin:/builds/eclipsebuilder20051017
1607/src/plugins/org.eclipse.core.runtime/@dot:/builds/eclipsebuilder2005101716
07/src/plugins/org.eclipse.osgi/@dot:/builds/eclipsebuilder200510171607/src/plu
gins/org.eclipse.core.filesystem/src'
    [javac] '-d'
    
[javac] '/builds/eclipsebuilder200510171607/src/plugins/org.eclipse.core.filesy
stem/temp.folder/@dot.bin'
    [javac] '-log'
    
[javac] '/builds/eclipsebuilder200510171607/src/plugins/org.eclipse.core.filesy
stem/temp.folder/@dot.bin.log'
    [javac] '-proceedOnError'
    [javac] '-enableJavadoc'
    [javac] '-encoding'
    [javac] 'ISO-8859-1'
    [javac]
Comment 5 Sonia Dimitrov CLA 2005-10-18 10:46:24 EDT
I used 3.2M2.
Comment 6 Olivier Thomann CLA 2005-10-18 11:09:11 EDT
The problem comes from the fact that the runtime used to run Ant is still 1.4.
So we end up inferring a default compliance in the javac adapter to compliance
1.4 (based on the runtime).
Then we pass the source and target levels and in the batch we validate these
settings. In this case they don't match so we stop.
One workaround would be to run on a 1.5 JRE. This would fix this issue.
One fix we can provide is not to infer a compliance based on the runtime if a
source target has been provided. If a source target is provided, it should imply
the corresponding compliance if none is specified.
Comment 7 Sonia Dimitrov CLA 2005-10-18 13:25:36 EDT
Unfortunately, we don't have a readily available 1.5 JDK release for our Linux 
PPC build machine at this time.
Comment 8 Olivier Thomann CLA 2005-10-18 13:56:58 EDT
I'll check what we can do in order to fix this case (running on top of 1.4, but
providing 1.5 libraries and using 1.5 source and target).
Comment 9 Olivier Thomann CLA 2005-10-18 15:20:56 EDT
Fixed and released in HEAD.
If the target and source are specified, we should use them as much as possible
to set the compliance.
It is only if source is 1.3 that we need to check the runtime to know if we
should set the compliance to 1.4 or 1.3.
Otherwise:
source 1.4 => compliance 1.4
source 1.5 => compliance 1.5

Fixed and released in HEAD.
No regression tests, bu Sonia checked that this fixed the problem.
Thanks Sonia for your help.
Comment 10 Olivier Thomann CLA 2005-10-18 15:22:17 EDT
Only the ant adapter is affected by this fix.
Comment 11 Frederic Fusier CLA 2005-10-31 06:19:37 EST
Already verified for 3.2 M3...