use of com.microsoft.azure.gradle.functions.configuration.FunctionConfiguration in project azure-gradle-plugins by lenala.
the class PackageTask method packageFunction.
@TaskAction
void packageFunction() {
try {
final AnnotationHandler handler = getAnnotationHandler();
final Set<Method> methods = findAnnotatedMethods(handler);
final Map<String, FunctionConfiguration> configMap = getFunctionConfigurations(handler, methods);
validateFunctionConfigurations(configMap);
final ObjectWriter objectWriter = getObjectWriter();
writeEmptyHostJsonFile(objectWriter);
copyLocalSettingsJson();
writeFunctionJsonFiles(objectWriter, configMap);
copyJarsToStageDirectory();
getLogger().quiet(BUILD_SUCCESS);
} catch (Exception ex) {
throw new TaskExecutionException(this, ex);
}
}
use of com.microsoft.azure.gradle.functions.configuration.FunctionConfiguration in project azure-gradle-plugins by lenala.
the class AnnotationHandlerImpl method generateConfigurations.
@Override
public Map<String, FunctionConfiguration> generateConfigurations(final Set<Method> methods) throws Exception {
final Map<String, FunctionConfiguration> configMap = new HashMap<>();
for (final Method method : methods) {
final FunctionName functionAnnotation = method.getAnnotation(FunctionName.class);
final String functionName = functionAnnotation.value();
validateFunctionName(configMap.keySet(), functionName);
logger.quiet("Starting processing function : " + functionName);
configMap.put(functionName, generateConfiguration(method));
}
return configMap;
}
use of com.microsoft.azure.gradle.functions.configuration.FunctionConfiguration in project azure-gradle-plugins by lenala.
the class AnnotationHandlerImpl method generateConfiguration.
@Override
public FunctionConfiguration generateConfiguration(final Method method) {
final FunctionConfiguration config = new FunctionConfiguration();
final List<BaseBinding> bindings = config.getBindings();
processParameterAnnotations(method, bindings);
processMethodAnnotations(method, bindings);
patchStorageBinding(method, bindings);
config.setEntryPoint(method.getDeclaringClass().getCanonicalName() + "." + method.getName());
return config;
}
Aggregations