Coder Social home page Coder Social logo

ogen's Introduction

ogen

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

Installation

If you have opam installed and are on OCaml version 4.02 or higher, you can simply run opam install ogen.

Usage

Creating a project

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

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

$ ogen
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 .ogen file, you can run ogen -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: ogen -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?
  • ogen -tests - Generate a test section in your _oasis file and create the directory

ogen's People

Contributors

nv-vn avatar

Stargazers

footearth avatar Rigel Kent avatar David Landa avatar Benoît Taine avatar Xavier Van de Woestyne avatar Ioannis Sfyrakis avatar Owain Lewis avatar Tulip Amalie avatar  avatar Erik Martin-Dorel avatar Mitsunari Sanada avatar Federico Carrone avatar Alexandre Souza avatar Sander Maijers avatar Marcello Seri avatar Baldvin Dagur Rúnarsson avatar Carmelo Piccione avatar Pradeep Gowda avatar David Sheets avatar Reynir Björnsson avatar Jeremy Letang avatar Seb Mondet avatar Thomas Gazagnaire avatar

Watchers

James Cloos avatar Carmelo Piccione avatar Erik Martin-Dorel avatar  avatar

Forkers

j14159 erikmd

ogen's Issues

`opam install ogen` fails (issue with ogen 0.1.2, ppx_deriving 4.0, ppx_deriving_yojson 3.0)

Hello,
Currently ogen does not install out-of-the-box with OPAM. Actually ogen 0.1.2 does not compile with ppx_deriving 4.0 and ppx_deriving_yojson 3.0 that were released on last month. However, ogen 0.1.2 is fine with ppx_deriving 3.3 and ppx_deriving_yojson 2.4. I solved the issue locally by using opam pin add but I guess that https://github.com/ocaml/opam-repository/blob/master/packages/ogen/ogen.0.1.2/opam would need some update.
Best regards

P.S. For the record, here is the error that pops up:

# File "src/main.ml", line 29, characters 8-16:
# Error: This pattern matches values of type [? `Ok of 'a ]
#        but a pattern was expected which matches values of type
#          Metafile.meta Ppx_deriving_yojson_runtime.error_or =
#            (Metafile.meta, string) Result.result
# Command exited with code 2.

Segmentation fault in wizard

When I answer to the first question (Package name? or Package version? if package name is in argument), when I press enter there is a segmentation fault.

ogen version: 0.1.3
ocaml version: 4.04.0

Dependencies:

∗  installed conf-m4.1
∗  installed conf-pkg-config.1.0
∗  installed conf-which.1
∗  installed conf-libpcre.1
∗  installed result.1.2
∗  installed ocamlfind.1.6.2
∗  installed base-bytes.base
∗  installed easy-format.1.2.0
∗  installed biniou.1.0.12
∗  installed ppx_tools.5.0
∗  installed ocamlbuild.0.9.3
∗  installed ppx_blob.0.2
∗  installed cppo.1.4.1
∗  installed ocamlify.0.0.1
∗  installed ocamlmod.0.0.8
∗  installed pcre.7.2.3
∗  installed yojson.1.3.3
∗  installed ocaml-inifiles.1.2
∗  installed ppx_deriving.4.1
∗  installed ppx_deriving_yojson.3.0
∗  installed batteries.2.5.3
∗  installed oasis.0.4.7
∗  installed linenoise.0.9.0

License validation/compatibility

I know that OASIS has some requirements for license strings. Currently unaware as to whether OPAM has any requirements, and if so how they differ from OASIS' requirements. The tool should be able to validate that license selections refer to existing licenses and generate the correct license strings for OASIS and OPAM. Hopefully, we can come to a standard that's a bit more human-friendly, though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.