Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small waf improvement steps #907

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Small waf improvement steps #907

wants to merge 5 commits into from

Conversation

kiilerix
Copy link
Contributor

No description provided.

No tabs and no trailing spaces.
libs/temporal/wscript only uses APPNAME for convenience for test
purposes. It can just be a local variable. Temporal is not so
independent that it can be used as a separate waf project with its own
APPNAME.
Try to make it a bit more clear what is going on with class and def for
i18n commands.

It was confusing that we first defined i18n classes in the beginning of
the wscript file, and then replaced them with "plain" functions with the
same name at the end. pyflakes also didn't like it.

It seemed magic. The i18n functionality easily broke if trying to touch
that. It deserves an explanation to make it maintainable ... and some
cleanup.

Simple functions in the top level wscript file are generally exposed as
custom waf commands. The command will have the same name as the function
and will get a plain Context. But that simple method doesn't work for
these i18n commands. They have to be declared in a different way with a
custom BuildContext, as seen and described in the comment.

The name of the BuildContext classes doesn't matter, so we change the
name to avoid the name collision and to give a hint how they actually
just are contexts for the commands - they are not the command itself. We
also place the classes next to the corresponding functions so it is more
obvious that they are related.
Rename the worker functions to make it clear that their name in this
case isn't magic. These functions "are not" the waf commands. It is the
custom build context class definitions that define the i18n commands ...
which will invoke these top level worker functions which in turn invoke
the others recursively.

The bare printing of the build environment in the top level i18n command
seems to be old debug code that safely can be removed.
@kiilerix
Copy link
Contributor Author

Please ignore "wscript: make APPNAME a local variable in temporal wscript" for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant