Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6765955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:46:23+00:00 2026-05-26T14:46:23+00:00

In my project there are certain directories and certain php files which are very

  • 0

In my project there are certain directories and certain php files which are very large in size due to which my build is failing and I want to exclude them in my build.xml

Ques1- Do I have to write the --ignore="path/filename" for every php file in the project?

Ques2- There are certain files which are not php but .dat so should I mention these files in the --ignore too?

Ques3- Can I specify to exclude files based on their size such that I exclude all the files larger than 500kb?

My current xml file looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<project name="name-of-project" default="build" basedir=".">
  <property name="root.dir" value="${basedir}/.."/>
  <property name="source" value="${root.dir}"/>

 <target name="clean"
         description="Clean up and create artifact directories">
  <delete dir="${basedir}/build/api"/>
  <delete dir="${basedir}/build/code-browser"/>
  <delete dir="${basedir}/build/coverage"/>
  <delete dir="${basedir}/build/logs"/>
  <delete dir="${basedir}/build/pdepend"/>

  <mkdir dir="${basedir}/build/api"/>
  <mkdir dir="${basedir}/build/code-browser"/>
  <mkdir dir="${basedir}/build/coverage"/>
  <mkdir dir="${basedir}/build/logs"/>
  <mkdir dir="${basedir}/build/pdepend"/>
 </target>

 <target name="phpunit"
         description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
  <exec executable="phpunit" failonerror="true">
    <env key="DOCUMENT_ROOT" value="${source}/api"/>
    <env key="MODEL_ROOT" value="${source}/model"/>
  </exec>
 </target>

 <target name="parallelTasks"
         description="Run the pdepend, phpmd, phpcpd, phpcs, phpdoc and phploc tasks in parallel using a maximum of 2 threads.">
  <parallel threadCount="2">
   <sequential>
    <antcall target="pdepend"/>
    <antcall target="phpmd"/>
   </sequential>
   <antcall target="phpcpd"/>
   <antcall target="phpcs"/>
   <antcall target="phpdoc"/>
   <antcall target="phploc"/>
  </parallel>
 </target>

 <target name="pdepend"
         description="Generate jdepend.xml and software metrics charts using PHP_Depend">
  <exec executable="pdepend">
   <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
   <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
   <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
   <arg value="--ignore=${source}/web" />
   <arg path="${source}" />
  </exec>
 </target>

 <target name="phpmd"
         description="Generate pmd.xml using PHPMD">
  <exec executable="phpmd">
   <arg path="${source}" />
   <arg value="xml" />
   <arg value="${basedir}/build/phpmd.xml" />
   <arg value="--reportfile" />
   <arg value="${basedir}/build/logs/pmd.xml" />
   <arg value="--exclude" />
   <arg value="${basedir}/web" />
  </exec>
 </target>

 <target name="phpcpd"
         description="Generate pmd-cpd.xml using PHPCPD">
  <exec executable="phpcpd">
   <arg value="--log-pmd" />
   <arg value="${basedir}/build/logs/pmd-cpd.xml" />
   <arg value="--exclude" />
   <arg value="${basedir}/web" />
   <arg path="${source}" />
  </exec>
 </target>

 <target name="phploc"
         description="Generate phploc.csv">
  <exec executable="phploc">
   <arg value="--log-csv" />
   <arg value="${basedir}/build/logs/phploc.csv" />
   <arg value="--exclude" />
   <arg value="${basedir}/web" />
   <arg path="${source}" />
  </exec>
 </target>

 <target name="phpcs"
         description="Generate checkstyle.xml using PHP_CodeSniffer">
  <exec executable="phpcs" output="/dev/null">
   <arg value="--report=checkstyle" />
   <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
   <arg value="--standard=${basedir}/build/phpcs.xml" />
   <arg value="--ignore=${source}/web" /> 
   <arg path="${source}" />
  </exec>
 </target>

 <target name="phpdoc"
         description="Generate API documentation using PHPDocumentor">
  <exec executable="phpdoc">
   <arg value="--directory" />
   <arg path="${source}" />
   <arg value="--target" />
   <arg path="${basedir}/build/api" />
   <arg value="--ignore" />
   <arg path="${basedir}/web" />
  </exec>
 </target>

 <target name="phpcb"
         description="Aggregate tool output with PHP_CodeBrowser">
  <exec executable="phpcb">
   <arg value="--log" />
   <arg path="${basedir}/build/logs" />
   <arg value="--source" />
   <arg path="${source}" />
   <arg value="--ignore" />
   <arg path="${basedir}/web" />
   <arg value="--output" />
   <arg path="${basedir}/build/code-browser" /> 
  </exec>
 </target>

 <target name="build" depends="clean,parallelTasks,phpunit,phpcb"/>
