The enclosed file(s) demonstrate an error, is this by design or a bug in ant?
    
If initialized as shown in my build file, target "init" the property file is not visible outside of the target from which it is loaded, if initialized as shown in my build file, targets "init2" or "init3" the property file is visible globally.

 

-          George Lawrence Storm,

-          Senior Macintosh Software Developer

-          DivX, Inc.

 

 

<?xml version="1.0"?>

<!-- This file demonstraits an error I discovered when creating my ant script.
		If initilized as shown in target "init" the property file is not visable outside of the target from which it is loaded,
		if initilized as shown in targets "init2" or "init3" the property file is visable globally.
		25Sept2006, GLS -->

<project name="BooBooBuild" default="init" basedir=".">

    <!-- Default version information -->
    <property name="label" value="00_00_00_00000_Boo_Boo_Build"/>

    <!-- Initilization -->
	<target name="init">
		<!-- Load properties file (fails) -->
		<echo message="Starting preferred initialization"/>
		<antcall target="init-debug"/>
		<antcall target="init-release"/>
		<antcall target="echosdkname"/>
	</target>

    <!-- Special initilization (works) -->
	<target name="init2">
		<!-- Load properties file -->
		<echo message="Starting direct initialization"/>
		<loadproperties srcFile="debug.properties.xml"/>
		<antcall target="echosdkname"/>
	</target>

    <!-- Special initilization (works) -->
	<target name="init3" depends="init-debug,init-release">
		<!-- Load properties file -->
		<echo message="Starting direct initialization"/>
		<loadproperties srcFile="debug.properties.xml"/>
		<antcall target="echosdkname"/>
	</target>

    <!-- Debug Initilization -->
	<target name="init-debug" unless="release.build">
		<!-- Load properties file -->
		<echo message="Loading debug properties"/>
		<loadproperties srcFile="debug.properties.xml"/>
		<echo message="Debug properties loaded"/>
		<!-- Echo the SDK name -->
		<echo message="The SDK name is:${sdkname}"/>
	</target>

    <!-- Release Initilization -->
	<target name="init-release" if="release.build">
		<!-- Load properties file -->
		<echo message="Loading release properties"/>
		<loadproperties srcFile="release.properties.xml"/>
		<echo message="Release properties loaded"/>
		<!-- Echo the SDK name -->
		<echo message="The SDK name is:${sdkname}"/>
	</target>
 
    <!-- Release Initilization -->
	<target name="echosdkname">
		<!-- Echo the SDK name -->
		<echo message="The SDK name is:${sdkname}"/>
	</target>
 
</project>
sdkname=My Debug SDK v0.0 -debug
sdkname=My Release SDK v0.0
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to