CompileProblemWorkDirSourceCodes 编译作业代码(APP入口)
(c *cli.Context)
| 104 | |
| 105 | // CompileProblemWorkDirSourceCodes 编译作业代码(APP入口) |
| 106 | func CompileProblemWorkDirSourceCodes(c *cli.Context) error { |
| 107 | configFile := c.Args().Get(0) |
| 108 | _, err := os.Stat(configFile) |
| 109 | if err != nil && os.IsNotExist(err) { |
| 110 | return errors.Errorf("problem config file (%s) not found", configFile) |
| 111 | } |
| 112 | session, err := executor.NewSession(configFile) |
| 113 | if err != nil { |
| 114 | return err |
| 115 | } |
| 116 | libDir, err := filepath.Abs(c.String("library")) |
| 117 | if err != nil { |
| 118 | return errors.Errorf("get library root error: %s", err.Error()) |
| 119 | } |
| 120 | s, err := os.Stat(libDir) |
| 121 | if err != nil { |
| 122 | return errors.Errorf("library root not exists") |
| 123 | } |
| 124 | if !s.IsDir() { |
| 125 | return errors.Errorf("library root not a directory") |
| 126 | } |
| 127 | err = compileWorkCodeFiles(session.JudgeConfig, libDir) |
| 128 | return err |
| 129 | } |
nothing calls this directly
no test coverage detected