Skip to content
Browse files

Exclude lib/Cake/Test when building pear packages.

The core tests include a number of files that cause grief when the
cakephp pear package is installed via composer. Excluding the core tests
solves all of these problems and makes a smaller package which is nice.

Fixes #2620
  • Loading branch information...
markstory committed Jan 7, 2014
1 parent 312b2c3 commit caf350c01f1ca6083d54ec1f8c5a5271b1a48b25
Showing with 3 additions and 7 deletions.
  1. +3 −7 build.xml
@@ -29,6 +29,7 @@
<exclude name="Console/cake.bat" />
<exclude name="Console/cake.php" />
<exclude name="Console/cake" />
<exclude name="./lib/Cake/Test" />

@@ -40,10 +41,6 @@
<include name="cake" />

<fileset id="non-tests" dir="./lib/Cake">
<exclude name=".lib/Cake/Test" />

<!-- start fresh each time. Remove the dist and build dirs -->
<target name="clean">
<delete dir="${build.dir}" includeemptydirs="true" />
@@ -140,7 +137,6 @@
<package name="PHPUnit" channel="" minimum_version="3.5.0" type="optional" />
<dirroles key="bin">script</dirroles>
<dirroles key="Cake/Test">php</dirroles>
<dirroles key="Cake/Console/Templates/skel">php</dirroles>
<dirroles key="Cake/Console/Templates/default">php</dirroles>
<dirroles key="Cake/View">php</dirroles>
@@ -244,11 +240,11 @@
<formatter type="pmd" outfile="pmd-cpd.xml"/>
<fileset refid="non-tests" />
<fileset refid="libs" />
<logger type="jdepend-xml" outfile="jdepend.xml"/>
<phpmd rulesets="codesize,unusedcode,design">
<fileset refid="non-tests" />
<fileset refid="libs" />
<formatter type="xml" outfile="reports/pmd.html"/>

4 comments on commit caf350c


This comment has been minimized.

Copy link

AD7six replied Jan 7, 2014

👏 That makes the classmap 1/4 the size too.

For future reference/readers there are still some duplicate class definitions (excerpt from /vendor/composer/autoload_classmap.php):

'AppController' => $vendorDir . '/',
'AppHelper' => $vendorDir . '/',
'AppModel' => $vendorDir . '/',
'AppShell' => $vendorDir . '/',
'PagesController' => $vendorDir . '/',

So the autoload-shuffle is still required, even more so if core classes have been overridden in the app.

Users may or may not also trip over this in the future if they forget an App::uses statement (but at least it should be easy to identify the cause now).


This comment has been minimized.

Copy link

josegonzalez replied Jan 7, 2014

Yeah, some irc users have already seen this issue with the test classes.


This comment has been minimized.

Copy link
Member Author

markstory replied Jan 7, 2014

I don't think we can exclude the skel dir from the pear package without breaking bake :(


This comment has been minimized.

Copy link

AD7six replied Jan 8, 2014

I wonder if it's worth revisiting this and instead of deleting the test directory (or in addition to) adding a composer file excluding basically everything e.g.:

    "autoload": {
        "classmap": ["nothing/"]

CakePHP files in composer's classmap aren't a benefit to CakePHP users - since Cake itself doesn't use it.

Please sign in to comment.
You can’t perform that action at this time.