Files
openide/platform/jps-bootstrap/jps-bootstrap-extract.xml
Leonid Shalupov 6b47a6eb97 jps-bootstrap: ant file for extracting jps-bootstrap
GitOrigin-RevId: 7d2b856c4c0c642f83a7c5363c6f0488fd3aec3c
2022-01-04 15:46:19 +00:00

42 lines
1.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project default="extract">
<!-- Must be set by TeamCity -->
<property name="jps.bootstrap.zip.url" value="" />
<property name="jps.bootstrap.zip.sha256" value="" />
<!-- Under TeamCity will be set to build temp dir -->
<property name="teamcity.build.tempDir" value="${java.io.tmpdir}" />
<!-- Under *buildserver* will be set to persistent cache storage -->
<property name="agent.persistent.cache" value="${teamcity.build.tempDir}" />
<property name="target.dir" value="${teamcity.build.tempDir}/jps-bootstrap" />
<property name="target.zip" value="${agent.persistent.cache}/jps-bootstrap.${jps.bootstrap.zip.sha256}.zip" />
<available file="${target.zip}" property="target.zip.present" />
<echo message="jps.bootstrap.zip.url = ${jps.bootstrap.zip.url}" />
<echo message="jps.bootstrap.zip.sha256 = ${jps.bootstrap.zip.sha256}" />
<echo message="target.dir = ${target.dir}" />
<echo message="target.zip = ${target.zip}" />
<echo message="target.zip.present = ${target.zip.present}" />
<target name="download" unless="target.zip.present">
<delete file="${target.zip}.tmp" />
<get src="${jps.bootstrap.zip.url}" dest="${target.zip}.tmp" />
<move file="${target.zip}.tmp" tofile="${target.zip}" overwrite="true" failonerror="true" />
</target>
<target name="extract" depends="download">
<checksum file="${target.zip}" algorithm="SHA-256" property="sha256" />
<echo message="SHA-256 checksum of ${target.zip}: ${sha256}" />
<fail message="Checksum mismatch for ${jps.bootstrap.zip.url} at ${target.zip}: expected SHA-256: ${jps.bootstrap.zip.sha256} actual: ${sha256}">
<condition>
<not>
<equals arg1="${jps.bootstrap.zip.sha256}" arg2="${sha256}"/>
</not>
</condition>
</fail>
<delete dir="${target.dir}" />
<unzip src="${target.zip}" failonemptyarchive="true" dest="${target.dir}" />
</target>
</project>