DaemonParameters (BuildLayoutParameters layout) { try { //noinspection JavaReflectionMemberAccess return DaemonParameters.class.getConstructor(BuildLayoutParameters.class).newInstance(layout); } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new RuntimeException("Cannot create DaemonParameters by reflection, gradle version " + GradleVersion.current(), e); } }