I am using Pharo and I want to shrink image size by safely removing all the Test classes, which I don't need them for my production image. I guess that image size could decrease considerably.
I have tried using Monticello Browser but there is no way to select multiple packages. Anyone tried?
You can easily write your own code to remove test classes, but did you have a look at the ImageCleaner
class and it's cleanUpForProduction
method? It does not only remove test packages but also other code you will not need in your production image like help and example packages.
If you take a look at it's testPackages
method you can see:
^(RPackageOrganizer default packageNames select: [ :each | each endsWith: 'Tests' ]) copyWithout: 'ReleaseTests'
Once you have all the test packages you can remove them:
testPackages do: [ :each | (MCPackage named: each) unload ].
In addition you could look for all remaining subclasses of TestCase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With