forked from NickChen14/slim-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
73 lines (62 loc) · 2.26 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"?>
<project name="slim-angular" default="build" basedir=".">
<property name="package.dir" value="dist/package" />
<property name="dest.dir" value="" />
<target name="clean">
<delete dir="${package.dir}" />
</target>
<target name="build.dir">
<mkdir dir="${package.dir}/${dest.dir}" />
<copy todir="${package.dir}/${dest.dir}">
<fileset dir="${dest.dir}">
<include name="**/*" />
</fileset>
</copy>
</target>
<target name="build.php">
<phingcall target="build.dir">
<property name="dest.dir" value="php" />
</phingcall>
</target>
<target name="build.public">
<phingcall target="build.dir">
<property name="dest.dir" value="public" />
</phingcall>
<php function="uniqid" returnProperty="id" />
<exec command="find ${package.dir}/php/templates -type f -exec sed -i "s/minified/${id}/g" {} +" />
<exec command="mv ${package.dir}/public/minified/ ${package.dir}/public/${id}/" passthru="true" />
</target>
<target name="copy.composer">
<copy todir="${package.dir}">
<fileset dir=".">
<include name="composer.*" />
</fileset>
</copy>
</target>
<target name="composer.install">
<exec command="composer install --no-dev --optimize-autoloader" dir="${package.dir}" passthru="true"/>
</target>
<target name="rm.composer">
<delete>
<fileset dir="${package.dir}">
<include name="composer.*" />
</fileset>
</delete>
</target>
<target name="create.archive">
<tar destfile="${phing.project.name}.tar.gz" basedir="${package.dir}" compression="gzip">
<fileset dir="${package.dir}">
<include name="**/**" />
</fileset>
</tar>
</target>
<target name="build">
<phingcall target="clean" />
<phingcall target="build.php" />
<phingcall target="build.public" />
<phingcall target="copy.composer" />
<phingcall target="composer.install" />
<phingcall target="rm.composer" />
<phingcall target="create.archive" />
</target>
</project>