如何正确地将str模块添加到oasis配置?

时间:2017-05-23 20:37:37

标签: ocaml oasis

我现在有什么:

_oasis文件:

public class Index1 extends HttpServlet {
    private static final Logger log = Logger.getLogger(Index1.class.getName());

    @Override
    public void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws IOException {
        String param1= req.getParameter("param1");
        String param2= req.getParameter("param2");

            log.info("Worker processing " + param1);
/*Define job to be executed*/

    }
    }   

的src / main.ml:

OASISFormat: 0.4
Name:        Count Lines
Version:     0.0.1
Synopsis:    Counts the number of lines in the project
Authors:     Bogdan Nechyporenko
License:     LGPL-2.1 with OCaml linking exception
Executable "count-lines"
  Path:       src
  BuildTools: ocamlbuild
  BuildDepends: str
  MainIs:     main.ml

我正在运行命令来构建它:

open Str ;;

let endswith s1 s2 =
  let re = Str.regexp (Str.quote s2 ^ "$")
  in
  try ignore (Str.search_forward re s1 0); true
  with Not_found -> false

其余的只是ocaml -setup生成的文件: enter image description here

当我正在构建时看到下一个错误: enter image description here

1 个答案:

答案 0 :(得分:1)

如果有人对此答案感兴趣,在修改自己的_oasis文件后,您需要运行" oasis setup"接受修改。

愚蠢的我,感谢IRC中的Drup #ocaml chat !!!