-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·135 lines (120 loc) · 5.24 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
<?xml version="1.0" ?>
<!--
/**
* OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
* all the essential functionalities required for any enterprise.
* Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
*
* OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*
* @copyright 2006 OrangeHRM Inc., http://www.orangehrm.com
*/
-->
<project name="OrangeHRM" basedir="." default="dist">
<property name="version" value="5.5"/>
<property name="package.name" value="orangehrm-${version}"/>
<resolvepath propertyName="project.dir" file=".."/>
<resolvepath propertyName="dist.dir" file="dist"/>
<property name="package.dir" value="${dist.dir}/${package.name}"/>
<exec command="git rev-list --tags --max-count=1" dir="${project.dir}" checkreturn="false"
outputProperty="git.revision"/>
<property name="base.name" value="${package.name}.${git.revision}"/>
<target name="prepare">
<echo msg="Preparing build..."/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${package.dir}"/>
<touch file="release-revision-${git.revision}.txt"/>
</target>
<target name="deps.5x">
<exec command="composer install --no-dev" dir="${project.dir}/src" checkreturn="false" passthru="true"/>
<exec command="composer dump-autoload --optimize --no-dev --classmap-authoritative" dir="${project.dir}/src" checkreturn="false" passthru="true"/>
<exec command="yarn install" dir="${project.dir}/src/client" checkreturn="false" passthru="true"/>
</target>
<target name="build.client">
<exec command="yarn build" dir="${project.dir}/src/client" checkreturn="false" passthru="true"/>
</target>
<target name="build" depends="prepare,clean">
<echo>Copying files...</echo>
<copy todir="${package.dir}" includeemptydirs="true">
<fileset dir="${project.dir}">
<include name="**"/>
<include name="**/*.htaccess"/>
<include name="build/build"/>
<exclude name="build/dist/**"/>
<exclude name="build/build.xml"/>
<exclude name="build/phing-latest.phar"/>
<exclude name=".github/**"/>
<exclude name="Dockerfile"/>
<exclude name="devTools/**"/>
<exclude name="lib/confs/Conf.php"/>
<exclude name="lib/confs/cryptokeys/key.ohrm"/>
<exclude name="orangehrm-quick-start-guide.html"/>
<exclude name="src/test/**"/>
<exclude name="src/plugins/**/test/**"/>
<exclude name="src/plugins/orangehrmAuthenticationPlugin/lib/**"/>
<exclude name="src/plugins/orangehrmCoreOAuthPlugin/lib/**"/>
<exclude name="src/plugins/orangehrmOpenidAuthenticationPlugin/**"/>
<exclude name="src/plugins/orangehrmRESTPlugin/**"/>
<!-- 5.x related -->
<exclude name="src/client/node_modules/**"/>
<exclude name="src/client/.yarn/cache/**"/>
<exclude name="src/client/.yarn/install-state.gz"/>
<exclude name="installer/client/node_modules/**"/>
<exclude name="installer/client/.yarn/cache/**"/>
<exclude name="installer/client/.yarn/install-state.gz"/>
</fileset>
</copy>
<!-- done this way to avoid some quirks in phing behavior -->
<delete includeemptydirs="true" failonerror="false" dir="${package.dir}/src/log"/>
<delete includeemptydirs="true" failonerror="false" dir="${package.dir}/src/cache"/>
<mkdir dir="${package.dir}/src/cache"/>
<mkdir dir="${package.dir}/src/log"/>
<copy todir="${dist.dir}">
<fileset dir="${project.dir}">
<include name="orangehrm-quick-start-guide.html"/>
<include name="logo.png"/>
</fileset>
</copy>
</target>
<target name="dist" depends="build">
<echo message="Creating archives ..."/>
<zip destfile="${dist.dir}/${package.name}.zip" ignoreLinks="true">
<fileset dir="${dist.dir}">
<include name="${package.name}/**"/>
<include name="orangehrm-quick-start-guide.html"/>
<include name="logo.png"/>
<exclude name="*.zip"/>
<exclude name="*.tar.gz"/>
</fileset>
</zip>
<tar destfile="${dist.dir}/${package.name}.tar.gz" compression="gzip">
<fileset dir="${dist.dir}">
<include name="${package.name}/**"/>
<include name="orangehrm-quick-start-guide.html"/>
<include name="logo.png"/>
<exclude name="*.zip"/>
<exclude name="*.tar.gz"/>
</fileset>
</tar>
</target>
<fileset dir="./" id="deleteFiles">
<include name="release-revision-*.txt"/>
</fileset>
<target name="clean">
<echo msg="Cleaning up..."/>
<delete dir="${dist.dir}"/>
<delete>
<fileset refid="deleteFiles"/>
</delete>
</target>
</project>