forked from appserver-io/appserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
128 lines (114 loc) · 6.32 KB
/
build.xml
File metadata and controls
128 lines (114 loc) · 6.32 KB
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
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="appserver-io/appserver" default="composer-init" basedir=".">
<!-- initialize ENV variable -->
<property environment="env" />
<!-- ==================================================================== -->
<!-- Generate a time stamp for further use in build targets -->
<!-- ==================================================================== -->
<tstamp>
<format property="time.stamp" pattern="yyyy-MM-dd_HHmmss"/>
</tstamp>
<!-- initialize file based properties -->
<property file="${basedir}/build.properties"/>
<property file="${basedir}/build.default.properties"/>
<property file="${basedir}/build.${os.family}.properties"/>
<!-- initialize the library specific properties -->
<property name="codepool" value="vendor"/>
<!-- initialize the directory where we can find the real build files -->
<property name="vendor.dir" value ="${basedir}/${codepool}" />
<property name="build.dir" value="${vendor.dir}/appserver-io/build" />
<!-- ==================================================================== -->
<!-- Import the common build configuration file -->
<!-- ==================================================================== -->
<import file="${build.dir}/common.xml" optional="true"/>
<!-- ==================================================================== -->
<!-- Checks if composer has installed it's dependencies -->
<!-- ==================================================================== -->
<target name="is-composer-installed">
<condition property="composer.present">
<available file="${build.dir}" type="dir"/>
</condition>
</target>
<!-- ==================================================================== -->
<!-- Installs all dependencies defined in composer.json -->
<!-- ==================================================================== -->
<target name="composer-install" depends="is-composer-installed" unless="composer.present" description="Installs all dependencies defined in composer.json">
<exec dir="${basedir}" executable="composer">
<arg line="--no-interaction --dev install"/>
</exec>
</target>
<!-- ==================================================================== -->
<!-- Updates composer dependencies defined in composer.json -->
<!-- ==================================================================== -->
<target name="composer-update" depends="is-composer-installed" if="composer.present" description="Updates composer dependencies defined in composer.json">
<exec dir="${basedir}" executable="composer">
<arg line="--no-interaction --dev update"/>
</exec>
</target>
<!-- ===================================================================== -->
<!-- Checks if the build- and deployment stub has already been initialized -->
<!-- ===================================================================== -->
<target name="composer-init">
<antcall target="composer-install"/>
<antcall target="composer-update"/>
</target>
<!-- ==================================================================== -->
<!-- Copies the documentation to the target directory -->
<!-- ==================================================================== -->
<target name="copy-doc" description="Copies the documentation to the target directory.">
<exec executable="make" dir="${basedir}/doc-generator" failonerror="true">
<arg line="html" />
</exec>
<copy file="${doc.build.file}" tofile="${doc.target.file}" overwrite="true"/>
<copy todir="${doc.image.target.dir}" preservelastmodified="true" overwrite="true">
<fileset dir="${doc.image.build.dir}">
<include name="**/*" />
</fileset>
</copy>
<replaceregexp file="${doc.target.file}"
match="src="_images"
replace="src="static/img/docs"
byline="true"
/>
</target>
<!-- ==================================================================== -->
<!-- Copies the sources to the temporary directory -->
<!-- ==================================================================== -->
<target name="copy" description="Copies the sources to the temporary directory.">
<!-- prepare the build environment -->
<antcall target="prepare" />
<!-- copy all files to the target directory -->
<copy todir="${php-target.dir}/appserver" preservelastmodified="true" overwrite="true">
<fileset dir="${basedir}">
<include name="etc/**/*" />
<include name="src/**/*" />
<include name="var/**/*" />
<include name="tests/**/*" />
<include name="webapps/**/*" />
<include name="resources/**/*" />
<include name="server.php" />
<include name="composer.json" />
</fileset>
</copy>
<!-- create the file with the version number -->
<echo file="${php-target.dir}/appserver/etc/appserver/.release-version" message="dev-master.${build.number}" />
</target>
<!-- ==================================================================== -->
<!-- Copies the sources to the deploy directory -->
<!-- ==================================================================== -->
<target name="deploy" depends="copy" description="Copies the sources to the deploy directory.">
<!-- copy all files to the deploy.directory -->
<copy todir="${deploy.dir}" preservelastmodified="true" overwrite="true">
<fileset dir="${php-target.dir}/appserver">
<include name="**/*"/>
</fileset>
</copy>
<!-- execute the composer post install script -->
<exec dir="${deploy.dir}" executable="${appserver.bin.dir}/php">
<arg value="${appserver.bin.dir}/composer.phar" />
<arg value="run-script" />
<arg value="post-install-cmd" />
</exec>
</target>
</project>