Class AzureFunctionPackager
- java.lang.Object
-
- com.microsoft.azure.toolkit.lib.appservice.function.core.AzureFunctionPackagerBase
-
- com.microsoft.azure.toolkit.lib.appservice.function.core.AzureFunctionPackager
-
public class AzureFunctionPackager extends AzureFunctionPackagerBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAzureFunctionPackager.AzureFunctionPackagerHolder
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AzureFunctionPackager()
-
Method Summary
-
Methods inherited from class com.microsoft.azure.toolkit.lib.appservice.function.core.AzureFunctionPackagerBase
generateConfiguration, generateConfigurationsInner
-
-
-
-
Field Detail
-
TRIGGER_TYPE
private static final String TRIGGER_TYPE
- See Also:
- Constant Field Values
-
LINE_FEED
protected static final String LINE_FEED
- See Also:
- Constant Field Values
-
FUNCTION_JSON
protected static final String FUNCTION_JSON
- See Also:
- Constant Field Values
-
HOST_JSON
protected static final String HOST_JSON
- See Also:
- Constant Field Values
-
LOCAL_SETTINGS_JSON
protected static final String LOCAL_SETTINGS_JSON
- See Also:
- Constant Field Values
-
EXTENSION_BUNDLE
protected static final String EXTENSION_BUNDLE
- See Also:
- Constant Field Values
-
SEARCH_FUNCTIONS
protected static final String SEARCH_FUNCTIONS
- See Also:
- Constant Field Values
-
FOUND_FUNCTIONS
protected static final String FOUND_FUNCTIONS
- See Also:
- Constant Field Values
-
NO_FUNCTIONS
protected static final String NO_FUNCTIONS
- See Also:
- Constant Field Values
-
GENERATE_CONFIG
protected static final String GENERATE_CONFIG
- See Also:
- Constant Field Values
-
GENERATE_SKIP
protected static final String GENERATE_SKIP
- See Also:
- Constant Field Values
-
GENERATE_DONE
protected static final String GENERATE_DONE
- See Also:
- Constant Field Values
-
VALIDATE_CONFIG
protected static final String VALIDATE_CONFIG
- See Also:
- Constant Field Values
-
VALIDATE_SKIP
protected static final String VALIDATE_SKIP
- See Also:
- Constant Field Values
-
VALIDATE_DONE
protected static final String VALIDATE_DONE
- See Also:
- Constant Field Values
-
SAVING_HOST_JSON
protected static final String SAVING_HOST_JSON
- See Also:
- Constant Field Values
-
SAVING_LOCAL_SETTINGS_JSON
protected static final String SAVING_LOCAL_SETTINGS_JSON
- See Also:
- Constant Field Values
-
SAVE_FUNCTION_JSONS
protected static final String SAVE_FUNCTION_JSONS
- See Also:
- Constant Field Values
-
SAVE_SKIP
protected static final String SAVE_SKIP
- See Also:
- Constant Field Values
-
SAVE_FUNCTION_JSON
protected static final String SAVE_FUNCTION_JSON
- See Also:
- Constant Field Values
-
SAVE_SUCCESS
protected static final String SAVE_SUCCESS
- See Also:
- Constant Field Values
-
COPY_JARS
protected static final String COPY_JARS
- See Also:
- Constant Field Values
-
COPY_SUCCESS
protected static final String COPY_SUCCESS
- See Also:
- Constant Field Values
-
INSTALL_EXTENSIONS
protected static final String INSTALL_EXTENSIONS
- See Also:
- Constant Field Values
-
SKIP_INSTALL_EXTENSIONS_HTTP
protected static final String SKIP_INSTALL_EXTENSIONS_HTTP
- See Also:
- Constant Field Values
-
INSTALL_EXTENSIONS_FINISH
protected static final String INSTALL_EXTENSIONS_FINISH
- See Also:
- Constant Field Values
-
BUILD_SUCCESS
protected static final String BUILD_SUCCESS
- See Also:
- Constant Field Values
-
DEFAULT_LOCAL_SETTINGS_JSON
private static final String DEFAULT_LOCAL_SETTINGS_JSON
- See Also:
- Constant Field Values
-
DEFAULT_HOST_JSON
private static final String DEFAULT_HOST_JSON
- See Also:
- Constant Field Values
-
SKIP_INSTALL_EXTENSIONS_FLAG
private static final String SKIP_INSTALL_EXTENSIONS_FLAG
- See Also:
- Constant Field Values
-
SKIP_INSTALL_EXTENSIONS_BUNDLE
private static final String SKIP_INSTALL_EXTENSIONS_BUNDLE
- See Also:
- Constant Field Values
-
EXTENSION_BUNDLE_ID
private static final String EXTENSION_BUNDLE_ID
- See Also:
- Constant Field Values
-
EXTENSION_BUNDLE_PREVIEW_ID
private static final String EXTENSION_BUNDLE_PREVIEW_ID
- See Also:
- Constant Field Values
-
FUNCTION_WITHOUT_FUNCTION_EXTENSION
private static final BindingEnum[] FUNCTION_WITHOUT_FUNCTION_EXTENSION
-
-
Method Detail
-
getInstance
public static AzureFunctionPackager getInstance()
-
packageProject
public void packageProject(FunctionProject project, boolean installExtension, String funcPath)
-
findAnnotatedMethodsInner
private List<FunctionMethod> findAnnotatedMethodsInner(FunctionProject project)
-
generateConfigurations
private Map<String,FunctionConfiguration> generateConfigurations(FunctionProject project, List<FunctionMethod> methods)
-
installExtensionStep
private void installExtensionStep(FunctionProject project, String funcPath)
-
validateFunctionConfigurations
private void validateFunctionConfigurations(Map<String,FunctionConfiguration> configMap)
-
writeFunctionJsonFiles
private void writeFunctionJsonFiles(FunctionProject project, com.fasterxml.jackson.databind.ObjectWriter objectWriter, Map<String,FunctionConfiguration> configMap) throws IOException
- Throws:
IOException
-
writeFunctionJsonFile
private void writeFunctionJsonFile(FunctionProject project, com.fasterxml.jackson.databind.ObjectWriter objectWriter, String functionName, FunctionConfiguration config) throws IOException
- Throws:
IOException
-
copyHostJson
private void copyHostJson(FunctionProject project) throws IOException
- Throws:
IOException
-
copyLocalSettingsJson
private void copyLocalSettingsJson(FunctionProject project) throws IOException
- Throws:
IOException
-
copyFilesWithDefaultContent
private static void copyFilesWithDefaultContent(File source, File dest, String defaultContent) throws IOException
- Throws:
IOException
-
writeObjectToFile
private void writeObjectToFile(com.fasterxml.jackson.databind.ObjectWriter objectWriter, Object object, File targetFile) throws IOException- Throws:
IOException
-
getObjectWriter
private com.fasterxml.jackson.databind.ObjectWriter getObjectWriter()
-
copyJarsToStageDirectory
private void copyJarsToStageDirectory(FunctionProject project) throws IOException
- Throws:
IOException
-
trackFunctionProperties
private void trackFunctionProperties(Map<String,FunctionConfiguration> configMap)
-
getFunctionBindingList
private List<String> getFunctionBindingList(Map<String,FunctionConfiguration> configMap)
-
getFunctionBindingEnums
private Set<BindingEnum> getFunctionBindingEnums(Map<String,FunctionConfiguration> configMap)
-
isInstallingExtensionNeeded
private boolean isInstallingExtensionNeeded(boolean skipInstallExtensions, FunctionProject project, Set<BindingEnum> bindingTypes)
-
readHostJson
private Map<String,Object> readHostJson(FunctionProject project)
-
copyFileToDirectory
private static void copyFileToDirectory(@Nonnull File srcFile, @Nonnull File destFile) throws IOException
- Throws:
IOException
-
-