Export Sets - Internal format

Export Sets are stored as standard ANT scripts based upon new Ant task types added by CodePro, and as such can be treated exactly like a standard ANT script. This includes manually editing the Export Set file to add ANT operations not covered in the Export Set wizard, and running an Export set at any time by right-clicking on it in the workbench window and selecting the "Run Ant..." command.  An example of one export set nested inside another export set follows.

export.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- Export the CodePro Project to a variety of configurations.  -->
<project name="ExportSet" basedir="." default="export">
	<target name="export">
		<InitExportProperties/>
		<ExportSet path="/CodePro/export_1.xml" inheritAll="false">
			<property name="Parameter1" value="value1"/>
			<property name="Parameter2" value="value2"/>
		</ExportSet>
		<ExportSet path="/TestFoo/export_2.xml"/>
		<ExportSet path="/TestFoo/export_3.xml">
			<property name="ParameterX" value="valueX"/>
		</ExportSet>
	</target>
</project>

In the Export Set example above, the project element contains a target element named "export". The Export Set Wizard can edit any existing ANT script, looking for a target named "export", creating it if necessary. The wizard only regenerates the "export" target, leaving all other aspects of the ANT script in tact.

In the example above, there are four operations defined in the Export Set:

  • InitExportProperties - initializes the ${eclipse.workspace.root} variable (amoung others), but (in this case) does not define any parameters or properties.  The Export Set Wizard automatically ensures that the "export" target contains exactly one "InitExportProperties" operation as the first step.

  • ExportSet - three calls to nested export sets, some of which pass parameters.   The inheritAll="false" indicates that the properties defined in export.xml are not available for use during execution of export_1.xml.

export_1.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- Export the CodePro Project to a variety of configurations. -->
<project name="ExportSet" basedir="." default="export">
	<target name="export">
		<InitExportProperties>
			<ExportParameters>
				Parameter1
				Parameter2="aDefValue"
			</ExportParameters>
			<ExportProperties>
				Property1="myValue"
			</ExportProperties>
		</InitExportProperties>
		<ExportToFileSystem destinationPath="G:/export-out/files">
			<Resources>
				/CodeProStudioDemo
			</Resources>
		</ExportToFileSystem>
		<ExportToJarFile jarLocation="G:/export-out/export.jar">
			<Resources>
				/CodeProStudioDemo
			</Resources>
		</ExportToJarFile>
		<ExportToZipFile destinationFilename="G:/export-out/export.zip">
			<Resources>
				/CodeProStudioDemo
			</Resources>
		</ExportToZipFile>
	</target>
</project>

In the example above, there are four operations defined in the Export Set:

  • InitExportProperties - initializes the ${eclipse.workspace.root} variable (amoung others) and (in this case) defines two parameters and one property.  The first parameter has no value associated with it, and thus is "required" and must be defined by the outer export set that contains this nested export set

  • ExportToFileSystem - exports the "CodePro Demo" project to the "G:\export-out\files" directory

  • ExportToJarFile - exports the "CodePro Demo" project to the "G:\export-out\export.jar" file

  • ExportToZipFile - exports the "CodePro Demo" project to the "G:\export-out\export.zip" file

Any standard ANT operation may be added anywhere in the "export" target, so long as it appears after the "InitExportProperties" operation. When edited using the Export Set Wizard, these new ANT operations that were manually added will appear in the wizard, but will not be editable. If after manually adding new ANT operations, the "export" target then depends upon another ANT target in the same file, a "depends" attribute may be added to the "export" target specifying target upon which the "export" target depends. This "depends" attribute will be faithfully regenerated by the Export Set wizard. Over time, we will be adding more operations that are editable in the Export Set Wizard. If there are particular ANT operations, Eclipse Export operations, or new operations that you would like to see, then please let us know.

See the online Jakarta docs for more information about ANT...