Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you use an ANT build file as a Phing build file?

I just started playing around with Phing build scripts (built with PHP). From what I have read is that Phing is based on Apache Ant (built with Java).

Both use XML build files and have similar syntax, so I am asking someone with experience, if I find an Ant build file on Github or elsewhere, can it be used in a Phing script without changing the syntax of it any? Like a drop-in XML file that would work with Ant or Phing? Or are there differences?

like image 308
JasonDavis Avatar asked Dec 01 '11 03:12

JasonDavis


People also ask

What is an Ant build file?

Ant is a Java-based build tool created as part of the Apache open-source project. You can think of it as a Java version of make. Ant scripts have a structure and are written in XML. Similar to make, Ant targets can depend on other targets.

What is phing?

Phing is a PHP tool that allows us to automate processes -- typically, it's used for building and deploying software. It's similar in functionality to the Apache Ant project and uses XML files to execute tasks that are defined as PHP classes.

How do I run an Ant file in xml?

To run the ant build file, open up command prompt and navigate to the folder, where the build. xml resides, and then type ant info. You could also type ant instead. Both will work,because info is the default target in the build file.

What is Basedir in build xml?

The 'basedir' is the base directory from which any relative directories used within the Ant build file are referenced from. If this is omitted the parent directory of the build file will be used.


1 Answers

There are some slight differences. I would recommend taking the ant build file, and for each target, look up the target name in the phing documentation to make sure it's the same or not. I can't remember off the top of my head, but you can't just drop it in. There are also some phing only things you can do that are php related, like a phpdoc target, etc.

like image 188
Kelly Milligan Avatar answered Sep 30 '22 03:09

Kelly Milligan