// preparePrograms downloads the solution and compiles it together with the custom interactor if
// present.
preparePrograms downloads the solution and compiles it together with the custom interactor if
present.
// preparePrograms downloads the solution and compiles it together with the custom interactor if // present .
func (e *Executor) preparePrograms() error {
	e.filePathSolutionSource = filesPathPrefixSolution + e.SolutionProgramService.GetSourceFileExtension()
	if _, err := e.FileService.DownloadFile(e.filePathSolutionSource, e.SolutionRequestURL, e.SolutionRequestHeaders); err != nil {
		return fmt.Errorf("error downloading problem solution: %w", err)
	}
	e.filePathSolutionBinary = filesPathPrefixSolution + e.SolutionProgramService.GetBinaryFileExtension()
	if err := e.SolutionProgramService.Compile(context.TODO(), e.filePathSolutionSource, e.filePathSolutionBinary); err != nil {
		return fmt.Errorf("error compiling problem solution: %w", err)
	}
	if e.InteractorProgramService != nil {
		e.filePathInteractorSource = filesPathPrefixInteractor + e.InteractorProgramService.GetSourceFileExtension()
		if err := e.FileService.MoveFileTree(filePathBundleInteractor, e.filePathInteractorSource); err != nil {
			return fmt.Errorf("error moving interactor source code: %w", err)
		}
		e.filePathInteractorBinary = filesPathPrefixInteractor + e.InteractorProgramService.GetBinaryFileExtension()
		if err := e.InteractorProgramService.Compile(context.TODO(), e.filePathInteractorSource, e.filePathInteractorBinary); err != nil {
			return fmt.Errorf("error compiling custom interactor: %w", err)
		}
	}
	return nil
}
func ( e * Executor ) preparePrograms ( ) error { e . filePathSolutionSource = filesPathPrefixSolution + e . SolutionProgramService . GetSourceFileExtension ( ) if _ , err := e . FileService . DownloadFile ( e . filePathSolutionSource , e . SolutionRequestURL , e . SolutionRequestHeaders ) ; err != nil { return fmt . Errorf ( " " , err ) } e . filePathSolutionBinary = filesPathPrefixSolution + e . SolutionProgramService . GetBinaryFileExtension ( ) if err := e . SolutionProgramService . Compile ( context . TODO ( ) , e . filePathSolutionSource , e . filePathSolutionBinary ) ; err != nil { return fmt . Errorf ( " " , err ) } if e . InteractorProgramService != nil { e . filePathInteractorSource = filesPathPrefixInteractor + e . InteractorProgramService . GetSourceFileExtension ( ) if err := e . FileService . MoveFileTree ( filePathBundleInteractor , e . filePathInteractorSource ) ; err != nil { return fmt . Errorf ( " " , err ) } e . filePathInteractorBinary = filesPathPrefixInteractor + e . InteractorProgramService . GetBinaryFileExtension ( ) if err := e . InteractorProgramService . Compile ( context . TODO ( ) , e . filePathInteractorSource , e . filePathInteractorBinary ) ; err != nil { return fmt . Errorf ( " " , err ) } } return nil }
preparePrograms downloads the solution and compiles it together with the custom interactor if
present.
preparePrograms downloads the solution and compiles it together with the custom interactor if present .