This repository has been archived by the owner on Apr 6, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
145 lines (137 loc) · 6.69 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?xml version="1.0" encoding="UTF-8"?>
<project name="module-console" basedir=".">
<dirname property="project.basedir" file="${ant.file.module-console}"/>
<property name="root.dir" location="${project.basedir}/.."/>
<property name="build.properties" value="${project.basedir}/build.properties"/>
<property file="${build.properties}"/>
<!-- Neard dev -->
<property name="dev.path" location="${root.dir}/dev"/>
<fail unless="dev.path" message="Project 'dev' not found in ${dev.path}"/>
<echo message="Neard dev found in ${dev.path}" level="debug"/>
<!-- Import build-commons.xml -->
<import file="${dev.path}/build/build-commons.xml"/>
<!-- Import build-bundle.xml -->
<import file="${dev.path}/build/build-bundle.xml"/>
<target name="release.build">
<basename property="bundle.folder" file="${bundle.path}"/>
<replaceproperty src="bundle.folder" dest="bundle.version" replace="${bundle.name}" with=""/>
<getmoduleuntouched name="${bundle.name}" version="${bundle.version}" propSrcDest="bundle.srcdest" propSrcFilename="bundle.srcfilename"/>
<condition property="bundle.srcfinal" value="${bundle.srcdest}/Console2"><available file="${bundle.srcdest}/Console2" type="dir"/></condition>
<fail unless="bundle.srcfinal" message="Main folder not found"/>
<assertfile file="${bundle.srcfinal}/Console.exe"/>
<!-- Temp copy -->
<copy todir="${bundle.srcfinal}" overwrite="true">
<fileset dir="${bundle.path}" defaultexcludes="yes"/>
</copy>
<!-- Deps -->
<if>
<available file="${bundle.srcfinal}/deps.properties" type="file"/>
<then>
<property prefix="console" file="${bundle.srcfinal}/deps.properties"/>
<!-- ANSICON -->
<if>
<isset property="console.ansicon"/>
<then>
<echo message="Download ANSICON"/>
<property name="ansicon.path" location="${bundle.srcfinal}/ansicon"/>
<download url="${console.ansicon}" returnProperty="ansicon.dest"/>
<echo message="Check ANSICON"/>
<mkdir dir="${ansicon.path}"/>
<copy todir="${ansicon.path}" overwrite="true">
<fileset dir="${ansicon.dest}/x86"/>
</copy>
<assertfile file="${ansicon.path}/ansicon.exe"/>
</then>
</if>
<!-- TCC/LE -->
<if>
<isset property="console.tccle"/>
<then>
<echo message="Download TCC/LE"/>
<property name="tccle.path" location="${bundle.srcfinal}/tccle"/>
<download url="${console.tccle}" returnProperty="tccle.dest"/>
<echo message="Check TCC/LE"/>
<mkdir dir="${tccle.path}"/>
<copy todir="${tccle.path}" overwrite="true">
<fileset dir="${tccle.dest}"/>
</copy>
<assertfile file="${tccle.path}/tcc.exe"/>
</then>
</if>
<!-- Clink -->
<if>
<isset property="console.clink"/>
<then>
<echo message="Download Clink"/>
<property name="clink.path" location="${bundle.srcfinal}/vendor/clink"/>
<download url="${console.clink}" returnProperty="clink.dest"/>
<propertyregex property="clink.basename" input="${console.clink}" regexp="([^/]+).zip$" select="\1"/>
<echo message="Check Clink"/>
<mkdir dir="${clink.path}"/>
<copy todir="${clink.path}" overwrite="true">
<fileset dir="${clink.dest}/${clink.basename}"/>
</copy>
<assertfile file="${clink.path}/clink.bat"/>
</then>
</if>
<!-- Clink completions -->
<if>
<isset property="console.clink_completions"/>
<then>
<echo message="Download Clink completions"/>
<property name="clink_completions.path" location="${bundle.srcfinal}/vendor/clink-completions"/>
<download url="${console.clink_completions}" returnProperty="clink_completions.dest"/>
<propertyregex property="clink_completions.basename" input="${console.clink_completions}" regexp="([^/]+).zip$" select="\1"/>
<echo message="Check Clink completions"/>
<mkdir dir="${clink_completions.path}"/>
<copy todir="${clink_completions.path}" overwrite="true">
<fileset dir="${clink_completions.dest}/${clink_completions.basename}"/>
</copy>
<assertfile file="${clink_completions.path}/.init.lua"/>
</then>
</if>
<!-- GnuWin32 CoreUtils bin -->
<if>
<isset property="console.gnuwin32_coreutils_bin"/>
<then>
<echo message="Download GnuWin32 CoreUtils bin"/>
<property name="gnuwin32_coreutils_bin.path" location="${bundle.srcfinal}/vendor/gnuwin32"/>
<download url="${console.gnuwin32_coreutils_bin}" returnProperty="gnuwin32_coreutils_bin.dest"/>
<echo message="Check GnuWin32 CoreUtils bin"/>
<mkdir dir="${gnuwin32_coreutils_bin.path}"/>
<copy todir="${gnuwin32_coreutils_bin.path}" overwrite="true">
<fileset dir="${gnuwin32_coreutils_bin.dest}/bin"/>
</copy>
<assertfile file="${gnuwin32_coreutils_bin.path}/ls.exe"/>
</then>
</if>
<!-- GnuWin32 CoreUtils dep -->
<if>
<isset property="console.gnuwin32_coreutils_dep"/>
<then>
<echo message="Download GnuWin32 CoreUtils dep"/>
<property name="gnuwin32_coreutils_dep.path" location="${bundle.srcfinal}/vendor/gnuwin32"/>
<download url="${console.gnuwin32_coreutils_dep}" returnProperty="gnuwin32_coreutils_dep.dest"/>
<echo message="Check GnuWin32 CoreUtils dep"/>
<mkdir dir="${gnuwin32_coreutils_dep.path}"/>
<copy todir="${gnuwin32_coreutils_dep.path}" overwrite="true">
<fileset dir="${gnuwin32_coreutils_dep.dest}/bin"/>
</copy>
<assertfile file="${gnuwin32_coreutils_dep.path}/libintl3.dll"/>
</then>
</if>
<delete file="${bundle.srcfinal}/deps.properties"/>
</then>
</if>
<delete dir="${bundle.tmp.prep.path}/${bundle.folder}"/>
<mkdir dir="${bundle.tmp.prep.path}/${bundle.folder}"/>
<copy todir="${bundle.tmp.prep.path}/${bundle.folder}" overwrite="true">
<fileset dir="${bundle.srcfinal}"/>
</copy>
<copy todir="${bundle.tmp.prep.path}/${bundle.folder}" overwrite="true">
<fileset dir="${bundle.path}" defaultexcludes="yes" excludes="
deps.properties"
/>
</copy>
</target>
</project>