From b14dc7a082bf50f649386222720778ba559730b2 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 1 Oct 2025 03:01:00 -0400 Subject: [PATCH] [IMP] mobile home installation and run --- .gitignore | 1 + conf/git_manifest_mobile.csv | 3 +++ manifest/git_manifest_mobile_home.xml | 12 ++++++++++ mobile/compile_and_run.sh | 19 +++++++++++++++ mobile/install_and_run.sh | 4 ++++ mobile/install_mobile_dev.sh | 5 ++++ script/git/git_merge_repo_manifest.py | 12 ++++++++++ script/install/install_erplibre.sh | 1 + .../manifest/update_manifest_local_mobile.sh | 23 +++++++++++++++++++ script/todo/todo.py | 5 ++++ 10 files changed, 85 insertions(+) create mode 100644 conf/git_manifest_mobile.csv create mode 100644 manifest/git_manifest_mobile_home.xml create mode 100755 mobile/compile_and_run.sh create mode 100755 mobile/install_and_run.sh create mode 100755 mobile/install_mobile_dev.sh create mode 100755 script/manifest/update_manifest_local_mobile.sh diff --git a/.gitignore b/.gitignore index 33cabcb..dfe55fd 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ screenshots screencasts private/todo/todo_override_private.json .erplibre.error.txt +/mobile/technolibre_home_mobile/ diff --git a/conf/git_manifest_mobile.csv b/conf/git_manifest_mobile.csv new file mode 100644 index 0000000..2279431 --- /dev/null +++ b/conf/git_manifest_mobile.csv @@ -0,0 +1,3 @@ +"filepath" +manifest/git_manifest_erplibre.xml +manifest/git_manifest_mobile_home.xml diff --git a/manifest/git_manifest_mobile_home.xml b/manifest/git_manifest_mobile_home.xml new file mode 100644 index 0000000..59dcd18 --- /dev/null +++ b/manifest/git_manifest_mobile_home.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/mobile/compile_and_run.sh b/mobile/compile_and_run.sh new file mode 100755 index 0000000..f8f157a --- /dev/null +++ b/mobile/compile_and_run.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +if [[ ! -d "./mobile/technolibre_home_mobile" ]]; then + echo "Please, run installation ./mobile/install_mobile_dev.sh before run this script ./mobile/compile_and_run.sh" + exit 1 +fi + +if [[ ! -d "./mobile/technolibre_home_mobile/technolibre_home" ]]; then + echo "Please, check repo is working." + exit 1 +fi + +cd mobile/technolibre_home_mobile/technolibre_home + +npm install +npm run build && npx cap sync +npx cap run android + +cd - diff --git a/mobile/install_and_run.sh b/mobile/install_and_run.sh new file mode 100755 index 0000000..2616f44 --- /dev/null +++ b/mobile/install_and_run.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +mobile/install_mobile_dev.sh +mobile/compile_and_run.sh diff --git a/mobile/install_mobile_dev.sh b/mobile/install_mobile_dev.sh new file mode 100755 index 0000000..c52ebdc --- /dev/null +++ b/mobile/install_mobile_dev.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +./script/install/install_erplibre.sh +./script/install/install_git_repo.sh +./script/manifest/update_manifest_local_mobile.sh diff --git a/script/git/git_merge_repo_manifest.py b/script/git/git_merge_repo_manifest.py index 3a7bb48..7d60ca9 100755 --- a/script/git/git_merge_repo_manifest.py +++ b/script/git/git_merge_repo_manifest.py @@ -20,6 +20,9 @@ _logger = logging.getLogger(__name__) DEFAULT_PATH_MANIFEST_CONF = os.path.join("conf", "git_manifest.csv") +DEFAULT_PATH_MANIFEST_MOBILE_CONF = os.path.join( + "conf", "git_manifest_mobile.csv" +) DEFAULT_PATH_MANIFEST_ODOO_CONF = os.path.join("conf", "git_manifest_odoo.csv") DEFAULT_PATH_MANIFEST_PRIVATE_CONF = os.path.join( "private", "default_git_manifest.csv" @@ -59,6 +62,11 @@ def get_config(): parser.add_argument( "--with_OCA", action="store_true", help="Add OCA manifest" ) + parser.add_argument( + "--with_mobile", + action="store_true", + help="Add mobile project manifest", + ) args = parser.parse_args() return args @@ -117,6 +125,10 @@ def main(): if os.path.exists(path_manifest_odoo_version): lst_input.append(path_manifest_odoo_version) + elif config.with_mobile: + append_file_path_manifest( + lst_input, DEFAULT_PATH_MANIFEST_MOBILE_CONF + ) else: append_file_path_manifest(lst_input, DEFAULT_PATH_MANIFEST_CONF) append_file_path_manifest( diff --git a/script/install/install_erplibre.sh b/script/install/install_erplibre.sh index 9173baf..d74178a 100755 --- a/script/install/install_erplibre.sh +++ b/script/install/install_erplibre.sh @@ -3,3 +3,4 @@ python3 -m venv .venv.erplibre source .venv.erplibre/bin/activate pip3 install -r requirement/erplibre_require-ments.txt +npm install diff --git a/script/manifest/update_manifest_local_mobile.sh b/script/manifest/update_manifest_local_mobile.sh new file mode 100755 index 0000000..ece9d2e --- /dev/null +++ b/script/manifest/update_manifest_local_mobile.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +. ./env_var.sh +#EL_MANIFEST_PROD="./default.xml" +#EL_MANIFEST_DEV="./manifest/default.dev.xml" + +# Update git-repo +git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose & +DAEMON_PID=$! + +if [ -L "$EL_MANIFEST_DEV" ]; then + MANIFEST_TARGET=$(readlink -f "$EL_MANIFEST_DEV") +else + MANIFEST_TARGET="$EL_MANIFEST_DEV" +fi + +# Generate local manifest +.venv.erplibre/bin/python ./script/git/git_merge_repo_manifest.py --output .repo/local_manifests/erplibre_manifest.xml --with_mobile + +.venv.erplibre/bin/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --verify HEAD) -m ${MANIFEST_TARGET} "$@" +.venv.erplibre/bin/repo sync -c -j $(nproc --all) -v -m ${MANIFEST_TARGET} + +kill ${DAEMON_PID} diff --git a/script/todo/todo.py b/script/todo/todo.py index 572b94c..bf05735 100755 --- a/script/todo/todo.py +++ b/script/todo/todo.py @@ -323,6 +323,11 @@ class TODO: "w: Install all Odoo version with ERPLibre", "make install_odoo_all_version", ), + "m": ( + "m", + "m: ERPLibre with mobile home", + "./mobile/install_and_run.sh", + ), "0": ( "0", "0: Quitter",