Set additional arugment for ant or phing

0 like 0 dislike
14 views
A question to all who use ant or phing.
I want to write a script that will deplot some project to the server. Thus, in line to run the task I want to be able to specify a variable which will indicate the environment in which I am going to perform the deployment (test, production, etc). I want to make it look similar to the following:
phing deploy test
Where deploy is the name of the task, of course, but test is a variable indicating the environment.

My question is: in ant or phing you can catch the value of the second argument (after the name problem)?
by | 14 views

3 Answers

0 like 0 dislike
Maybe ante individual tasks to do? What you have there kinds of deployment...
by
0 like 0 dislike
Phing is possible to pass parameters using -D. Not very beautiful — but without the crutches IMHO
\r
\t\r${environment}\r\r

\r
m00t@m00t:~/***$ phing test_env -Denvironment=test1 Buildfile: ****/build.xml **** > test_env: [echo] test1 BUILD FINISHED Total time: 0.0969 seconds 
by
0 like 0 dislike
For ant-a: (most cut)
\r
ant [options] [target [target2 [target3] ...]] Options: -D= use value for given property -propertyfile  load all properties from file with-D 

\rant.apache.org/manual/running.html
\r
But single target, in my opinion, more intuitive. Another option is to create pseudocele whose action is limited to setting the desired properties and call the desired goal.
\r
P. S. When choosing between phing and ant-om chose the latter, because (1) more versatile and (2) has full support in eclipse.
by

Related questions

0 like 0 dislike
2 answers
asked Mar 24, 2019 by CrazySquirrel
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Mar 28, 2019 by andymitrich
0 like 0 dislike
4 answers
110,608 questions
257,186 answers
0 comments
28,876 users