Login
Added a build.xml script to all distributions. Tools like Eclipse and Intelli-J
[gknop/Perl-Critic.git] / build.xml
CommitLineData
ca135637
JRT
1<?xml version="1.0" encoding="ASCII"?>
2
3<!--
4
5##############################################################################
6# $URL$
7# $Date$
8# $Author$
9# $Revision$
10##############################################################################
11
12The following is an Ant build script for building Perl distributions
13based on Module::Build. It has been written so that tools like
14Eclipse that are well-suited for running Ant scripts (for Java
15projects) can be easily configured to build Perl projects. Most of
16the standard Module::Build actions are availalbe as Ant targets here.
17But if you want to run a non-standard Module::Build action, use the
18"user.defined" Ant target and you will be prompted to enter the name
19of the Module::Build action that you want to run.
20
21Enjoy!!
22
23-->
24
25<project name="Perl-Critic" default="build" basedir=".">
26
27 <description>
28 Build the Perl-Critic distribution.
29 </description>
30
31 <property environment="env" />
32 <property name="perl.exe" value="perl" />
33 <property name="sudo.exe" value="sudo" />
34 <property name="bash.exe" value="bash" />
35 <property name="builder" value="Build" />
36
37
38 <macrodef name="module.build">
39 <attribute name="action" default="build" />
40 <element name="exec.extras" optional="yes" />
41 <sequential>
42 <exec executable="${perl.exe}" failonerror="true">
43 <arg value="${builder}" />
44 <arg value="@{action}" />
45 <exec.extras />
46 </exec>
47 </sequential>
48 </macrodef>
49
50
51 <available file="${builder}" property="Build.initialized" />
52 <target name="init" unless="Build.initialized" description="perl Build.PL">
53 <exec executable="${perl.exe}" failonerror="true">
54 <arg value="Build.PL" />
55 </exec>
56 </target>
57
58
59 <target name="user.defined" depends="init" description="Build (whatever)">
60 <input message="Enter build action:" addproperty="build.action" defaultvalue="build" />
61 <module.build action="${build.action}" />
62 </target>
63
64
65 <target name="help" depends="init" description="Build help">
66 <module.build action="help" />
67 </target>
68
69
70 <target name="build" depends="init" description="Build build">
71 <module.build action="build" />
72 </target>
73
74
75 <target name="test" depends="init" description="Build test">
76 <module.build action="test" />
77 </target>
78
79
80 <target name="testunit" depends="init" description="Build testunit">
81 <module.build action="testunit" />
82 </target>
83
84
85 <target name="testfunctional" depends="init" description="Build testfunctional">
86 <module.build action="testfunctional" />
87 </target>
88
89
90 <target name="testauthor" depends="init" description="Build testauthor">
91 <module.build action="testauthor" />
92 </target>
93
94
95 <target name="testpod" depends="init" description="Build testpod">
96 <module.build action="testpod" />
97 </target>
98
99
100 <target name="testpodcoverage" depends="init" description="Build testpod">
101 <module.build action="testpodcoverage" />
102 </target>
103
104
105 <target name="testcover" depends="init" description="Build testcover">
106 <module.build action="testcover">
107 <exec.extras>
108 <!-- set the $path.prepend property if "cover" is
109 not installed in the standard place -->
110
111 <env key="PATH" path="${path.prepend}:${env.PATH}" />
112 </exec.extras>
113 </module.build>
114 </target>
115
116
117 <target name="manifest" depends="init" description="Build manifest">
118 <module.build action="manifest" />
119 </target>
120
121
122 <target name="docs" depends="init" description="Build docs">
123 <module.build action="docs" />
124 </target>
125
126
127 <target name="distcheck" depends="init" description="Build distcheck">
128 <module.build action="distcheck" />
129 </target>
130
131
132 <target name="distmeta" depends="init" description="Build distmeta">
133 <module.build action="distmeta" />
134 </target>
135
136
137 <target name="disttest" depends="init" description="Build disttest">
138 <module.build action="disttest" />
139 </target>
140
141
142 <target name="distdir" depends="init" description="Build distdir">
143 <module.build action="distdir" />
144 </target>
145
146
147 <target name="dist" depends="init" description="Build dist">
148 <module.build action="dist" />
149 </target>
150
151
152 <target name="distsign" depends="init" description="Build distsign">
153 <module.build action="distsign" />
154 </target>
155
156 <!--
157
158 The "install" target has been especially crafted to work on Unix-like
159 systems that require super-user privileges to install stuff. Note that
160 Eclipse does not hide the password when you type it in. Sorry.
161
162 -->
163
164 <target name="install" depends="init" description="Build install">
165 <input message="Enter your sudo password: " addproperty="sudo.password" />
166 <exec executable="${sudo.exe}" inputstring="${sudo.password}" failonerror="true">
167 <arg value="${bash.exe}" />
168 <arg value="-c" />
169 <arg value="./${builder} install &amp;&amp; ./${builder} clean" />
170 </exec>
171 </target>
172
173
174 <target name="fakeinstall" depends="init" description="Build fakeinstall">
175 <module.build action="fakeinstall" />
176 </target>
177
178
179 <target name="realclean" depends="init" description="Build realclean">
180 <module.build action="realclean" />
181 </target>
182
183
184 <target name="distclean" depends="init" description="Build distclean">
185 <module.build action="distclean" />
186 </target>
187
188
189 <target name="clean" depends="init" description="Build clean">
190 <module.build action="clean" />
191 </target>
192
193</project>