db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: Automatic setting of compiler classpath properties at build time
Date Mon, 19 Nov 2007 19:45:15 GMT
Daniel John Debrunner wrote:
> Rick Hillegas wrote:
>> Daniel John Debrunner wrote:
>>> Rick Hillegas wrote:
>>>
>>>> The place to add support for additional platforms/vms would be 
>>>> trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java The 
>>>> class has a pretty extensive header comment explaining what the 
>>>> class does--but please let me know if the header is unclear.
>>>
>>> At line 207 (just after this code)
>>>
>>>   if ( j14lib != null ) { setClasspathFromLib( J14LIB, j14lib ); }
>>>   if ( j15lib != null ) { setClasspathFromLib( J15LIB, j15lib ); }
>>>
>>> should the task return if both j14lib and j15lib were set? E.g.
>>>
>>> if (j14lib != null && j15lib != null)
>>>     return;
>>>
>>> Other it seems the setting of the classpath will be overwritten in 
>>> the platform specific code and for me the build fails because the vm 
>>> (Apache Harmony) is not recognized, even though I've defined j14lib 
>>> & j15lib.
>> Thanks for the quick test-drive, Dan. I don't understand what you're 
>> seeing. 
>
> One question is why does this code need to be executed if I already 
> have j14lib and j15lib set in my ant.properties?
>
>             String  jdkVendor = getProperty( JDK_VENDOR );
>
>             if ( JDK_APPLE.equals( jdkVendor ) ) { setForAppleJDKs(); }
>             else if ( JDK_IBM.equals( jdkVendor ) ) { setForIbmJDKs(); }
>             else if ( JDK_SUN.equals( jdkVendor ) ) { setForSunJDKs(); }
>
>
> Dan.
Thanks for the continuing feedback, Dan.

Without the PropertySetter patch, the pre-existing build machinery sets 
java14compile.classpath based on the value of j14lib. And this setting 
of java14compile.classpath is correct if you are using Sun JDKs. It is 
wrong if you are using IBM or Apple JDKs. If you are using IBM or Apple 
JDKs then you need to forcibly override java14compile.classpath in your 
ant.properties (and j14lib is a nop).

So the code in question performs the task of looking up the jar files in 
the j14lib and j15lib directories and setting java14compile.classpath 
and java15compile.classpath accordingly. Without this code, one of the 
following would happen:

1) In the PropertySetter as currently coded, you would fall through to 
the code which makes sure that java14compile.classpath and 
java15compile.classpath are set--and PropertySetter would abort the 
build because they are not set. That is, PropertySetter would detect 
that it had failed to perform its task.

2) If we removed that final check from PropertySetter, then, later on in 
the build machinery, we would set java14compile.classpath to the list of 
Sun libraries. Everything would work fine for Sun JDKs and fail for IBM 
and Apple environments.

Regards,
-Rick

Mime
View raw message