From 9e407d95c3a3a17e7388b8f182e2cad02edc5ce5 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 9 Jun 2017 03:09:41 -0400 Subject: [PATCH 1/3] Switch to jbuilder --- .gitignore | 1 + .merlin | 4 -- _tags | 5 -- opam => base64.opam | 12 ++--- build | 24 ---------- doc/api.odocl | 1 - doc/dev.odocl | 1 - doc/style.css | 112 -------------------------------------------- pkg/META | 8 ---- pkg/pkg.ml | 9 +--- src/b64.mllib | 4 -- src/jbuild | 7 +++ test/jbuild | 10 ++++ 13 files changed, 25 insertions(+), 173 deletions(-) delete mode 100644 .merlin delete mode 100644 _tags rename opam => base64.opam (65%) delete mode 100755 build delete mode 100644 doc/api.odocl delete mode 100644 doc/dev.odocl delete mode 100644 doc/style.css delete mode 100644 pkg/META mode change 100755 => 100644 pkg/pkg.ml delete mode 100644 src/b64.mllib create mode 100644 src/jbuild create mode 100644 test/jbuild diff --git a/.gitignore b/.gitignore index 96cf1b8..491dadf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tmp *.install *.native *.byte +.merlin \ No newline at end of file diff --git a/.merlin b/.merlin deleted file mode 100644 index 0e0495c..0000000 --- a/.merlin +++ /dev/null @@ -1,4 +0,0 @@ -PKG bytes -S src -S test -B _build/** diff --git a/_tags b/_tags deleted file mode 100644 index 8668649..0000000 --- a/_tags +++ /dev/null @@ -1,5 +0,0 @@ -true : annot, bin_annot, safe_string, package(bytes) -true : principal, debug - : package(alcotest bos rresult) - : include - : include diff --git a/opam b/base64.opam similarity index 65% rename from opam rename to base64.opam index a578742..b941664 100644 --- a/opam +++ b/base64.opam @@ -10,15 +10,15 @@ bug-reports: "https://github.com/mirage/ocaml-base64/issues" dev-repo: "https://github.com/mirage/ocaml-base64.git" depends: [ "base-bytes" - "ocamlfind" {build} - "ocamlbuild" {build} - "topkg" {build} + "jbuilder" {build} "bos" {test} "rresult" {test} "alcotest" {test} ] -build: [ "ocaml" "pkg/pkg.ml" "build" "--pinned" "%{pinned}%" "--tests" "false" ] +build: [ + ["jbuilder" "subst"] {pinned} + ["jbuilder" "build" "-p" name "-j" jobs] +] build-test: [ - [ "ocaml" "pkg/pkg.ml" "build" "--pinned" "%{pinned}%" "--tests" "true" ] - [ "ocaml" "pkg/pkg.ml" "test" ] + ["jbuilder" "runtest" "-p" name] ] diff --git a/build b/build deleted file mode 100755 index 6a439e3..0000000 --- a/build +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# This script is only used for developement. It is removed by the -# distribution process. - -set -e - -OCAMLBUILD=${OCAMLBUILD:="ocamlbuild -use-ocamlfind -classic-display \ - -tag debug"} - -action () -{ - case $1 in - default) topkg build ;; - test|tests) topkg build && topkg test ;; - doc) shift; topkg doc --dev $* ;; - api-doc) shift; topkg doc $* ;; - clean) topkg clean ;; - *) $OCAMLBUILD $* ;; - esac -} - -if [ $# -eq 0 ]; -then action default ; -else action $*; fi diff --git a/doc/api.odocl b/doc/api.odocl deleted file mode 100644 index 8163a51..0000000 --- a/doc/api.odocl +++ /dev/null @@ -1 +0,0 @@ -B64 diff --git a/doc/dev.odocl b/doc/dev.odocl deleted file mode 100644 index 8163a51..0000000 --- a/doc/dev.odocl +++ /dev/null @@ -1 +0,0 @@ -B64 diff --git a/doc/style.css b/doc/style.css deleted file mode 100644 index d0a8c4b..0000000 --- a/doc/style.css +++ /dev/null @@ -1,112 +0,0 @@ -/* Copyright (c) 2016 Daniel C. Bünzli. All rights reserved. - Distributed under the ISC license, see terms at the end of the file. */ - -/* Reset a few things. */ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre, -a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp, -small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset, -form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td -{ margin: 0; padding: 0; border: 0 none; outline: 0; font-size: 100%; - font-weight: inherit; font-style:inherit; font-family:inherit; - line-height: inherit; vertical-align: baseline; text-align:inherit; - color:inherit; background: transparent; } - -table { border-collapse: collapse; border-spacing: 0; } - -/* Basic page layout */ - -body { font: normal 10pt/1.375em helvetica, arial, sans-serif; text-align:left; - margin: 1.375em 10%; min-width: 40ex; max-width: 72ex; - color: black; background: transparent /* url(line-height-22.gif) */; } - -b { font-weight: bold } -em { font-style: italic } - -tt, code, pre { font-family: WorkAroundWebKitAndMozilla, monospace; - font-size: 1em; } -pre code { font-size : inherit; } -.codepre { margin-bottom:1.375em /* after code example we introduce space. */ } - -.superscript,.subscript -{ font-size : 0.813em; line-height:0; margin-left:0.4ex;} -.superscript { vertical-align: super; } -.subscript { vertical-align: sub; } - -/* ocamldoc markup workaround hacks */ - -hr, hr + br, div + br, center + br, span + br, ul + br, ol + br, pre + br -{ display: none } /* annoying */ - -div.info + br { display:block} - -.codepre br + br { display: none } -h1 + pre { margin-bottom:1.375em} /* Toplevel module description */ - -/* Sections and document divisions */ - -/* .navbar { margin-bottom: -1.375em } */ -h1 { font-weight: bold; font-size: 1.5em; /* margin-top:1.833em; */ - margin-top:0.917em; padding-top:0.875em; - border-top-style:solid; border-width:1px; border-color:#AAA; } -h2 { font-weight: bold; font-size: 1.313em; margin-top: 1.048em } -h3 { font-weight: bold; font-size: 1.125em; margin-top: 1.222em } -h3 { font-weight: bold; font-size: 1em; margin-top: 1.375em} -h4 { font-style: italic; } - -/* Used by OCaml's own library documentation. */ - h6 { font-weight: bold; font-size: 1.125em; margin-top: 1.222em } - .h7 { font-weight: bold; font-size: 1em; margin-top: 1.375em } - -p { margin-top: 1.375em } -pre { margin-top: 1.375em } -.info { margin: 0.458em 0em -0.458em 2em;}/* Description of types values etc. */ -td .info { margin:0; padding:0; margin-left: 2em;} /* Description in indexes */ - -ul, ol { margin-top:0.688em; padding-bottom:0.687em; - list-style-position:outside} -ul + p, ol + p { margin-top: 0em } -ul { list-style-type: square } - - -/* h2 + ul, h3 + ul, p + ul { } */ -ul > li { margin-left: 1.375em; } -ol > li { margin-left: 1.7em; } -/* Links */ - -a, a:link, a:visited, a:active, a:hover { color : #00B; text-decoration: none } -a:hover { text-decoration : underline } -*:target {background-color: #FFFF99;} /* anchor highlight */ - -/* Code */ - -.keyword { font-weight: bold; } -.comment { color : red } -.constructor { color : green } -.string { color : brown } -.warning { color : red ; font-weight : bold } - -/* Functors */ - -.paramstable { border-style : hidden ; padding-bottom:1.375em} -.paramstable code { margin-left: 1ex; margin-right: 1ex } -.sig_block {margin-left: 1em} - -/* Images */ - -img { margin-top: 1.375em } - -/*--------------------------------------------------------------------------- - Copyright (c) 2016 Daniel C. Bünzli - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ---------------------------------------------------------------------------*/ diff --git a/pkg/META b/pkg/META deleted file mode 100644 index 767137e..0000000 --- a/pkg/META +++ /dev/null @@ -1,8 +0,0 @@ -version = "%%VERSION_NUM%%" -description = "Base64 encoding library" -requires = "bytes" -archive(byte) = "b64.cma" -plugin(byte) = "b64.cma" -archive(native) = "b64.cmxa" -plugin(native) = "b64.cmxs" -exists_if = "b64.cma" diff --git a/pkg/pkg.ml b/pkg/pkg.ml old mode 100755 new mode 100644 index 857b08e..1a04c2b --- a/pkg/pkg.ml +++ b/pkg/pkg.ml @@ -1,9 +1,2 @@ -#!/usr/bin/env ocaml #use "topfind" -#require "topkg" -open Topkg - -let () = - Pkg.describe "base64" @@ fun c -> - Ok [ Pkg.mllib "src/b64.mllib"; - Pkg.test "test/test" ] +#require "topkg-jbuilder.auto" diff --git a/src/b64.mllib b/src/b64.mllib deleted file mode 100644 index 460c418..0000000 --- a/src/b64.mllib +++ /dev/null @@ -1,4 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: d5b36098ec1795f41db1bb6de80e04b6) -B64 -# OASIS_STOP diff --git a/src/jbuild b/src/jbuild new file mode 100644 index 0000000..23a25a4 --- /dev/null +++ b/src/jbuild @@ -0,0 +1,7 @@ +(jbuild_version 1) + +(library + ((name base64) + (wrapped false) + (public_name base64) + (libraries (bytes)))) \ No newline at end of file diff --git a/test/jbuild b/test/jbuild new file mode 100644 index 0000000..72a690c --- /dev/null +++ b/test/jbuild @@ -0,0 +1,10 @@ +(jbuild_version 1) + +(executable + ((name test) + (libraries (base64 rresult alcotest bos)))) + +(alias + ((name runtest) + (deps (test.exe)) + (action (run ${<})))) \ No newline at end of file From d18d2d4cda8e1d1137f7c5492a97cd96b21eb093 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 20 Jun 2017 02:38:33 -0400 Subject: [PATCH 2/3] remove 4.01.0 from test matrix --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9cbc8e0..53a5780 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ env: - PACKAGE="base64" - PRE_INSTALL_HOOK="cd /home/opam/opam-repository && git pull origin master && opam update -u -y" matrix: - - DISTRO=debian-stable OCAML_VERSION=4.01.0 - DISTRO=debian-testing OCAML_VERSION=4.02.3 - DISTRO=debian-unstable OCAML_VERSION=4.03.0 - DISTRO=ubuntu-16.04 OCAML_VERSION=4.04.0 From 334b518f0dd99c301caf020a2ddf629e3db0f5ec Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 20 Jun 2017 03:08:46 -0400 Subject: [PATCH 3/3] minimum jbuilder version --- base64.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base64.opam b/base64.opam index b941664..724ab7d 100644 --- a/base64.opam +++ b/base64.opam @@ -10,7 +10,7 @@ bug-reports: "https://github.com/mirage/ocaml-base64/issues" dev-repo: "https://github.com/mirage/ocaml-base64.git" depends: [ "base-bytes" - "jbuilder" {build} + "jbuilder" {build & >= "1.0+beta10"} "bos" {test} "rresult" {test} "alcotest" {test}