Backport improve platform build script changes

 - Add support for building specific projects using --project
 - Improve the detection of which JDKs are required to build a project
   by also considering its runTestsWith configuration
 - Look in the right place for the platform bom properties file