IDEA-104500 Gradle: Allow to reuse common logic for other external systems

Legacy config is removed
check for upper bound in wrapped wildcard (IDEA-105846)
accept this refs inside anonymous classes in java 8 interfaces (IDEA-105892)