Search in sources :

Example 1 with AnnotationHandler

use of com.microsoft.azure.gradle.functions.handlers.AnnotationHandler 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);
    }
}
Also used : TaskExecutionException(org.gradle.api.tasks.TaskExecutionException) FunctionConfiguration(com.microsoft.azure.gradle.functions.configuration.FunctionConfiguration) ObjectWriter(com.fasterxml.jackson.databind.ObjectWriter) AnnotationHandler(com.microsoft.azure.gradle.functions.handlers.AnnotationHandler) Method(java.lang.reflect.Method) TaskExecutionException(org.gradle.api.tasks.TaskExecutionException) IOException(java.io.IOException) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

ObjectWriter (com.fasterxml.jackson.databind.ObjectWriter)1 FunctionConfiguration (com.microsoft.azure.gradle.functions.configuration.FunctionConfiguration)1 AnnotationHandler (com.microsoft.azure.gradle.functions.handlers.AnnotationHandler)1 IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 TaskAction (org.gradle.api.tasks.TaskAction)1 TaskExecutionException (org.gradle.api.tasks.TaskExecutionException)1