-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
85 lines (73 loc) · 3.33 KB
/
build.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0"?>
<project name="Task Organizer" xmlns:if="ant:if" xmlns:unless="ant:unless">
<!-- Properties: -->
<!-- <property name="sqlite3_dll.version" value="3.36.0"/> -->
<property name="sqlite3_dll.checksum" value="ce5c15b5092877974d5b6476ad1cb2d7"/>
<property name="sqlite3_dll.download_url" value="https://www.sqlite.org/2021/sqlite-dll-win32-x86-3360000.zip"/>
<property name="sqlite3_dll.filename" value="sqlite3.dll"/>
<property file="local.properties"/>
<property name="build_dir" location="build"/>
<property name="releases_dir" location="releases"/>
<!--#ProgramVersion=$(grep -Po '\<StringTable.+ ProductVersion="\K[0-9\.]+' TaskOrganizer.lpi)-->
<exec executable="git" outputproperty="version">
<arg value="describe"/>
<arg value="--dirty"/>
<arg value="--long"/>
</exec>
<property name="executable" location="TaskOrganizer.exe"/>
<!-- Targets: -->
<target name="clean">
<delete dir="${build_dir}"/>
<delete file="${executable}"/>
</target>
<target name="init" depends="clean,download_sqlite3_dll">
<!-- <echoproperties/> -->
<echo>Program version: ${version}</echo>
<mkdir dir="${build_dir}"/>
<mkdir dir="${releases_dir}"/>
</target>
<target name="download_sqlite3_dll" depends="check_sqlite3_dll_checksum" unless="${sqlite3_dll.checksum_is_ok}">
<echo>Start download sqlite3 dll archive</echo>
<tempfile property="zip_temp_file" suffix=".zip" deleteonexit="true"/>
<echo>zip_temp_file: ${zip_temp_file}</echo>
<get src="${sqlite3_dll.download_url}" dest="${zip_temp_file}" verbose="on"/>
<unzip src="${zip_temp_file}" dest="" overwrite="true">
<patternset>
<include name="${sqlite3_dll.filename}"/>
</patternset>
</unzip>
<!-- todo: на всякий случай проверить контрольную сумму sqlite3.dll -->
</target>
<target name="check_sqlite3_dll_available">
<available file="${sqlite3_dll.filename}" property="sqlite3_dll.is_available"/>
<echo>${sqlite3_dll.filename} exists: ${sqlite3_dll.is_available}</echo>
</target>
<target name="check_sqlite3_dll_checksum" depends="check_sqlite3_dll_available" if="sqlite3_dll.is_available">
<checksum file="${sqlite3_dll.filename}" algorithm="MD5" property="${sqlite3_dll.checksum}" verifyProperty="sqlite3_dll.checksum_is_ok"/>
<echo>${sqlite3_dll.filename} checksum is valid: ${sqlite3_dll.checksum_is_ok}</echo>
</target>
<target name="build" depends="init" description="Compile executable">
<exec executable="${lazarus_dir}/lazbuild.exe">
<arg value="--build-mode=Release"/>
<!--<arg value="- - verbose"/>-->
<arg value="TaskOrganizer.lpi"/>
</exec>
</target>
<target name="package" depends="build" description="Pack all files to distributable zip">
<echo>Copy EXE</echo>
<copy file="${executable}" todir="${build_dir}" preservelastmodified="true"/>
<echo>Copy DLLs</echo>
<copy file="${sqlite3_dll.filename}" todir="${build_dir}" preservelastmodified="true"/>
<echo>Copy languages</echo>
<mkdir dir="${build_dir}/languages"/>
<copy todir="${build_dir}/languages" preservelastmodified="true">
<fileset dir="languages">
<!-- <include name="*.mo"/> -->
<include name="*.pot"/>
<include name="*.po"/>
</fileset>
</copy>
<echo>Pack to ZIP archive</echo>
<zip destfile="${releases_dir}/Task_Organizer_${version}.zip" basedir="${build_dir}"/>
</target>
</project>