</project>

And I am getting errors like these

pdepend:
     [exec] PHP_Depend 0.10.5 by Manuel Pichler

     [exec] Parsing source files:
     [exec] phpcpd 1.3.2 by Sebastian Bergmann.

     [exec] PHP Fatal error:  Allowed memory size of 262144000 bytes exhausted (tried to allocate 71 bytes) in /usr/share/pear/PHPCPD/Detector.php on line 115
     [exec] PHP Stack trace:
     [exec] PHP   1. {main}() /usr/bin/phpcpd:0
     [exec] PHP   2. PHPCPD_TextUI_Command::main() /usr/bin/phpcpd:51
     [exec] PHP   3. PHPCPD_Detector->copyPasteDetection() /usr/share/pear/PHPCPD/TextUI/Command.php:216
     [exec] PHP   4. token_get_all() /usr/share/pear/PHPCPD/Detector.php:115
     [exec] Result: 255

phploc:
     [exec] phploc 1.6.1 by Sebastian Bergmann.

     [exec] PHP Fatal error:  Allowed memory size of 262144000 bytes exhausted (tried to allocate 71 bytes) in /usr/share/pear/PHPLOC/Analyser.php on line 279
     [exec] PHP Stack trace:
     [exec] PHP   1. {main}() /usr/bin/phploc:0
     [exec] PHP   2. PHPLOC_TextUI_Command::main() /usr/bin/phploc:51
     [exec] PHP   3. PHPLOC_Analyser->countFiles() /usr/share/pear/PHPLOC/TextUI/Command.php:215
     [exec] PHP   4. PHPLOC_Analyser->countFile() /usr/share/pear/PHPLOC/Analyser.php:170
     [exec] PHP   5. token_get_all() /usr/share/pear/PHPLOC/Analyser.php:279
     [exec] Result: 255

What should I do to solve it? If I manually remove the large files from the directory then the build just passes but I want the build to run automatically checking out the code base from svn which will have these large files.

Ques4- Can I configure my checkout in such a way that these files dont get checked out?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:46:23+00:00Added an answer on May 26, 2026 at 2:46 pm

    For every target you can use fileset property or add exclude directories manually

    <target name="phploc" description="Measure project size using PHPLOC">
        <exec executable="phploc">
            <arg value="--log-csv"/>
            <arg value="${basedir}/build/logs/phploc.csv"/>
            <arg value="--exclude"/>
            <arg value="${src}/api/"/>
            <arg value="--exclude"/>
            <arg value="${src}/external/"/>
            <arg path="${src}"/>
        </exec>
    </target>
    
    <target name="pdepend"
            description="Calculate software metrics using PHP_Depend">
        <exec executable="pdepend">
            <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml"/>
            <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg"/>
            <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg"/>
            <arg value="--ignore=/dir/one/,/dir/two/"/>
            <arg path="${src}"/>
        </exec>
    </target>
    
    <target name="phpcpd" description="Find duplicate code using PHPCPD">
        <exec executable="phpcpd">
            <arg value="--log-pmd"/>
            <arg value="${basedir}/build/logs/pmd-cpd.xml"/>
            <arg value="--exclude"/>
            <arg value="${src}/api/"/>
            <arg value="--exclude"/>
            <arg value="${src}/exclude/"/><arg path="${src}"/>
        </exec>
    </target>
    

    Hope my answer will be helpful for someone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my project there are large no. of FIXME / TODO which are to
There are certain images & swf files that are used in the project, but
I am using Hibernate in my project and there is a certain scenario where
In the project I'm working on, there is a certain form that contains an
for a school project, I am making a chessboard in java. there were certain
At this moment there is a very basic flash project that connects to a
I have a project where there are 64 buttons, you have to click certain
In various projects there are certain parts I will keep jumping to. Is there
When building ASP.NET projects there is a certain amount of boilerplate, or plumbing that
In my project there are situations where we have to send xml messages (as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.