Open davidzwa opened 4 years ago
A bulletproof CLI tool would be wonderful, no doubt.
I'm quite tempted to just let you do whatever you want - it just needs to work on Linux, macOS and Windows :slightly_smiling_face:
I have zero knowledge about powershell... How would I run it on my Linux machine?
... actually having the tool as a separate project might be even better - that way support tickets for the tool don't end up here - or at least I have a place to send people to, if you catch my drift. We can just make it an official "qtfirebase-setup-tool
"?
Let's first work out the details and then decide on this repo or another. It would still be nice if we are both co-owner to the tool's repo in that case. The tool should help your troubles with understanding issues, so to be able to adjust it is in your benefit.
Powershell for Windows, Linux and Mac are:
Powershell for Windows
Powershell on Windows is directly installable as setup, side-to-side with another version of pwsh
on Path.
Powershell on Mac is installable with Brew.
Powershell on Linux is first-tier supported for these distro's:
And a lot more by community (so basically everything).
The way I would install in on Ubuntu is with snapd
as a snap package as I had issues with direct source install.
I do think powershell is a great scripting tool, but as I said: so is Python (which can do more). What has your preference?
Hmm... I see. :thinking: I think we'll have to go with python here.
My impression about what users find the most "hard"/confusing is currently:
.pro
or some kind of external small key/value file ... but ... you know ... qmake :man_shrugging: ... )..pro
vs. build.gradle
Info.plist
etc.I guess the tool could cover a lot of the above. It's also important that the tool can be re-run (here I'm thinking it has to be able to change SDK/NDK paths continuously).
I have no problem with introducing code/format conventions to help the tool (I.e QTFIREBASE_SDK_PATH
shoudl always have this or that format in the .pro
etc.) - given it's impossible to work around otherwise :slightly_smiling_face:
Nice, so what I'd like to start with is the qmake python interaction. How to run the tool and validate the existence of the right python. We dont want users to be forced to install python, but I would suggest 'if you want help, run the tool' approach. Or to put it differently: 'if you report an issue, include the tools logs'.
Second up for design is the cli itself. My preference is to design: the arguments with argparse
and a config for static arguments. Argparse can merge them easily. Thoughts?
@davidzwa - that sound wonderful! It'd be nice with some more info in the issues for sure.
the arguments with argparse and a config for static arguments. <...>
Sounds good to me - no need to have 2 different input formats to the tool at this point.
Thanks for your input and efforts here - much obliged!
The efforts are mutual, and I cant stand to see something so worthy to fall over because of external changes. This tool is what you have been missing: isolation of problems.
The next TLDR will cover:
Ok so about the qmake interaction, we have to make sure either the tool is blazing fast or that it is run only when needed (bail on a valid/non-dirty state). I hope to focus on the first, but I wont be afraid to fall back to the second.
About the CLI from qmake, I'm thinking about this basic call:
exit_code = $$system($$pwd + '/qtfirebase_cli.py')
This should listen for the returned error code, and continue 'just fine if exit_code == 0' otherwise the qmake should error out and quit with a reference to where the analysis log can be found. I mean, you ran the tool for a reason: save time, get analysis before make/deploy.
Pipfile
(+Pipfile) on the repository as primary focus, as this is a self-healing solution for dependencies.logging
, as we depend on filtered logging. Default in python.argparse
, as we need a correct CLI interaction.requests
only when configuration says 'download firebase SDK|Android-SDK|iOS-SDK to be non-falsy'
"Could not find
requests
and you've configured QtFirebaseCLI to download firebase for you, which was found to be missing. Please install dependencies from the Pipfile using Pipenv or requirements.txt using pip. Skipping SDK download. Expecting build failure!"
py7zr
for 7zip only when configuration says 'download firebase SDK|Android-SDK|iOS-SDK to be non-falsy'As per config I'm thinking of at least the following requirements:
[-a action] [-l log_level] [-t target] [-build_args ... any future SDK/NDK/ROOT arguments passed into the CLI as keyvalue or JSON]
[QtFirebaseAnalysisConfig] PYTHON_PATH="optional_python_3.7+_path_here,advise_leave_unset" log_level=debug|3|information|2|warning|1|silent|0 target=ios|android|other logs="optional_existingornonexisting_relativeorabsolute_path_to_analsysis_logs" action=analysis|sync
Please read it through, I know it's quite in-depth, so you can skip the stuff non-essential to QtFirebase <-> deployment as long as you validate the following design choice:
Users of QtFirebase accept that they need to setup their system properly concerning Python, if they don't, this tool cannot provide them the full ease of setup. If they cannot install requests/py7zr, we provide fall-back to downloading Firebase to a location specified by default or specified manually.
@davidzwa it looks really good - engage! 😀
Will start reporting once started, nice task with a bit of change
Looking forward to see it! I've been wanting something like this for the project in ages.
Running python from QMake:
Project MESSAGE: INFO: 2020-08-03 23:53:12,646 [run_cli.py:6]: qtfirebase cli quit sucessfully
Project MESSAGE: INFO: 2020-08-03 23:53:12,733 [run_cli.py:6]: qtfirebase cli quit sucessfully
Running python from QMake with error:
Project MESSAGE: CRITICAL: 2020-08-03 23:54:09,571 [run_cli.py:7]: qtfirebase cli had a big ouch
Project MESSAGE: CRITICAL: 2020-08-03 23:54:09,658 [run_cli.py:7]: qtfirebase cli had a big ouch
W.I.P. please read the TODO.md to discuss what's next after I'm done with the tasks for the upcoming week/ 2 weeks.
https://github.com/davidzwa/QtFirebaseCLI
Hope you like my 2 hours of slamming a keyboard really hard
@davidzwa looks good at a glance - nice job! I'm a bit busy these days but will get back ASAP. Thanks for doing this!
No worries, will continue as planned next time I find free time.
As was already discussed, we'd possibly like to enhance qmake in a most non-intrusive way with very little maintanance. The reason is for the required FIREBASE_SDK_CPP environment variable which needs to be picked up by the deployment target at hand (Windows, Linux, iOS, Linux Android).
I'd like to think out how we would approach such a thing:
The CLI would have the following requirements:
qmake/deploy-prep
,dry-run analysis
andprep/download files like firebase SDK
Don't worry about the work/effort: I will take care of it. It's more a question of if you'd be interested in it and if the requirements align with what you think of it. Only then I will even start thinking about making such a plugin qmake tool.