If checked, the post build script runs also for parent builds of the multi-configuration project.
The code to check whether that run is for a parent build or a child build is like this:
import hudson.matrix.MatrixBuild;
import hudson.matrix.MatrixRun;
if (manager.build instanceof MatrixBuild)
{
// codes for matrix parents.
}
else if (manager.build instanceof MatrixRun)
{
// codes for matrix children.
}