use of org.gradle.buildinit.plugins.internal.ProjectLayoutSetupRegistry in project gradle by gradle.
the class InitBuild method setupProjectLayout.
@TaskAction
public void setupProjectLayout() {
final String type = getType();
BuildInitDsl dsl = BuildInitDsl.fromName(getDsl());
BuildInitTestFramework testFramework = BuildInitTestFramework.fromName(getTestFramework());
final ProjectLayoutSetupRegistry projectLayoutRegistry = getProjectLayoutRegistry();
if (!projectLayoutRegistry.supports(type)) {
String supportedTypes = Joiner.on(", ").join(Iterables.transform(projectLayoutRegistry.getSupportedTypes(), new Function<String, String>() {
@Override
public String apply(String input) {
return "'" + input + "'";
}
}));
throw new GradleException("The requested build setup type '" + type + "' is not supported. Supported types: " + supportedTypes + ".");
}
ProjectInitDescriptor initDescriptor = projectLayoutRegistry.get(type);
if (!testFramework.equals(BuildInitTestFramework.NONE) && !initDescriptor.supports(testFramework)) {
throw new GradleException("The requested test framework '" + testFramework.getId() + "' is not supported in '" + type + "' setup type");
}
initDescriptor.generate(dsl, testFramework);
}
Aggregations