<?xml version="1.0" encoding="UTF-8"?>
<project name="publish-top-level" xmlns:aws="antlib:org.springframework.build.aws">

	<target name="publish" depends="publish-multi-bundle.publish, publish-package"
			description="Publish package, Ivy, and Maven artifacts"/>

	<target name="publish-package" depends="aws.init">
		<checksum file="${package.output.file}" algorithm="sha1"/>
		<checksum file="${artifacts.dir}/${package.basename}-with-dependencies.zip" algorithm="sha1"/>
		
		<aws:s3 accessKey="${accessKey}" secretKey="${secretKey}">
			<upload bucketName="dist.${bucket.basename}" file="${package.output.file}"
					toFile="${adjusted.release.type}/${project.key}/${package.file.name}" publicRead="true">
				<metadata name="project.name" value="Spring Web Flow"/>
				<metadata name="release.type" value="${release.type}"/>
				<metadata name="bundle.version" value="${bundle.version}"/>
				<metadata name="package.file.name" value="${package.file.name}"/>
			</upload>
			<upload bucketName="dist.${bucket.basename}" file="${package.output.file}.sha1"
					toFile="${adjusted.release.type}/${project.key}/${package.file.name}.sha1" publicRead="true"/>
			<upload bucketName="dist.${bucket.basename}" file="${artifacts.dir}/${package.basename}-with-dependencies.zip"
					toFile="${adjusted.release.type}/${project.key}/${package.basename}-with-dependencies.zip" publicRead="true">
				<metadata name="project.name" value="Spring Web Flow"/>
				<metadata name="release.type" value="${release.type}"/>
				<metadata name="bundle.version" value="${bundle.version}"/>
				<metadata name="package.file.name" value="${package.basename}-with-dependencies.zip"/>
			</upload>
			<upload bucketName="dist.${bucket.basename}" file="${artifacts.dir}/${package.basename}-with-dependencies.zip.sha1"
					toFile="${adjusted.release.type}/${project.key}/${package.basename}-with-dependencies.zip.sha1" publicRead="true"/>
		</aws:s3>
	</target>

</project>
