-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
73 lines (62 loc) · 3.17 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
<?xml version="1.0" encoding="UTF-8"?>
<project name = "module-php" basedir = ".">
<!-- Define project properties -->
<property name = "project.basedir" location = "." />
<property name = "root.dir" location = "${project.basedir}/.." />
<property name = "build.properties" value = "${project.basedir}/build.properties" />
<property file = "${build.properties}" />
<!-- Bearsampp dev -->
<property name = "dev.path" location = "${root.dir}/dev" />
<fail unless = "dev.path" message = "Project 'dev' not found in ${dev.path}" />
<echo message = "Bearsampp 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" />
<!-- Define directories -->
<property name = "bundle.tmp.prep.path" location = "${project.basedir}/tmp/prep" />
<property name = "build.tmp.path" location = "${project.basedir}/tmp" />
<!-- Main target for release build -->
<target name = "release.build">
<!-- Define the bundle folder -->
<basename property = "bundle.folder" file = "${bundle.path}" />
<replaceproperty src = "bundle.folder" dest = "bundle.version" replace = "${bundle.name}" with = "" />
<!-- Get the PHP module -->
<getmoduleuntouched name = "${bundle.name}" version = "${bundle.version}" propSrcDest = "bundle.srcdest" propSrcFilename = "bundle.srcfilename" />
<assertfile file = "${bundle.srcdest}/xlight.exe" />
<!-- Prepare xlight -->
<property name = "xlight.prep.path" location = "${bundle.tmp.prep.path}/${bundle.name}${bundle.version}" />
<delete dir = "${xlight.prep.path}" />
<mkdir dir = "${xlight.prep.path}" />
<copy todir = "${xlight.prep.path}" overwrite = "true">
<fileset dir = "${bundle.srcdest}" excludes = "extras.properties" />
</copy>
<copy todir = "${xlight.prep.path}" overwrite = "true">
<fileset dir = "${bundle.path}" defaultexcludes = "yes" />
</copy>
<!-- Dependencies -->
<if>
<available file = "${xlight.prep.path}/extras.properties" type = "file" />
<then>
<echo message = "Processing dependencies..." />
<property prefix = "xlightdeps" file = "${xlight.prep.path}/extras.properties" />
<propertyselector property = "xlightdeps" match = "xlightdeps\.(.*)" select = "\1" />
<for list = "${xlightdeps}" param = "xlightdep">
<sequential>
<echo message = "Processing dependency: @{xlightdep}" />
<var name = "xlightdep.dest" unset = "true" />
<!-- Download dep -->
<download url = "${xlightdeps.@{xlightdep}}" returnProperty = "xlightdep.dest" />
<echo message = "Dependency path: ${xlightdep.dest}" />
<!-- Copy dep to ${bundle.srcdest} -->
<copy todir = "${xlight.prep.path}" overwrite = "true">
<fileset dir = "${xlightdep.dest}" />
</copy>
<echo message = "Copied @{xlightdep} dependency to ${xlight.prep.path}" />
</sequential>
</for>
<delete file = "${xlight.prep.path}/extras.properties" />
</then>
</if>
</target>
</project>