in thrifty-gradle-plugin/src/main/java/com/microsoft/thrifty/gradle/GenerateThriftSourcesWorkAction.java [70:102]
private void actuallyExecute() throws IOException {
Schema schema;
try {
Loader loader = new Loader();
for (File file : getParameters().getIncludePath().get()) {
loader.addIncludePath(file.toPath());
}
for (File file : getParameters().getSource()) {
loader.addThriftFile(file.toPath());
}
schema = loader.load();
} catch (LoadFailedException e) {
reportThriftException(e);
throw new GradleException("Thrift compilation failed", e);
}
try {
deleteRecursively(getParameters().getOutputDirectory().get().getAsFile());
} catch (IOException e) {
LOGGER.warn("Error clearing stale output", e);
}
SerializableThriftOptions opts = getParameters().getThriftOptions().get();
if (opts.isKotlin()) {
generateKotlinThrifts(schema, opts);
} else if (opts.isJava()) {
generateJavaThrifts(schema, opts);
} else {
throw new IllegalStateException("Only Java or Kotlin thrift options are supported");
}
}