Comments (13)
Looking forward to see it!
I've been wanting something like this for the project in ages.
from qtfirebase.
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
from qtfirebase.
No worries, will continue as planned next time I find free time.
from qtfirebase.
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 🙂
I have zero knowledge about powershell... How would I run it on my Linux machine?
from qtfirebase.
... 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
"?
from qtfirebase.
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:
- Core variants (v6 and 7) -> cross-platform
Powershell for Windows
- .NET variant (5) -> not cross-platform, but code-compatible
- Core variants (v6 and 7) -> cross-platform
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:
- Ubuntu 16.04
- Ubuntu 18.04
- Debian 8
- Debian 9
- Debian 10
- Alpine 3.9 and 3.10
- CentOS 7
- Red Hat Enterprise Linux (RHEL) 7
- Fedora 28
- Fedora 29
- Fedora 30
- openSUSE 42.3
- openSUSE Leap 15
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?
from qtfirebase.
Hmm... I see. 🤔
I think we'll have to go with python here.
My impression about what users find the most "hard"/confusing is currently:
- All the places you need to set the sdk/ndk paths (ideally it would follow the value of an entry from the users
.pro
or some kind of external small key/value file ... but ... you know ... qmake 🤷♂️ ... ). - Some kind of assurance to which/each part of the setup "looks ok" (some kind of validation of at least SDK and NDK paths)
- Setup of messaging (on iOS there's a lot of web interface fiddling which we can't do much about?)
- "Exotic" configs when not using all firebase modules at once - what to include/exclude in
.pro
vs.build.gradle
Info.plist
etc. - Probably much more I never see in the issues :)
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 🙂
from qtfirebase.
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?
from qtfirebase.
@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!
from qtfirebase.
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:
- Qmake/python interaction
- Dependencies (avoiding cry-baby issues: isolating package dependencies, placing responsibility to user, not us.)
- Configuration file description
Qmake/python interaction
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.
Dependencies:
- Will not install dependencies, but we will provide both a Pipfile and requirements.txt file for people to get started. If they do not install dependencies, we cannot guarantee a downloaded and extracted Firebase SDK. This is not our responsibility: we just provide ease of setup.
- Will use
Pipfile
(+Pipfile) on the repository as primary focus, as this is a self-healing solution for dependencies. - Will import default
logging
, as we depend on filtered logging. Default in python. - Will import default
argparse
, as we need a correct CLI interaction. - Will import installed
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!"
- Will import installed
py7zr
for 7zip only when configuration says 'download firebase SDK|Android-SDK|iOS-SDK to be non-falsy' - We will not support Python 2 (https://www.python.org/doc/sunset-python-2/)
- We will have to declare non-support for 3.7 in half a year: this tool is meant for serious development, and not outdated systems. (so 3.7/3.8/3.9 is our focus for now, after 2020 only 3.8/3.9)
Configuration file description
As per config I'm thinking of at least the following requirements:
- PYTHON_PATH unset/set to valid path with python binary (I want people to be able to freely choose a python version, as well as use their default python on the command line)
- All other commands are also available per cli arguments in the format of
[-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.
from qtfirebase.
@davidzwa it looks really good - engage! 😀
from qtfirebase.
Will start reporting once started, nice task with a bit of change
from qtfirebase.
@davidzwa looks good at a glance - nice job!
I'm a bit busy these days but will get back ASAP. Thanks for doing this!
from qtfirebase.
Related Issues (20)
- Using Qtfirebase HOT 13
- Cloud Storage HOT 5
- Getting Value from Firebase Real-time Database (Qt c++) HOT 1
- QString::sprintf was removed in Qt 5.14.x? HOT 11
- Support for Android AAB (Armv7 & Armv8) HOT 6
- Compatible Firebase SDK versions HOT 1
- Not able to Create QtFirebase object in my main.qml for Android. HOT 2
- Links markdown broken HOT 1
- Bundle of improvements HOT 3
- Debugging console HOT 9
- Code signing error HOT 5
- Push notifications while in foreground HOT 9
- Can't compile with QTFIREBASE_CONFIG += analytics messaging for iOS HOT 2
- Qt 6 Support ? HOT 1
- Subscribing to topic nets no result HOT 6
- Linking failed on iOS HOT 10
- Build project with CMakeLists.txt instead of .pro HOT 2
- Subscribe method isn't working on the latest firebase_cpp_sdk (10.0.0) HOT 1
- Qt create how to config my kit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtfirebase.