-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8734642
commit 00ebaa2
Showing
17 changed files
with
415 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
_build | ||
*.native | ||
*.byte | ||
*.bak | ||
setup.log | ||
setup.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <http://unlicense.org/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,24 @@ | ||
# OASIS_START | ||
# DO NOT EDIT (digest: a3c674b4239234cbbe53afe090018954) | ||
build: | ||
ocaml pkg/build.ml native=true native-dynlink=true | ||
|
||
SETUP = ocaml setup.ml | ||
|
||
build: setup.data | ||
$(SETUP) -build $(BUILDFLAGS) | ||
|
||
doc: setup.data build | ||
$(SETUP) -doc $(DOCFLAGS) | ||
|
||
test: setup.data build | ||
$(SETUP) -test $(TESTFLAGS) | ||
|
||
all: | ||
$(SETUP) -all $(ALLFLAGS) | ||
|
||
install: setup.data | ||
$(SETUP) -install $(INSTALLFLAGS) | ||
|
||
uninstall: setup.data | ||
$(SETUP) -uninstall $(UNINSTALLFLAGS) | ||
|
||
reinstall: setup.data | ||
$(SETUP) -reinstall $(REINSTALLFLAGS) | ||
test: build | ||
rm _build/src_test/ -rf | ||
ocamlbuild -classic-display -use-ocamlfind src_test/test_ppx_getenv.byte -- | ||
|
||
clean: | ||
$(SETUP) -clean $(CLEANFLAGS) | ||
|
||
distclean: | ||
$(SETUP) -distclean $(DISTCLEANFLAGS) | ||
|
||
setup.data: | ||
$(SETUP) -configure $(CONFIGUREFLAGS) | ||
|
||
configure: | ||
$(SETUP) -configure $(CONFIGUREFLAGS) | ||
|
||
.PHONY: build doc test all install uninstall reinstall clean distclean configure | ||
|
||
# OASIS_STOP | ||
ocamlbuild -clean | ||
|
||
.PHONY: build test clean | ||
|
||
release: | ||
@if [ -z "$(VERSION)" ]; then echo "Usage: make release VERSION=1.0.0"; exit 1; fi | ||
git checkout -B release | ||
sed -i 's/%%VERSION%%/$(VERSION)/' pkg/META | ||
git add . | ||
git commit -m "Prepare for release." | ||
git tag -a v$(VERSION) -m "Version $(VERSION)" | ||
git checkout @{-1} | ||
git branch -D release | ||
git push origin v$(VERSION) | ||
|
||
.PHONY: release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
true: warn(@5@8@10@11@12@14@23@24@26@29@40), bin_annot, safe_string | ||
|
||
<src/*.{ml,mli,byte,native}>: package(ppx_tools.metaquot) | ||
<src_test/*.{ml,byte,native}>: debug, package(oUnit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
open Ocamlbuild_plugin | ||
|
||
(* used in tests *) | ||
let _ = | ||
Unix.putenv "PPX_GETENV_CHECK" "42" | ||
|
||
(* OASIS_START *) | ||
(* OASIS_STOP *) | ||
Ocamlbuild_plugin.dispatch dispatch_default;; | ||
let () = dispatch ( | ||
function | ||
| After_rules -> | ||
flag ["ocaml"; "compile"; "ppx_byte"] & | ||
S[A"-ppx"; A"src/ppx_getenv.byte"]; | ||
flag ["ocaml"; "compile"; "ppx_native"] & | ||
S[A"-ppx"; A"src/ppx_getenv.native"] | ||
| _ -> ()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
opam-version: "1.2" | ||
maintainer: "Peter Zotov <whitequark@whitequark.org>" | ||
authors: [ "Peter Zotov <whitequark@whitequark.org>" ] | ||
license: "Public domain" | ||
homepage: "https://github.com/whitequark/ppx_getenv" | ||
bug-reports: "https://github.com/whitequark/ppx_getenv/issues" | ||
dev-repo: "git://github.com/whitequark/ppx_getenv.git" | ||
tags: [ "syntax" ] | ||
build: [ | ||
"ocaml" "pkg/build.ml" "native=%{ocaml-native}%" | ||
"native-dynlink=%{ocaml-native-dynlink}%" | ||
] | ||
build-test: [ | ||
"ocamlbuild" "-classic-display" "-use-ocamlfind" "src_test/test_ppx_getenv.byte" "--" | ||
] | ||
depends: [ | ||
"ppx_tools" {>= "0.99.1"} | ||
"ounit" {test} | ||
] | ||
available: [ocaml-version >= "4.02.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
version = "%%VERSION%%" | ||
description = "A -ppx extension to replace [%getenv "<var>"] with compile-time value" | ||
ppx = "./ppx_getenv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env ocaml | ||
#directory "pkg" | ||
#use "topkg.ml" | ||
|
||
let () = | ||
let oc = open_out "src_test/_tags" in | ||
output_string oc (if Env.native then "<*.ml>: ppx_native" else "<*.ml>: ppx_byte"); | ||
close_out oc | ||
|
||
let () = | ||
Pkg.describe "ppx_getenv" ~builder:`OCamlbuild [ | ||
Pkg.lib "pkg/META"; | ||
Pkg.bin ~auto:true "src/ppx_getenv" ~dst:"../lib/ppx_getenv/ppx_getenv"; | ||
Pkg.doc "README.md"; | ||
Pkg.doc "LICENSE.txt"] |
Oops, something went wrong.