private async createJarFile()

in src/exportJarSteps/ExportJarTaskProvider.ts [248:288]


    private async createJarFile(stepMetadata: IStepMetadata): Promise<boolean> {
        let step: ExportJarStep = ExportJarStep.ResolveJavaProject;
        let previousStep: ExportJarStep | undefined;
        let executor: IExportJarStepExecutor | undefined;
        while (step !== ExportJarStep.Finish) {
            executor = stepMap.get(step);
            if (!executor) {
                throw new Error(ExportJarMessages.stepErrorMessage(ExportJarMessages.StepAction.FINDEXECUTOR, step));
            }
            if (!await executor.execute(stepMetadata)) {
                // Go back
                previousStep = stepMetadata.steps.pop();
                if (!previousStep) {
                    throw new Error(ExportJarMessages.stepErrorMessage(ExportJarMessages.StepAction.GOBACK, step));
                }
                resetStepMetadata(previousStep, stepMetadata);
                step = previousStep;
            } else {
                // Go ahead
                switch (step) {
                    case ExportJarStep.ResolveJavaProject:
                        step = ExportJarStep.ResolveMainClass;
                        break;
                    case ExportJarStep.ResolveMainClass:
                        step = ExportJarStep.GenerateJar;
                        break;
                    case ExportJarStep.GenerateJar:
                        step = ExportJarStep.Finish;
                        break;
                    default:
                        throw new Error(ExportJarMessages.stepErrorMessage(ExportJarMessages.StepAction.GOAHEAD, step));
                }
            }
            if (step === ExportJarStep.ResolveJavaProject) {
                // It's possible for a user who comes back to the step selecting the Java project to change the workspace.
                // Since a specific task corresponds to a specific workspace, we return "false" as a mark.
                return false;
            }
        }
        return true;
    }