-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckget.xml
24 lines (24 loc) · 897 Bytes
/
ckget.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<project>
<macrodef name="ckget">
<attribute name="url" />
<attribute name="dir" />
<attribute name="checksum" />
<attribute name="algorithm" default="md5" />
<attribute name="skipexisting" default="true" />
<sequential>
<local name="filename" />
<basename property="filename" file="@{url}" />
<get dest="@{dir}" skipexisting="@{skipexisting}">
<url url="@{url}"/>
</get>
<local name="checksum.matches"/>
<local name="checksum.matches.fail"/>
<checksum file="@{dir}/${filename}" algorithm="@{algorithm}"
property="@{checksum}" verifyproperty="checksum.matches" />
<condition property="checksum.matches.ok">
<istrue value="${checksum.matches}" />
</condition>
<fail unless="checksum.matches.ok">Checksum failed downloading @{url}</fail>
</sequential>
</macrodef>
</project>