Skip to content

Instantly share code, notes, and snippets.

@ludofleury
Created November 24, 2011 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ludofleury/1392040 to your computer and use it in GitHub Desktop.
Save ludofleury/1392040 to your computer and use it in GitHub Desktop.
Ant build.xml
<target name="lint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}">
<include name="**/*.php" />
<exclude name="**/vendor*" />
<modified />
</fileset>
<fileset dir="${basedir}/Tests">
<include name="**/*.php" />
<modified />
</fileset>
</apply>
</target>
@GromNaN
Copy link

GromNaN commented Nov 24, 2011

You should try vendor/*

@GromNaN
Copy link

GromNaN commented Nov 24, 2011

To help in your test, replace the php command by ls (lot faster)

@ludofleury
Copy link
Author

Sorry replace php command by ls ? any example ? I don't get it but it seems a cool feature

@GromNaN
Copy link

GromNaN commented Nov 24, 2011

C'est une astuce si tu veux voir quels sont les fichiers inclus dans le filset :

<target name="lint">
    <apply executable="ls" failonerror="true">
      <arg value="-l" />

      <fileset dir="${basedir}">
        <include name="**/*.php" />
        <exclude name="**/vendor/**" />
        <modified />
      </fileset>

      <fileset dir="${basedir}/Tests">
        <include name="**/*.php" />
        <modified />
      </fileset>
    </apply>
  </target>

Et je sais pas si tu sais, mais pour appeller uniquement lint c'est :

ant lint

@ludofleury
Copy link
Author

oooow really smart, didn't think to do that and thanks for the cmd, I'm switching from phing to ant ;)
Yet I can't find any pattern that exclude the vendor dir it's still be crawled

@GromNaN
Copy link

GromNaN commented Nov 24, 2011

Juste looked at my build files. It's **/vendor/**

(It's confusing, each tool has its own syntax)

@ludofleury
Copy link
Author

Just figured out in the same time... gosh as you said "confusing"... Anyway thank you very much for your help, you won beer ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment