This patch makes erlware_commons easier to include as a dependency by
removing depedencies that are not needed at run time.
The top-level Makefile creates a .DEV_MODE marker file which is
detected by rebar.config.script. When the marker file is present, the
development only dependencies proper and neotoma are included and a
macro 'DEV_ONLY' is defined. The macro is used to only enable the
proper tests for development mode.
The ec_semver_parser.peg is now located in priv/ and is moved into
src/ by the Makefile. The generated ec_semver_parser.erl is now under
version control; it need not be rebuilt by all projects wishing to
include erlware_commons. It will be rebuilt, as before this change, on
every make invocation.
A `make distclean` now removes the deps directory and all of its
contents. The default target now looks for the presence of the deps
directory to determine if `rebar get-deps compile` should be run. The
main benefit being that one can now do: `make distclean && make`
without a call to `make get-deps`. The get-deps target is left in
place for convenince and back compat.
The get-deps target was updated slightly to run get-deps and compile
as part of a single command. This should be slightly more efficient.
This started with just trying to parse the date format:
December 21st, 2013 7:00pm, which was failing with a bad_date error.
The solution involved setting up "Hinted Months", which was just a term
I used to indicate that a month was specified by name (ie "December"),
rather than by number (ie, "12"). Previously, named months were simply
replaced by their respective numbers in the parser. This tags those
named months so that the parser will unambiguously parse them correctly.
A tagged "Hinted Month" is simply a tuple with the tag `?MONTH_TAG`. For
example: "December" gets converted to `{?MONTH_TAG, 12}`
For example: "Aug 12" and "12 Aug". It's clear to the *reader* what is
meant, but when converted to simply 8 and 12, the parser has no way of
knowing which is which.
Doing this was aided with the addition of some macros to help it
along, since doing just straight comparisons with the hinted months was
yielding unexpected results. For example: `{mon, 1} > 31` returns
true, so changing that comparison to an ?is_year/1 macro that does:
`is_integer(Y) andalso Y > 31`.
It might not be a bad idea to help the parser be *very* unambiguous by
putting these macros on all comparisons.
Signed-off-by: Jordan Wilberding <diginux@gmail.com>
* canonical/next:
massively expand the documentation in the README
bring ec_plists up to erlware standards
replace ec_plists with Stephan's plists
add Stephen Marsh's plists to the system
reorder default tasks so dialyzer is run after compile
add a clean and rebuild task to makefile
add fullpath to the makefile
enable the rebar semver plugin on erlware_commons
cleanup the rebar config
support non-numeric versions in major/minor/patch/minor-patch
support reasonable versioning for erlware_commons
add exists to ec_file
fix bug in ec_file:copy/3 spec
export mkdir_p (this should have been done already)
support four primary version numbers of in parsing
minor whitespace cleanup for ec_semver
provide the ability to format a version into a string as well as parse a version
make sure the docs get run as part of a bare make
fixes for edoc compilation
compilation utilities for the implementors