-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
112 lines (94 loc) · 3.24 KB
/
Copy pathbuild.xml
File metadata and controls
112 lines (94 loc) · 3.24 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="phpdeploy" default="help" basedir=".">
<property name="dir.public" value="."/>
<!-- CRIANDO CONJUNTO DE ARQUIVOS -->
<fileset dir="${dir.public}" id="php.sources">
<!-- Arquivos incluídos -->
<include name="**"/>
<!-- Arquivos ignorados -->
<exclude name="build.xml" />
<exclude name="*.properties" />
<exclude name="images/**"/>
<exclude name="**/.git/**"/>
<exclude name="**/.empty"/>
</fileset>
<!-- CRIANDO CONJUNTO DE ARQUIVOS DE IMAGENS -->
<fileset dir="${dir.public}/images" id="php.images">
<!-- Arquivos incluídos -->
<include name="**"/>
<!-- Arquivos ignorados-->
<exclude name="**/.empty"/>
</fileset>
<!--
INFORMAR O AMBIENTE DE DESTINO (deV, test, prod) CARREGANDO ARQUIVO DE PROPRIEDADES
CORRESPONDENTE
-->
<target name="get-env" description="get the environment for an action">
<input propertyname="environment" validargs="dev,test,prod">Enter environment name </input>
<property file="${environment}.properties"/>
</target>
<!-- ALTERANDO ARQUIVOS -->
<target name="change-token" description="change the file tokens on the config files">
<copy file="${dir.public}/config/database.php.tpl" tofile="config/database.php" overwrite="true">
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<!-- MySQL TOKENS -->
<token key="dbname" value="${db.name}" />
<token key="dbhost" value="${db.host}" />
<token key="dbuser" value="${db.username}" />
<token key="dbpass" value="${db.password}" />
</replacetokens>
<!-- Remove PHP comments -->
<stripphpcomments />
</filterchain>
</copy>
</target>
<target name="phpcpd" description="Find duplicate code using PHPCPD">
<phpcpd minLines="10">
<fileset refid="php.sources"/>
<formatter type="pmd" outfile="pmd-cpd.xml"/>
</phpcpd>
</target>
<!-- Mede o tamanho do projeto com o PHPLOC - depende do pacote phploc-->
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc" logoutput="true" checkreturn="true" level="debug">
<arg value="--log-csv"/>
<arg value="phploc.csv"/>
<arg path="."/>
</exec>
</target>
<!-- EFETUA O DEPLOY -->
<target name="deploy" depends="get-env,change-token" description="update the application files in a specific environment">
<echo msg="Enviando arquivos para servidor. Aguarde..." />
<!-- Efetua o deploy de arquivos PHP-->
<ftpdeploy
host="${ftp.server}"
port="${ftp.port}"
username="${ftp.user}"
password="${ftp.pass}"
dir="."
mode="ascii"
clearfirst="true"
level="info">
<fileset refid="php.sources"/>
</ftpdeploy>
<!-- Efetua o deploy de imagens -->
<ftpdeploy
host="${ftp.server}"
port="${ftp.port}"
username="${ftp.user}"
password="${ftp.pass}"
dir="images"
mode="binary"
clearfirst="true">
<fileset refid="php.images"/>
</ftpdeploy>
<echo msg="Completo!" />
</target>
<!-- EFETUA O DEPLOY COMPLETO-->
<target name="deploy-all" description="Efetua o deploy completo">
</target>
<!-- RODA OS TESTES UNITÁRIOS-->
<target name="run-tests" description="Roda todos os testes">
</target>
</project>