Skip to content
/ ogen Public

A tool for creating new OCaml projects with OPAM, Oasis, and Merlin

License

Notifications You must be signed in to change notification settings

nv-vn/ogen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opam-create

A tool for creating new OCaml projects with OPAM, Oasis, and Merlin

Usage

Creating a project

The basic usage is opam create [-nopam] [-noasis] [project name].

The -noasis flag disables the _oasis generator and the -nopam flag disables generating OPAM packaging files.

$ opam create
Package name? [default: <current directory>] MyProject
Package version? [default: 1.0.0] 1.0
Please choose a license: [default: All Rights Reserved] GPL
Author name? [default: <git config user.name>]
Author email? [default: <git config user.email>]
Project homepage URL? https://github.com/<user>/<repo>
Project synopsis? <A short description of your project>
What does the package build? [Library/Executable] l

Updating the project

To regenerate the files from the .opamcreate file, you can run opam create -refresh.

WARNING: This will clear out changes to your current _oasis, opam, and .merlin files

Adding dependencies

If you want to add a new dependency, you can do so using the following syntax: opam create -depend <dependency>, where <dependency> matches the following format:

name ::= any string

version ::= any string

constraint ::= "{" constraints "}"

op ::= "=" | "!=" | "<" | ">" | "<=" | ">="

constraints ::= op "[" version "]"
              | "!" constraints
              | constraints "&" constraints
              | constraints "|" constraints

dependency ::= name constraint?

Because of limitations of shells, you'll need to quote the dependency if you're using any constraints.

Planned features

  • Human-editable global config file?

    • Could be TOML, INI, JSON, YAML. Preferably not a custom format
    • Replace .opamcreate
    • Inject code into OASIS' Makefile to refresh?
  • opam create -tests - Generate a test section in your _oasis file and create the directory

About

A tool for creating new OCaml projects with OPAM, Oasis, and Merlin

Resources

License

Stars

Watchers

Forks

Packages

No packages published