use of com.microsoft.azure.plugin.functions.gradle.handler.PackageHandler in project azure-gradle-plugins by microsoft.
the class PackageTask method build.
@TaskAction
@AzureOperation(name = "functionapp.package", type = AzureOperation.Type.ACTION)
public void build() throws GradleException {
try {
TelemetryAgent.getInstance().trackTaskStart(this.getClass());
final GradleFunctionContext ctx = new GradleFunctionContext(getProject(), this.getFunctionsExtension());
TelemetryAgent.getInstance().addDefaultProperties(ctx.getTelemetryProperties());
final File stagingFolder = new File(ctx.getDeploymentStagingDirectoryPath());
// package task will start from a empty staging folder
if (stagingFolder.exists()) {
FileUtils.cleanDirectory(stagingFolder);
} else {
stagingFolder.mkdirs();
}
final PackageHandler packageHandler = new PackageHandler(ctx.getProject(), ctx.getDeploymentStagingDirectoryPath());
packageHandler.execute();
TelemetryAgent.getInstance().trackTaskSuccess(this.getClass());
} catch (Exception e) {
TelemetryAgent.getInstance().traceException(this.getClass(), e);
throw new GradleException(PACKAGE_FAILURE + e.getMessage(), e);
}
}
Aggregations