Move shell helper functions to a dedicated lib directory

In preparation for additional shell scripts, common utility functions
have been moved to a dedicated shell library folder.

Change-Id: Ie76fa1d5bdbc77c5e81070eb61de03eb1041c8b1
4 files changed
tree: e04a2262f4c78425677cb47986d6eaab58358152
  1. bin/
  2. jira/
  3. lava/
  4. python-libs/
  5. shell-libs/
  6. .gitignore
  7. LICENSE
  8. NOTICE
  9. pylintrc
  10. pyproject.toml
  11. README.md
  12. requirements-dev.txt
  13. tox.ini
  14. vendorsetup.sh
README.md

Fairphone Android tools

A collection of tools developed at Fairphone related to Android development:

  • Standalone scripts live in bin:
    • fetch-and-push-partner: a script to fetch the AOSP partner security branches in the Android tree and push them to our own repositories.
    • fetch-and-push-remote: a script to fetch remote branches and tags in the Android tree and push them to our own repositories.
    • merge-partner-on-aosp: a script to merge the AOSP partner security branches in the Android tree.
    • ota_install: a script to push an OTA to a device and initiate the update process with the Fairphone Updater.
    • store-android-build-keys-in-keystore: a script to store PKCS8 keys in a JKS keystore suitable for signing apps with gradle.
  • Installable libraries live in their own directory within <language>-libs:
    • python-libs/android-tools: A support library to work with Android devices and apps in Python 3.
    • shell-libs: A collection of shell scripts for handling common shell commands and operations.
  • Installable tools live in their own directory:
    • lava: tools to interact with LAVA, the automated testing system.
    • jira: Script to import CSV defined configuration into the Fairphone JIRA instance. The script can create users, groups and components. Run ./import_csv_to_jira.py --help for details.

See the individual tools help (--help) or projects README for installation and usage.

TODO: Migrate the LAVA tools in lava to an installable Python package.

Developing

Code style, linters, and formatters must be used before submitting any new tool or patchset. Maximal line lengths are fixed to 80 characters.

Install the selected toolset within a Python 3.6 (virtual) environment:

$ pip3 install -r requirements-dev.txt

We detail below the recommendations (read: requirements) per language and how to run the tools in a standalone fashion.

Bash/Shell (.sh)

Note: Portable shell scripts are favoured over Bash scripts.

Follow what the Bashate style checker recommends.

$ bashate --verbose <file>

Python (.py)

Note: Python 3.6 is the current development choice.

Let Black format Python files for you.

$ black <file>

Trust that the linting tools (flake8 and pylint) know better and follow their advice.

$ flake8 <file>
$ pylint <file>

License

The project is made available under the terms of the Apache 2.0 license. See LICENSE for details.