Commit Graph

16 Commits

Author SHA1 Message Date
Antonin Décimo
f43a111c81 Fix #26, regression in 86a936f 2015-11-17 20:09:07 +01:00
Antonin Décimo
c1688d281d Add main function. Update Makefile accordingly. 2015-09-28 09:55:20 +02:00
Antonin Décimo
8acc70afd4 Fix for #23, but Windows icons doesn't work yet. 2015-09-06 19:57:31 +02:00
Antonin Décimo
1a70aa54a6 Add dependency check 2015-08-30 15:51:07 +02:00
Antonin Décimo
e20238a6ac Bug fixes on OS X, add GNU readlink as deps #20
Makefile:
- short help was not properly created

love-release.sh:
- script aborts if GNU getopt is not found
- add GNU readlink as dependency, will check for greadlink too

README.md:
- add GNU readlink as dependency
2015-07-12 16:20:11 +02:00
Antonin Décimo
a078106148 Compatibility GNU/BSD, fix #20
Changed `sed -r` to `sed -E`. OSX does not support `sed -r` while
FreeBSD does. GNU sed seems to support `sed -E` even if it is not
in the man page.
Changed install command.
2015-07-06 12:19:33 +02:00
Antonin Décimo
3034c43cc0 Rewrite example.sh to modules.md 2015-06-26 19:34:17 +02:00
Antonin Décimo
0e9c8b624d Add modules options in short help 2015-06-26 19:21:27 +02:00
Antonin Décimo
2dc8fd07d5 Update bash completion 2015-06-24 00:23:03 +02:00
Antonin Décimo
979ddf5719 Options can be prefixed for a specific module
Options can now be prefixed to be used only for the module the prefix
corresponds to. For example `--author` will set the author's name for
the whole project, but `--Wauthor` will set it for Windows only and
`--Dauthor` for Debian only.

If a module requires new options, they will be automatically prefixed at
compilation.
Most of the modules options have been renamed for consistency.

The `read_option` function was added to parse the default options.
It can use a prefix to parse the options for a module.

Each module now has a specific directory in the cache to allow
per-module cache cleaning.
2015-06-23 22:32:26 +02:00
Antonin Décimo
63bb8cc807 Add new options, rename some
Modules options have been capitalized.
"project's name" was renamed to "project's title".
Many options to set global variables were added.
"--clean" option was reimplemented.
2015-06-23 17:41:01 +02:00
Antonin Décimo
6302efed97 Options & file args support with GNU getopt
Short options are stored in the OPTIONS variable, and longs in
LONG_OPTIONS. Modules scripts need to add theses to be able to use
options. Theses lines are then parsed by sed at make-time and added to
the corresponding variable in the main script.

init_module now requires a third argument corresponding to the option
that will trigger the execution of the module.

Files can also be passed by argument to zip. They are stored in the
FILES array.

check_deps:
    - add dependency check for GNU getopt,
    - echo errors to stderr

gen_version now returns 0 on success and 1 on failure.

Add short_help function. Shown if -h options is passed, or on parsing
options failure.

exit_module:
    - add 'options' exit value if there is an error while parsing the
      options,
    - add 'version' exit value if there is an error while generating
      LÖVE version from user input.

dump_var shows files to zip.

Script will now exit if it has not been embedded nor installed.
Fix bugs with default module.
2015-06-22 22:54:49 +02:00
Antonin Décimo
3b48234432 Install example.sh 2015-06-16 21:12:31 +02:00
Antonin Décimo
2c588118af Modules and functions have return values
Modules can now use return values with the exit_module function.
Some return values are predefined, use them by passing special string
to the function.

Most of the functions also switched from a echo "true" to return 0
scheme, which means that every test involving theses functions was
rewritten.

No more need for the reset_vars function, as modules are run in
subshells, thus providing a new scope level.

The case when no modules is specified is better handled, a LÖVE file is
created by default.
2015-06-16 17:38:44 +02:00
Antonin Décimo
72ada933f1 Improves modules sourcing
A module should always begin with a test to `execute_module` to see if
it should be executed. As modules are always sourced
(even when embedded), a simple `return` will stop the subscript.

Modules are executed in a subscript, so the global space will not be
polluted, and will also be reset after the execution of the module.

This commit also solves some bugs in Makefile and lua parser.
2015-06-16 13:33:43 +02:00
Antonin Décimo
9dd8d37d3d Changes in build/install, config, modules, cli 2015-06-13 01:12:04 +02:00