Remove the --debug option, which is superseded by the semantically
richer --log-level debug in the base class.
Signed-off-by: Jan Lindemann <jan@janware.com>
Derive jw.pkg.App from jw.pkg.lib.App. App.run() dissolves as follows:
- Its sub-command invocation logic is left to the base class
- parser.add_arguments() are moved into self._add_arguments()
- So is handling of early-parsed arguments
- async def _run() is reimplemented to set some member variables
Signed-off-by: Jan Lindemann <jan@janware.com>
Add App and Cmd as generic base classes for multi-command
applications. The code is taken from jw-python: The exising
jw.pkg.App is very similar to the more capable jwutils.Cmds class,
so, to avoid code duplication, add it here to allow for jwutils.Cmds
and jw.pkg.App to derive from it at some point in the future.
Both had to be slightly modified to work within jw-pkg's less
equipped context, and will need futher code cleanup.
Signed-off-by: Jan Lindemann <jan@janware.com>
Types is a container for types, notably classes, which are
dynamically loaded from other modules. Which modules are loaded is
based on the following criteria passed to its constructor:
- mod_names: A list of modules to load and investigate
- type_name_filter: A regular filter expression or None (default).
If it's None, all types pass this filter.
- type_filter: A list of types the returned types must match.
Defaults to [], in which case all types pass this filter
Signed-off-by: Jan Lindemann <jan@janware.com>
A dedicated logging module is currently provided by jw-python, but
since it's often needed also in jw-pkg, and it's relatively small and
maintainable, it seems justified to move it into jw-pkg.
Signed-off-by: Jan Lindemann <jan@janware.com>
CmdGetval.add_arguments() uses self.app.top_name, which may or may
not be initialized at the time this runs. Not using it makes
CmdGetval's ctor safe to run in the context of App.__init__().
Signed-off-by: Jan Lindemann <jan@janware.com>
--prefix doesn't denote an "App Path Prefix", "Parent directory of
project source directories" decribes it better.
Signed-off-by: Jan Lindemann <jan@janware.com>
Make jw-projects.py list-repos support a local directory as base URL
of all git repositories, notably used by PROJECTS_DIR_REMOTE_BASE,
which can now point to a local directory.
Signed-off-by: Jan Lindemann <jan@janware.com>
For a project to supply templates, it needs to advertise their
location. For this, the tmpl_dir make variable is added to
projects.mk. If other-project wants to get hold of some-project's
templates, it can do, e.g.:
TEMPLATES = $(wilcard $(call tmpl_dir,some-project)/*.tmpl)
To achieve this, support for the tmpls-dir command is added to
jw-projects.py.
Signed-off-by: Jan Lindemann <jan@janware.com>
jw-build doesn't stop at building software, packaging it afterwards
is also a core feature, so this commit gives the package a better
name.
The commit replaces strings s/jw-build/jw-pkg/ in text files and file
names. Fallout to the functionality is fixed, variable names are left
as they are, though. To be adjusted by later commits.
Signed-off-by: Jan Lindemann <jan@janware.com>