Is there a gradle equivalent for Class.forName or a more gradle/groovy way of doing it.
What I am trying to achieve in gradle is the following:
for(String name : new String[]{
MyImpl1.class.getName() ,
MyImpl2.class.getName() ,
MyImpl3.class.getName()}) {
MyInterface myInterface = (MyInterface)Class.forName(name).newInstance();
myInterface.configure();
}
Where MyImpl1, MyImpl2 and MyImpl3 implements MyInterface