From b8d34a1a3d8c278359f7774f79dc44b1ed536f97 Mon Sep 17 00:00:00 2001 From: Adham Date: Sat, 30 Jul 2022 13:10:03 +0100 Subject: [PATCH 01/12] Initial commit of project skeleton files. --- .../project-skeleton/tools/.gitattributes | 12 +++++ .../tools/.github/ISSUE_TEMPLATE.md | 32 ++++++++++++ .../tools/.github/ISSUE_TEMPLATE/FEATURE.md | 27 ++++++++++ .../tools/.github/ISSUE_TEMPLATE/ISSUE.md | 48 ++++++++++++++++++ .../tools/.github/ISSUE_TEMPLATE/QUESTION.md | 15 ++++++ .../tools/.github/ISSUE_TEMPLATE/config.yml | 1 + .../tools/.github/PULL_REQUEST_TEMPLATE.md | 21 ++++++++ .../.github/PULL_REQUEST_TEMPLATE/ccc.md | 49 +++++++++++++++++++ .../pull_request_template.md | 42 ++++++++++++++++ Artistry/project-skeleton/tools/.gitignore | 46 +++++++++++++++++ .../tools/subprojects/catch2.wrap | 10 ++++ .../tools/subprojects/cmocka.wrap | 10 ++++ .../tools/subprojects/etl.wrap | 4 ++ .../tools/subprojects/libc.wrap | 4 ++ .../tools/subprojects/libcpp.wrap | 4 ++ .../tools/subprojects/libmemory.wrap | 4 ++ 16 files changed, 329 insertions(+) create mode 100644 Artistry/project-skeleton/tools/.gitattributes create mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md create mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md create mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md create mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md create mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml create mode 100644 Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md create mode 100644 Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md create mode 100644 Artistry/project-skeleton/tools/.gitignore create mode 100644 Artistry/project-skeleton/tools/subprojects/catch2.wrap create mode 100644 Artistry/project-skeleton/tools/subprojects/cmocka.wrap create mode 100644 Artistry/project-skeleton/tools/subprojects/etl.wrap create mode 100644 Artistry/project-skeleton/tools/subprojects/libc.wrap create mode 100644 Artistry/project-skeleton/tools/subprojects/libcpp.wrap create mode 100644 Artistry/project-skeleton/tools/subprojects/libmemory.wrap diff --git a/Artistry/project-skeleton/tools/.gitattributes b/Artistry/project-skeleton/tools/.gitattributes new file mode 100644 index 0000000..a16f581 --- /dev/null +++ b/Artistry/project-skeleton/tools/.gitattributes @@ -0,0 +1,12 @@ +*.pdf filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.xlsx filter=lfs diff=lfs merge=lfs -text +*.docx filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.out filter=lfs diff=lfs merge=lfs -text +*.hex filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..796ad28 --- /dev/null +++ b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,32 @@ +# Expected Behavior + +Please describe the behavior you are expecting + +# Current Behavior + +What is the current behavior? + +# Failure Information (for bugs) + +Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. + +## Steps to Reproduce + +Please provide detailed steps for reproducing the issue. + +1. step 1 +2. step 2 +3. you get it... + +## Context + +Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. + +* Firmware Version: +* Operating System: +* SDK version: +* Toolchain version: + +## Failure Logs + +Please include any relevant log snippets or files here. diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md new file mode 100644 index 0000000..b2465a4 --- /dev/null +++ b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md @@ -0,0 +1,27 @@ +--- +name: Feature Request +about: Use this template for requesting new features +title: "[FEATURE NAME]" +labels: enhancement +assignees: phillipjohnston +--- + +## Expected Behavior + +Please describe the behavior you are expecting + +## Current Behavior + +What is the current behavior? + +## Sample Code + +If applicable, provide a sample code snippet that demonstrates the gist of feature you're proposing. This can be either from a usage standpoint, or an implementation standpoint. + +## Context + +Please provide any relevant information about your setup, which will help us ensure the requested support will work for you. + +* Project Version: +* Operating System: +* Toolchain version: diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md new file mode 100644 index 0000000..1826256 --- /dev/null +++ b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md @@ -0,0 +1,48 @@ +--- +name: Issue Report +about: Use this template to report a problem +title: "[VERSION] [PROBLEM SUMMARY]" +labels: bug +assignees: phillipjohnston +--- + +## Expected Behavior + +Please describe the behavior you are expecting + +## Current Behavior + +What is the current behavior? + +## Context + +Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. + +* Project Version: +* Operating System: +* Toolchain: +* Toolchain version: + +## Failure Information (for bugs) + +Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. + +### Steps to Reproduce + +Please provide detailed steps for reproducing the issue. + +1. step 1 +2. step 2 +3. you get it... + +### Failure Logs + +Please include any relevant log snippets or files here. + +## Checklist + +- [ ] I am running the latest version +- [ ] I checked the documentation and found no answer +- [ ] I checked to make sure that this issue has not already been filed +- [ ] I'm reporting the issue to the correct repository (for multi-repository projects) +- [ ] I have provided sufficient information for the team diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md new file mode 100644 index 0000000..3defe42 --- /dev/null +++ b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md @@ -0,0 +1,15 @@ +--- +name: Question +about: Use this template to ask a question about the project +title: "[QUESTION SUMMARY]" +labels: question +assignees: phillipjohnston +--- + +## Question + +State your question + +## Sample Code + +Please include relevant code snippets or files that provide context for your question. diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..9098e60 --- /dev/null +++ b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +# Description + +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. + +Fixes # (issue) + +# How Has This Been Tested? + +Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration. + +- [ ] Test A +- [ ] Test B + +# Checklist: + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] Any dependent changes have been merged and published in downstream modules diff --git a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md new file mode 100644 index 0000000..6587d3f --- /dev/null +++ b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md @@ -0,0 +1,49 @@ +# Pull Request Template - Code Change Control + +## Description + +Please include a summary of the change and which issue is fixed. Please provide the motivation for why this change is necessary at this stage of the product development cycle. + +Fixes # (issue) + +## Customer Impact + +Please describe any customer facing impact of this change. This can be positive or negative impact. + +## Performance Impact + +Please describe any relevant performance impact of this change. This can be positive or negative impact. How did you characterize/test the performance impact? + +## How Has This Been Tested? + +Please describe the tests that you ran to verify your changes. Provide instructions so others can reproduce. Please also list any relevant details for your test configuration. + +- [ ] Test A +- [ ] Test B + +**Hardware Configuration(s) Tested**: + +**Software Configuration(s) Tested**: + +* Operating System: +* Software version: +* Branch: +* Toolchain version: +* SDK version: + +## Reviews + +Please identify two developers to review this change + +- [ ] @personA +- [ ] @personB + +## Checklist: + +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged and published in downstream modules diff --git a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 0000000..62988b9 --- /dev/null +++ b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,42 @@ +# Pull Request Template + +## Description + +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. + +Fixes # (issue) + +## Type of change + +Please delete options that are not relevant. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] This change requires a documentation update + +## How Has This Been Tested? + +Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration + +- [ ] Test A +- [ ] Test B + +**Test Configuration(s)**: + +* Firmware version: +* Hardware: +* Toolchain: +* SDK: + +## Checklist: + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged and published in downstream modules +- [ ] I have checked my code and corrected any misspellings diff --git a/Artistry/project-skeleton/tools/.gitignore b/Artistry/project-skeleton/tools/.gitignore new file mode 100644 index 0000000..488d4ac --- /dev/null +++ b/Artistry/project-skeleton/tools/.gitignore @@ -0,0 +1,46 @@ +# Generated Files +**/buildresults/** + +# Sublime-generated Files +*.sublime-workspace + +# Meson subprojects +**/subprojects/** +!**/subprojects/*.wrap + +######################## +# C / C++ Ignore Rules # +######################## + +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app diff --git a/Artistry/project-skeleton/tools/subprojects/catch2.wrap b/Artistry/project-skeleton/tools/subprojects/catch2.wrap new file mode 100644 index 0000000..2e20085 --- /dev/null +++ b/Artistry/project-skeleton/tools/subprojects/catch2.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = Catch2-2.11.3 + +source_url = https://github.com/catchorg/Catch2/archive/v2.11.3.zip +source_filename = Catch2-2.11.3.zip +source_hash = c5a0a7510379c6f37f70b329986a335a7b8489d67ac417ce8f4262d0cae4cc5d + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/catch2/2.11.3/1/get_zip +patch_filename = catch2-2.11.3-1-wrap.zip +patch_hash = 63c09cb68280435040ad304b3dd87ecfe69dbc216608991d0a82569a63119e57 diff --git a/Artistry/project-skeleton/tools/subprojects/cmocka.wrap b/Artistry/project-skeleton/tools/subprojects/cmocka.wrap new file mode 100644 index 0000000..21e84f9 --- /dev/null +++ b/Artistry/project-skeleton/tools/subprojects/cmocka.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = cmocka-1.1.5 + +source_url = https://cmocka.org/files/1.1/cmocka-1.1.5.tar.xz +source_filename = cmocka-1.1.5.tar.xz +source_hash = f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/cmocka/1.1.5/3/get_zip +patch_filename = cmocka-1.1.5-3-wrap.zip +patch_hash = 81ce48613680d3c3a0b396ac570c852b290adcd18202fb16aaf703a9493f4348 diff --git a/Artistry/project-skeleton/tools/subprojects/etl.wrap b/Artistry/project-skeleton/tools/subprojects/etl.wrap new file mode 100644 index 0000000..62ce760 --- /dev/null +++ b/Artistry/project-skeleton/tools/subprojects/etl.wrap @@ -0,0 +1,4 @@ +[wrap-git] +url = git@github.com:ETLCPP/etl.git +revision = master +clone-recursive = true diff --git a/Artistry/project-skeleton/tools/subprojects/libc.wrap b/Artistry/project-skeleton/tools/subprojects/libc.wrap new file mode 100644 index 0000000..658c0ed --- /dev/null +++ b/Artistry/project-skeleton/tools/subprojects/libc.wrap @@ -0,0 +1,4 @@ +[wrap-git] +url = git@github.com:embeddedartistry/libc.git +revision = master +clone-recursive = true diff --git a/Artistry/project-skeleton/tools/subprojects/libcpp.wrap b/Artistry/project-skeleton/tools/subprojects/libcpp.wrap new file mode 100644 index 0000000..c56285f --- /dev/null +++ b/Artistry/project-skeleton/tools/subprojects/libcpp.wrap @@ -0,0 +1,4 @@ +[wrap-git] +url = git@github.com:embeddedartistry/libcpp.git +revision = master +clone-recursive = true diff --git a/Artistry/project-skeleton/tools/subprojects/libmemory.wrap b/Artistry/project-skeleton/tools/subprojects/libmemory.wrap new file mode 100644 index 0000000..006b657 --- /dev/null +++ b/Artistry/project-skeleton/tools/subprojects/libmemory.wrap @@ -0,0 +1,4 @@ +[wrap-git] +url = git@github.com:embeddedartistry/libmemory.git +revision = master +clone-recursive = true From dfe1f64c95aed4c578715844d384a5b2b58a4abf Mon Sep 17 00:00:00 2001 From: Adham Date: Tue, 9 Aug 2022 23:42:20 +0100 Subject: [PATCH 02/12] adding python Files --- tools python/download_and_deploy.py | 23 ++++++ .../download_and_deploy_config_files.py | 20 +++++ tools python/install_arm.py | 74 +++++++++++++++++++ tools/download_and_deploy_config_files.sh | 2 +- tools/install_arm_gcc.sh | 2 +- 5 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 tools python/download_and_deploy.py create mode 100644 tools python/download_and_deploy_config_files.py create mode 100644 tools python/install_arm.py diff --git a/tools python/download_and_deploy.py b/tools python/download_and_deploy.py new file mode 100644 index 0000000..33233ea --- /dev/null +++ b/tools python/download_and_deploy.py @@ -0,0 +1,23 @@ +import os +import git +import shutil + + +pwd=os.getcwd() +INITIAL_DIR=pwd +os.mkdir(r"C:\tmp") +os.chdir("C:\\tmp") +git.Git().clone("https://github.com/embeddedartistry/project-skeleton","project-skeleton",depth=1) +os.chdir(r"C:\tmp\project-skeleton") +os.chdir(r"C:\tmp\project-skeleton\tools") +#os.system("bash tools/deploy_skeleton.sh $@") +exec(open('deploy_skeleton.py').read()) +os.chdir("c:") +shutil.rmtree(r"C:\tmp\project-skeleton") +os.chdir(f"{INITIAL_DIR}") + + + + + + diff --git a/tools python/download_and_deploy_config_files.py b/tools python/download_and_deploy_config_files.py new file mode 100644 index 0000000..34d4e21 --- /dev/null +++ b/tools python/download_and_deploy_config_files.py @@ -0,0 +1,20 @@ +import os +import git +import shutil + +pwd=os.getcwd() +INITIAL_DIR=pwd +os.mkdir(r"C:\tmp") +os.chdir("C:\\tmp") + +git.Git().clone("https://github.com/embeddedartistry/config-files","config-files",depth=1) +os.chdir("C:\\tmp\\config-files") +exec(open('copy_config.sh').read()) +os.listdir() +os.chdir("C:\\tmp") +shutil.rmtree(r"C:\tmp\config-files") +os.chdir(f"{INITIAL_DIR}") + + + + diff --git a/tools python/install_arm.py b/tools python/install_arm.py new file mode 100644 index 0000000..35674fd --- /dev/null +++ b/tools python/install_arm.py @@ -0,0 +1,74 @@ +import os +import platform +import os.path +import wget +import shutil +import tarfile +import sys + + +# pwd +pwd=os.getcwd() +STARTING_DIR=pwd +# taking arguments from the client +args=sys.argv[1:] +if (args[0]==None): + TOOLCHAIN_INSTALL_DIR = "/usr/local/toolchains " +else : + TOOLCHAIN_INSTALL_DIR = args[0] +#TOOLCHAIN_INSTALL_DIR=input(" Please inssert TOOLCHAIN_INSTALL_DIR :") +if(args[1]==None): + TOOLCHAIN_DISABLE_SUDO = 0 +else : + TOOLCHAIN_DISABLE_SUDO = args[1] + +TOOLCHAIN_SUDO="sudo" + +if (TOOLCHAIN_DISABLE_SUDO==1): + TOOLCHAIN_SUDO = None +OSX_ARM_URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-mac.tar.bz2" +LINUX_ARM_URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-aarch64-linux.tar.bz2" + +if (platform.release() == "Darwin"): + ARM_URL = OSX_ARM_URL + ARM_DIR=os.path.basename(f"{ARM_URL}"+"-mac.tar.bz2") +else: + ARM_URL=LINUX_ARM_URL + ARM_DIR=os.path.basename(f"{ARM_URL}"+"-aarch64-linux.tar.bz2") + +ARM_ARCHIVE=os.path.basename(f"{ARM_URL}") + + +################################### +# Download and install dependency # +################################### + +os.chdir('c:\\tmp') +wget.download(ARM_URL,'c:\\tmp') +os.makedirs(TOOLCHAIN_INSTALL_DIR,exist_ok=True) +# Move current toolchain if it exists +if (os.path.exists(f'{TOOLCHAIN_INSTALL_DIR}/gcc-arm-none-eabi')==True): + os.system("sudo su-") + shutil.rmtree(f"{TOOLCHAIN_INSTALL_DIR}/gcc-arm-none-eabi") + shutil.move(f'{TOOLCHAIN_INSTALL_DIR}/gcc-arm-none-eabi',f'{TOOLCHAIN_INSTALL_DIR}/gcc-arm-none-eabi-bak') +tar=tarfile.open(f"{ARM_ARCHIVE}") +os.chdir(f"{TOOLCHAIN_INSTALL_DIR}") +a=os.getcwd() +tar.extractall(a) # specify which folder to extract to + +tar.close() +shutil.move(f'{TOOLCHAIN_INSTALL_DIR}/{ARM_DIR}',f'{TOOLCHAIN_INSTALL_DIR}/gcc-arm-none-eabi') +os.remove(f"{ARM_ARCHIVE}") +os.chdir(f"{STARTING_DIR}") + + + + + + + + + + + + diff --git a/tools/download_and_deploy_config_files.sh b/tools/download_and_deploy_config_files.sh index 4a4815f..f341b25 100755 --- a/tools/download_and_deploy_config_files.sh +++ b/tools/download_and_deploy_config_files.sh @@ -8,4 +8,4 @@ bash copy_config.sh ls copy_config.sh cd ../ rm -rf config-files -cd $INITIAL_DIR +cd $INITIAL_DIR diff --git a/tools/install_arm_gcc.sh b/tools/install_arm_gcc.sh index 11c1e3c..364c753 100755 --- a/tools/install_arm_gcc.sh +++ b/tools/install_arm_gcc.sh @@ -9,7 +9,7 @@ TOOLCHAIN_INSTALL_DIR=${TOOLCHAIN_INSTALL_DIR:-/usr/local/toolchains} TOOLCHAIN_DISABLE_SUDO=${TOOLCHAIN_DISABLE_SUDO:-0} TOOLCHAIN_SUDO=sudo -if [ $TOOLCHAIN_DISABLE_SUDO == 1 ]; then +if [ $TOOLCHAIN_DISABLE_SUDO == 1 ]; then TOOLCHAIN_SUDO= fi From ea70938e64a24a5d99df36309005cd535303320b Mon Sep 17 00:00:00 2001 From: Adham Date: Sun, 14 Aug 2022 01:56:45 +0100 Subject: [PATCH 03/12] adding another file --- tools python/deploy_skeleton.py | 120 ++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 tools python/deploy_skeleton.py diff --git a/tools python/deploy_skeleton.py b/tools python/deploy_skeleton.py new file mode 100644 index 0000000..7ac8fdf --- /dev/null +++ b/tools python/deploy_skeleton.py @@ -0,0 +1,120 @@ +import getopt +import sys +import os +import subprocess +import platform +import shutil +import git + +USE_ADR=0 +USE_POTTERY=0 +COPY_LICENSE=0 +USE_GIT=1 +USE_SUBMODULES=1 +REPLACE_NAME = None + +def help(): + print("Usage: deploy_skeleton.sh [optional ags] dest_dir ") + print("Optional args:") + print("-a: initialize destination to use adr-tools") + print(" -p: initialize destination to use pottery") + print("-l: copy the license file") + print("-r : Replace template project/app name values with specified name") + print("-g: Assume non-git environment. Installs submodule files directly.") + print("-s: Don't use submodules, and copy files directly") + exit () + +if (platform.release() == "Darwin"): + SED="sed -i ''" +else: + SED="sed -i" + +try : + opts, args = getopt.getopt(sys.argv[1:], "aplghsr:") +except: + print("Error in the getopts function") +for o , a in opts: + if o == "-a" : + USE_ADR = 1 + elif o == "-p": + USE_POTTERY=1 + elif o == "-l": + COPY_LICENSE=1 + elif o == "-g": + USE_GIT=0 + USE_SUBMODULES=0 + elif o =="-r": + REPLACE_NAME=args[0] + elif o =="-h": + help() + + else : + print(f"Invalid option {args[0]}") + help() + +#variable=len(opts) +#for i in range(1,variable) : +# del opts[i] + +CHECK_DIR="c:/subprojects" +pwd=os.getcwd() +CHECK_PATH_1= os.path.exists(f"{CHECK_DIR}/Tools") +if(CHECK_PATH_1==False): + CHECK_DIR=os.chdir(f"{CHECK_DIR}") + CHECK_PATH_1= os.path.exists(f"{CHECK_DIR}") + if(CHECK_PATH_1==False): + print("This script must be run from the project skeleton root or the tools/ directory.") + exit () + + +DEST_DIR=args[0] +DEST_PATH_2= os.path.exists(f"{args[0]}") +if(DEST_PATH_2==False): + DEST_PATH_2= os.path.exists(f"{pwd}/{args[0]}") + if(DEST_PATH_2==False): + DEST_DIR=f"{pwd}/{args[0]}" + else: + print(f"Destination directory {DEST_DIR} cannot be found. Does it exist?") + exit() + + +# Remove .DS_Store files + + +findCMD = f'find . -name ".DS_Store"' +out = subprocess.Popen(findCMD,shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) +for file in os.listdir("c:"): + if file.endswith(".DS_Store"): + shutil.rmtree(file) + + +CORE_FILES="docs src test tools .clang-format .clang-tidy Makefile meson.build meson_options.txt README.md" +GIT_FILES=".gitattributes .github .gitignore" + + +SUBMODULE_DIRS="build" +SUBMODULE_URLS="git@github.com:embeddedartistry/meson-buildsystem.git" + +# Copy skeleton files to the destination + +shutil.copytree(CORE_FILES,DEST_DIR ) +path = os.path.join(DEST_DIR, f"{CHECK_DIR}") +os.mkdir(path) +shutil.copytree("subprojects/*.wrap",f"{DEST_DIR}/subprojects" ) +shutil.rmtree(f"{DEST_DIR}/tools/deploy_skeleton.py") +shutil.rmtree(f"{DEST_DIR}/tools/download_and_deploy.py") +if (USE_GIT == 1): + shutil.copytree(GIT_FILES,DEST_DIR) +if (USE_SUBMODULES==0): + repo = git.repo(pwd) + output = repo.git.submodule('update','--init','--recursive') + shutil.copytree(SUBMODULE_DIRS,DEST_DIR) +if (COPY_LICENSE == 1): + shutil.copytree("LICENSE",DEST_DIR) + +## The following operations all take place in the destination directory + +os.chdir(DEST_DIR) + +# Initialize Submodules + From 932af8068319cfac86973b2ab5c932f46f045265 Mon Sep 17 00:00:00 2001 From: Adham Date: Sun, 14 Aug 2022 22:02:41 +0100 Subject: [PATCH 04/12] adding python files --- tools python/deploy_skeleton.py | 23 +++++++++++- tools python/install_deps.py | 62 +++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 tools python/install_deps.py diff --git a/tools python/deploy_skeleton.py b/tools python/deploy_skeleton.py index 7ac8fdf..4058e93 100644 --- a/tools python/deploy_skeleton.py +++ b/tools python/deploy_skeleton.py @@ -4,7 +4,10 @@ import subprocess import platform import shutil +from turtle import update import git +from git import Repo + USE_ADR=0 USE_POTTERY=0 @@ -106,7 +109,7 @@ def help(): if (USE_GIT == 1): shutil.copytree(GIT_FILES,DEST_DIR) if (USE_SUBMODULES==0): - repo = git.repo(pwd) + repo = git.Repo(pwd) output = repo.git.submodule('update','--init','--recursive') shutil.copytree(SUBMODULE_DIRS,DEST_DIR) if (COPY_LICENSE == 1): @@ -118,3 +121,21 @@ def help(): # Initialize Submodules +if (USE_SUBMODULES==1): + repo = git.Repo(SUBMODULE_URLS) + output = repo.git.submodule('add') + index=Repo.init(SUBMODULE_DIRS).index + index.commit("Add submodules from project skeleton. ") +else : + find = f'find {SUBMODULE_DIRS} -name ".git*"' + out = subprocess.Popen(findCMD,shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + for file in os.listdir(SUBMODULE_DIRS): + if file.endswith(".git*"): + shutil.rmtree(SUBMODULE_DIRS) +if (USE_GIT==1): + repo.git.add(all=True ) + index=Repo.init(SUBMODULE_DIRS).index + index.commit("Initial commit of project skeleton files.") + +if (REPLACE_NAME !=""): + p=subprocess.Popen(f"{SED}") \ No newline at end of file diff --git a/tools python/install_deps.py b/tools python/install_deps.py new file mode 100644 index 0000000..ed6918a --- /dev/null +++ b/tools python/install_deps.py @@ -0,0 +1,62 @@ +import os +import sys +import getopt + +pwd=os.getcwd() +STARTING_DIR=pwd +TOOLCHAIN_INSTALL_DIR="/usr/local/toolchains" +TOOL_INSTALL_DIR="/usr/local/tools" +TOOLCHAIN_DISABLE_SUDO=0 +TOOL_DISABLE_SUDO=0 + + +#commands : +UPDATE=0 +UPDATE_ENV=0 +PIP_UPDATE=None +BREW_COMMAND="install" +APT_COMMAND="install" +TOOLS_SUDO="Sudo" + +BREW_PACKAGE=["python3" ,"ninja" ,"wget" ,"gcc@7" ,"gcc@8" ,"gcc@9" ,"llvm" ,"adr-tools" ,"cmocka" ,"pkg-config"] +BREW_PACKAGE.append["vale","doxygen","cppcheck","clang-format","gcovr","lcov","sloccount"] +APT_PACKAGES=["python3" ,"python3-pip", "ninja-build", "wget" ,"build-essential", "clang" ,"lld" ,"llvm"] +APT_PACKAGES.append=["clang-tools", "libcmocka0" ,"libcmocka-dev" ,"pkg-config" ,"sloccount" ,"curl"] +APT_PACKAGES.append=["doxygen", "cppcheck", "gcovr" ,"lcov" ,"clang-format" ,"clang-tidy", "clang-tools"] +APT_PACKAGES.append=["gcc-7" ,"g++-7", "gcc-8" ,"g++-8", "gcc-9" ,"g++-9"] +PIP3_PACKAGES=["meson" ,"lizard" ,"thefuck"] +try : + opts, args = getopt.getopt(sys.argv[1:], "euhdst") +except: + print("Error in the getopts function") +for o , a in opts : + if o=="-d": + TOOLCHAIN_INSTALL_DIR=input("TOOLCHAIN_INSTALL_DIR : ") + elif o == "-s": + + elif o == "-e": + UPDATE_ENV=1 + elif o == "-u": + UPDATE=1 + PIP_UPDATE="--upgrade" + BREW_COMMAND="upgrade" + APT_COMMAND="upgrade" + + elif o =="-h": + print("Usage: install_deps.sh [optional ags]") + print("Optional args:") + print("-u: Run an update instead of install") + print(" -e: Include environment setup during install process (.bashrc + .bash_profile)") + exit() + + else: + print(f"Invalid option {OPTARG}") + + + + + + + + + From 9905891605c6c1b685d4fa5ccc02f257829cb95e Mon Sep 17 00:00:00 2001 From: Adham Date: Mon, 15 Aug 2022 08:12:07 +0100 Subject: [PATCH 05/12] updating python files --- tools python/download_and_deploy.py | 2 +- tools python/install_deps.py | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools python/download_and_deploy.py b/tools python/download_and_deploy.py index 33233ea..234fd6d 100644 --- a/tools python/download_and_deploy.py +++ b/tools python/download_and_deploy.py @@ -7,7 +7,7 @@ INITIAL_DIR=pwd os.mkdir(r"C:\tmp") os.chdir("C:\\tmp") -git.Git().clone("https://github.com/embeddedartistry/project-skeleton","project-skeleton",depth=1) +git.Git().clone("https://github.com/embeddedartistry/project-skeleton","project-skeleton",depth=1,recursive=True) os.chdir(r"C:\tmp\project-skeleton") os.chdir(r"C:\tmp\project-skeleton\tools") #os.system("bash tools/deploy_skeleton.sh $@") diff --git a/tools python/install_deps.py b/tools python/install_deps.py index ed6918a..6f9525c 100644 --- a/tools python/install_deps.py +++ b/tools python/install_deps.py @@ -33,7 +33,11 @@ if o=="-d": TOOLCHAIN_INSTALL_DIR=input("TOOLCHAIN_INSTALL_DIR : ") elif o == "-s": - + TOOL_INSTALL_DIR=input("TOOL_INSTALL_DIR :") + elif o =="-r": + TOOLCHAIN_DISABLE_SUDO=input("TOOLCHAIN_DISABLE_SUDO :") + elif o =="-z": + TOOL_DISABLE_SUDO=input("TOOL_DISABLE_SUDO :") elif o == "-e": UPDATE_ENV=1 elif o == "-u": @@ -46,13 +50,18 @@ print("Usage: install_deps.sh [optional ags]") print("Optional args:") print("-u: Run an update instead of install") - print(" -e: Include environment setup during install process (.bashrc + .bash_profile)") + print(" -e: Include environment setup during install process (.bashrc + .bash_profile)") exit() else: - print(f"Invalid option {OPTARG}") + print(f"Invalid option {args[0]}") +if (platform.release() == "Darwin"): + if(UPDATE==1): + os.system("brew update") + else: + From f9c6ee15fbf7f430bbdabb62573a2e339d740700 Mon Sep 17 00:00:00 2001 From: Adham Date: Mon, 15 Aug 2022 18:02:24 +0100 Subject: [PATCH 06/12] adding python files --- tools python/setup_env.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tools python/setup_env.py diff --git a/tools python/setup_env.py b/tools python/setup_env.py new file mode 100644 index 0000000..f22e5e2 --- /dev/null +++ b/tools python/setup_env.py @@ -0,0 +1,27 @@ +import getopt +import sys +import platform +import os + +TOOLCHAIN_INSTALL_DIR="/usr/local/toolchains" +TOOL_INSTALL_DIR="/usr/local/tools" + +try : + opts, args = getopt.getopt(sys.argv[1:], "ap:") +except: + print("Error in the getopts function") +for o , a in opts: + if o == "-a" : + TOOLCHAIN_INSTALL_DIR = input("TOOLCHAIN_INSTALL_DIR :") + elif o == "-p": + TOOL_INSTALL_DIR=input("TOOL_INSTALL_DIR :") + else : + print("erreur") + +DEPLOY_URL="https://gist.githubusercontent.com/phillipjohnston/bb95f19d156007f99be4c10c1efdf694/raw/f2f141e31fca0a12eb391e8251efe2ce1f9e68bd/download_and_deploy.sh" +if(platform.release()=="Darwin"): + os.system(r"cat << ENDOFBLOCK >> c:/.bash_profile") + if (os.path.isfile("c:/.bash_profile")==True): + + + From 53dfc9fb78d385a70d0e8c5f7c3f843eedb83156 Mon Sep 17 00:00:00 2001 From: Adham Date: Mon, 15 Aug 2022 22:50:27 +0100 Subject: [PATCH 07/12] updating a python file --- tools python/setup_env.py | 62 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/tools python/setup_env.py b/tools python/setup_env.py index f22e5e2..1287be7 100644 --- a/tools python/setup_env.py +++ b/tools python/setup_env.py @@ -1,13 +1,17 @@ import getopt +from posixpath import basename import sys import platform -import os +import os +import wget +import shutil +import git TOOLCHAIN_INSTALL_DIR="/usr/local/toolchains" TOOL_INSTALL_DIR="/usr/local/tools" try : - opts, args = getopt.getopt(sys.argv[1:], "ap:") + opts, args = getopt.getopt(sys.argv[1:], "aprs:") except: print("Error in the getopts function") for o , a in opts: @@ -15,13 +19,63 @@ TOOLCHAIN_INSTALL_DIR = input("TOOLCHAIN_INSTALL_DIR :") elif o == "-p": TOOL_INSTALL_DIR=input("TOOL_INSTALL_DIR :") + elif o == "-r": + PATH=input("PATH :") + elif o == "-s": + HOME=input("Give Home Directory :") else : - print("erreur") + print("erreur + help function ") DEPLOY_URL="https://gist.githubusercontent.com/phillipjohnston/bb95f19d156007f99be4c10c1efdf694/raw/f2f141e31fca0a12eb391e8251efe2ce1f9e68bd/download_and_deploy.sh" if(platform.release()=="Darwin"): - os.system(r"cat << ENDOFBLOCK >> c:/.bash_profile") + os.system(f"cat {HOME}/.bash_profile") if (os.path.isfile("c:/.bash_profile")==True): + exec(open('c:/.bash_profile').read()) + +PATHMOD=f"{TOOLCHAIN_INSTALL_DIR}/gcc-arm-none-eabi/bin:{TOOL_INSTALL_DIR}/pottery/src" +if (platform.release()=="Darwin"): + PATHMOD=f"{PATHMOD}:/usr/local/opt/llvm/bin" +else: + PATHMOD=f"{PATHMOD}:{TOOL_INSTALL_DIR}:adr-tools/src" + +os.system(f"cat {HOME}/.bashrc") + + +################ +# Path Updates # +################ +PATH= f"{PATHMOD}:\{PATH}" +os.system(f"export PATH={PATH}") +if(os.path.isdir(f"{HOME}/bin")==True): + PATH=f"\{HOME}/bin:\{PATH}" + +os.system(f"cat {HOME}/.bashrc") + +######################### +# Aliases and Functions # +######################### +pwd=os.getcwd() + +def deploy_skeleton(): + INITIAL_DIR=f"\{pwd}" + os.chdir("c/tmp") + wget.download(DEPLOY_URL,'c:\\tmp') + exec(open('download_and_deploy.py').read()) + shutil.rmtree(r"C:\tmp") + os.chdir(pwd) +os.system("alias init_skeleton='deploy_skeleton -a -p `pwd`'") + +def init_repo(): + URL=args[0] + git.Git().clone(f"{URL}","URL") + A=URL.rsplit('/', 1).pop() + os.chdir(f"{A}.git") + os.system("deploy_skeleton -a -p \${@} `pwd`") + +# Skeleton Update Aliases + + + From 18427e1c6f535fb6fa0e053c25f06a0e936dcd23 Mon Sep 17 00:00:00 2001 From: Adham Date: Wed, 17 Aug 2022 23:28:49 +0100 Subject: [PATCH 08/12] updates... --- tools python/deploy_skeleton.py | 122 ++++++++++++++-------------- tools python/download_and_deploy.py | 25 ++++-- 2 files changed, 79 insertions(+), 68 deletions(-) diff --git a/tools python/deploy_skeleton.py b/tools python/deploy_skeleton.py index 4058e93..158bf7d 100644 --- a/tools python/deploy_skeleton.py +++ b/tools python/deploy_skeleton.py @@ -9,12 +9,14 @@ from git import Repo -USE_ADR=0 -USE_POTTERY=0 -COPY_LICENSE=0 -USE_GIT=1 -USE_SUBMODULES=1 -REPLACE_NAME = None +use_adr=0 +use_pottery=0 +copy_license=0 +use_git=1 +use_submodules=1 +replace_name = None +check_dir="c:/subprojects" + def help(): print("Usage: deploy_skeleton.sh [optional ags] dest_dir ") @@ -25,29 +27,33 @@ def help(): print("-r : Replace template project/app name values with specified name") print("-g: Assume non-git environment. Installs submodule files directly.") print("-s: Don't use submodules, and copy files directly") + print("-k : Check directory ") exit () if (platform.release() == "Darwin"): - SED="sed -i ''" + sed="sed -i ''" else: - SED="sed -i" + sed="sed -i" try : - opts, args = getopt.getopt(sys.argv[1:], "aplghsr:") + opts, args = getopt.getopt(sys.argv[1:], "aplghsrk:") except: - print("Error in the getopts function") + print("Error !") + help() for o , a in opts: if o == "-a" : - USE_ADR = 1 + use_adr = 1 elif o == "-p": - USE_POTTERY=1 + use_pottery=1 elif o == "-l": - COPY_LICENSE=1 + copy_license=1 elif o == "-g": - USE_GIT=0 - USE_SUBMODULES=0 + use_git=0 + use_submodules=0 elif o =="-r": - REPLACE_NAME=args[0] + replace_name=args[0] + elif o == "-k": + check_dir=input("CHECK_DIRECTORY : ") elif o =="-h": help() @@ -55,29 +61,26 @@ def help(): print(f"Invalid option {args[0]}") help() -#variable=len(opts) -#for i in range(1,variable) : -# del opts[i] -CHECK_DIR="c:/subprojects" + pwd=os.getcwd() -CHECK_PATH_1= os.path.exists(f"{CHECK_DIR}/Tools") -if(CHECK_PATH_1==False): - CHECK_DIR=os.chdir(f"{CHECK_DIR}") - CHECK_PATH_1= os.path.exists(f"{CHECK_DIR}") - if(CHECK_PATH_1==False): +check_path_1= os.path.exists(f"{check_dir}/Tools") +if(check_path_1==False): + check_dir=os.chdir(f"{check_dir}") + check_path_1= os.path.exists(f"{check_dir}") + if(check_path_1==False): print("This script must be run from the project skeleton root or the tools/ directory.") exit () -DEST_DIR=args[0] -DEST_PATH_2= os.path.exists(f"{args[0]}") -if(DEST_PATH_2==False): - DEST_PATH_2= os.path.exists(f"{pwd}/{args[0]}") - if(DEST_PATH_2==False): - DEST_DIR=f"{pwd}/{args[0]}" +dest_dir=args[0] +dest_path_2= os.path.exists(f"{dest_dir}") +if(dest_path_2==False): + dest_path_2= os.path.exists(f"{pwd}/{dest_dir}") + if(dest_path_2==False): + dest_dir=f"{pwd}/{dest_dir}" else: - print(f"Destination directory {DEST_DIR} cannot be found. Does it exist?") + print(f"Destination directory {dest_dir} cannot be found. Does it exist?") exit() @@ -85,57 +88,58 @@ def help(): findCMD = f'find . -name ".DS_Store"' -out = subprocess.Popen(findCMD,shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) +out = subprocess.Popen(findCMD,shell=True,stdin=subprocess.PIPE + ,stdout=subprocess.PIPE,stderr=subprocess.PIPE) for file in os.listdir("c:"): if file.endswith(".DS_Store"): shutil.rmtree(file) -CORE_FILES="docs src test tools .clang-format .clang-tidy Makefile meson.build meson_options.txt README.md" -GIT_FILES=".gitattributes .github .gitignore" +core_files="docs src test tools .clang-format .clang-tidy Makefile meson.build meson_options.txt README.md" +git_files=".gitattributes .github .gitignore" -SUBMODULE_DIRS="build" -SUBMODULE_URLS="git@github.com:embeddedartistry/meson-buildsystem.git" +submodule_dirs="build" +submodule_urls="git@github.com:embeddedartistry/meson-buildsystem.git" # Copy skeleton files to the destination -shutil.copytree(CORE_FILES,DEST_DIR ) -path = os.path.join(DEST_DIR, f"{CHECK_DIR}") +shutil.copytree(core_files,dest_dir) +path = os.path.join(dest_dir, f"{check_dir}") os.mkdir(path) -shutil.copytree("subprojects/*.wrap",f"{DEST_DIR}/subprojects" ) -shutil.rmtree(f"{DEST_DIR}/tools/deploy_skeleton.py") -shutil.rmtree(f"{DEST_DIR}/tools/download_and_deploy.py") -if (USE_GIT == 1): - shutil.copytree(GIT_FILES,DEST_DIR) -if (USE_SUBMODULES==0): +shutil.copytree("subprojects/*.wrap",f"{dest_dir}/subprojects" ) +shutil.rmtree(f"{dest_dir}/tools/deploy_skeleton.py") +shutil.rmtree(f"{dest_dir}/tools/download_and_deploy.py") +if (use_git == 1): + shutil.copytree(git_files,dest_dir) +if (use_submodules==0): repo = git.Repo(pwd) output = repo.git.submodule('update','--init','--recursive') - shutil.copytree(SUBMODULE_DIRS,DEST_DIR) -if (COPY_LICENSE == 1): - shutil.copytree("LICENSE",DEST_DIR) + shutil.copytree(submodule_dirs,dest_dir) +if (copy_license == 1): + shutil.copytree("LICENSE",dest_dir) ## The following operations all take place in the destination directory -os.chdir(DEST_DIR) +os.chdir(dest_dir) # Initialize Submodules -if (USE_SUBMODULES==1): - repo = git.Repo(SUBMODULE_URLS) +if (use_submodules==1): + repo = git.Repo(submodule_urls) output = repo.git.submodule('add') - index=Repo.init(SUBMODULE_DIRS).index + index=Repo.init(submodule_dirs).index index.commit("Add submodules from project skeleton. ") else : - find = f'find {SUBMODULE_DIRS} -name ".git*"' + find = f'find {submodule_dirs} -name ".git*"' out = subprocess.Popen(findCMD,shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - for file in os.listdir(SUBMODULE_DIRS): + for file in os.listdir(submodule_dirs): if file.endswith(".git*"): - shutil.rmtree(SUBMODULE_DIRS) -if (USE_GIT==1): + shutil.rmtree(submodule_dirs) +if (use_git==1): repo.git.add(all=True ) - index=Repo.init(SUBMODULE_DIRS).index + index=Repo.init(submodule_dirs).index index.commit("Initial commit of project skeleton files.") -if (REPLACE_NAME !=""): - p=subprocess.Popen(f"{SED}") \ No newline at end of file +if (replace_name !=""): + p=subprocess.Popen(f"{sed}") \ No newline at end of file diff --git a/tools python/download_and_deploy.py b/tools python/download_and_deploy.py index 234fd6d..f97c9d5 100644 --- a/tools python/download_and_deploy.py +++ b/tools python/download_and_deploy.py @@ -1,20 +1,27 @@ import os import git import shutil +import platform pwd=os.getcwd() -INITIAL_DIR=pwd -os.mkdir(r"C:\tmp") -os.chdir("C:\\tmp") +initial_dir=pwd + +linux_dir="/tmp" +windows_dir="C://tmp" +if (platform.system() == "Darwin" or platform.system() == "Linux" ): + temporary_dir=linux_dir +else: + temporary_dir=windows_dir + +os.mkdir(temporary_dir) +os.chdir(temporary_dir) git.Git().clone("https://github.com/embeddedartistry/project-skeleton","project-skeleton",depth=1,recursive=True) -os.chdir(r"C:\tmp\project-skeleton") -os.chdir(r"C:\tmp\project-skeleton\tools") -#os.system("bash tools/deploy_skeleton.sh $@") +os.chdir(f"{temporary_dir}\project-skeleton\tools") exec(open('deploy_skeleton.py').read()) -os.chdir("c:") -shutil.rmtree(r"C:\tmp\project-skeleton") -os.chdir(f"{INITIAL_DIR}") +os.chdir(temporary_dir) +shutil.rmtree(f"{temporary_dir}\project-skeleton") +os.chdir(f"{initial_dir}") From 8a02a2a516cb15a7f5c740d08fb579247690f982 Mon Sep 17 00:00:00 2001 From: Phillip Johnston Date: Thu, 18 Aug 2022 12:18:31 -0700 Subject: [PATCH 09/12] Revert "Initial commit of project skeleton files." This reverts commit b8d34a1a3d8c278359f7774f79dc44b1ed536f97. --- .../project-skeleton/tools/.gitattributes | 12 ----- .../tools/.github/ISSUE_TEMPLATE.md | 32 ------------ .../tools/.github/ISSUE_TEMPLATE/FEATURE.md | 27 ---------- .../tools/.github/ISSUE_TEMPLATE/ISSUE.md | 48 ------------------ .../tools/.github/ISSUE_TEMPLATE/QUESTION.md | 15 ------ .../tools/.github/ISSUE_TEMPLATE/config.yml | 1 - .../tools/.github/PULL_REQUEST_TEMPLATE.md | 21 -------- .../.github/PULL_REQUEST_TEMPLATE/ccc.md | 49 ------------------- .../pull_request_template.md | 42 ---------------- Artistry/project-skeleton/tools/.gitignore | 46 ----------------- .../tools/subprojects/catch2.wrap | 10 ---- .../tools/subprojects/cmocka.wrap | 10 ---- .../tools/subprojects/etl.wrap | 4 -- .../tools/subprojects/libc.wrap | 4 -- .../tools/subprojects/libcpp.wrap | 4 -- .../tools/subprojects/libmemory.wrap | 4 -- 16 files changed, 329 deletions(-) delete mode 100644 Artistry/project-skeleton/tools/.gitattributes delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml delete mode 100644 Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md delete mode 100644 Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md delete mode 100644 Artistry/project-skeleton/tools/.gitignore delete mode 100644 Artistry/project-skeleton/tools/subprojects/catch2.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/cmocka.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/etl.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/libc.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/libcpp.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/libmemory.wrap diff --git a/Artistry/project-skeleton/tools/.gitattributes b/Artistry/project-skeleton/tools/.gitattributes deleted file mode 100644 index a16f581..0000000 --- a/Artistry/project-skeleton/tools/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -*.pdf filter=lfs diff=lfs merge=lfs -text -*.jpg filter=lfs diff=lfs merge=lfs -text -*.png filter=lfs diff=lfs merge=lfs -text -*.xlsx filter=lfs diff=lfs merge=lfs -text -*.docx filter=lfs diff=lfs merge=lfs -text -*.zip filter=lfs diff=lfs merge=lfs -text -*.tar filter=lfs diff=lfs merge=lfs -text -*.tgz filter=lfs diff=lfs merge=lfs -text -*.bz2 filter=lfs diff=lfs merge=lfs -text -*.out filter=lfs diff=lfs merge=lfs -text -*.hex filter=lfs diff=lfs merge=lfs -text -*.bin filter=lfs diff=lfs merge=lfs -text diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 796ad28..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,32 +0,0 @@ -# Expected Behavior - -Please describe the behavior you are expecting - -# Current Behavior - -What is the current behavior? - -# Failure Information (for bugs) - -Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. - -## Steps to Reproduce - -Please provide detailed steps for reproducing the issue. - -1. step 1 -2. step 2 -3. you get it... - -## Context - -Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. - -* Firmware Version: -* Operating System: -* SDK version: -* Toolchain version: - -## Failure Logs - -Please include any relevant log snippets or files here. diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md deleted file mode 100644 index b2465a4..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Feature Request -about: Use this template for requesting new features -title: "[FEATURE NAME]" -labels: enhancement -assignees: phillipjohnston ---- - -## Expected Behavior - -Please describe the behavior you are expecting - -## Current Behavior - -What is the current behavior? - -## Sample Code - -If applicable, provide a sample code snippet that demonstrates the gist of feature you're proposing. This can be either from a usage standpoint, or an implementation standpoint. - -## Context - -Please provide any relevant information about your setup, which will help us ensure the requested support will work for you. - -* Project Version: -* Operating System: -* Toolchain version: diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md deleted file mode 100644 index 1826256..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -name: Issue Report -about: Use this template to report a problem -title: "[VERSION] [PROBLEM SUMMARY]" -labels: bug -assignees: phillipjohnston ---- - -## Expected Behavior - -Please describe the behavior you are expecting - -## Current Behavior - -What is the current behavior? - -## Context - -Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. - -* Project Version: -* Operating System: -* Toolchain: -* Toolchain version: - -## Failure Information (for bugs) - -Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. - -### Steps to Reproduce - -Please provide detailed steps for reproducing the issue. - -1. step 1 -2. step 2 -3. you get it... - -### Failure Logs - -Please include any relevant log snippets or files here. - -## Checklist - -- [ ] I am running the latest version -- [ ] I checked the documentation and found no answer -- [ ] I checked to make sure that this issue has not already been filed -- [ ] I'm reporting the issue to the correct repository (for multi-repository projects) -- [ ] I have provided sufficient information for the team diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md deleted file mode 100644 index 3defe42..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: Question -about: Use this template to ask a question about the project -title: "[QUESTION SUMMARY]" -labels: question -assignees: phillipjohnston ---- - -## Question - -State your question - -## Sample Code - -Please include relevant code snippets or files that provide context for your question. diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 3ba13e0..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1 +0,0 @@ -blank_issues_enabled: false diff --git a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 9098e60..0000000 --- a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,21 +0,0 @@ -# Description - -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - -Fixes # (issue) - -# How Has This Been Tested? - -Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration. - -- [ ] Test A -- [ ] Test B - -# Checklist: - -- [ ] My code follows the style guidelines of this project -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings -- [ ] Any dependent changes have been merged and published in downstream modules diff --git a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md deleted file mode 100644 index 6587d3f..0000000 --- a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md +++ /dev/null @@ -1,49 +0,0 @@ -# Pull Request Template - Code Change Control - -## Description - -Please include a summary of the change and which issue is fixed. Please provide the motivation for why this change is necessary at this stage of the product development cycle. - -Fixes # (issue) - -## Customer Impact - -Please describe any customer facing impact of this change. This can be positive or negative impact. - -## Performance Impact - -Please describe any relevant performance impact of this change. This can be positive or negative impact. How did you characterize/test the performance impact? - -## How Has This Been Tested? - -Please describe the tests that you ran to verify your changes. Provide instructions so others can reproduce. Please also list any relevant details for your test configuration. - -- [ ] Test A -- [ ] Test B - -**Hardware Configuration(s) Tested**: - -**Software Configuration(s) Tested**: - -* Operating System: -* Software version: -* Branch: -* Toolchain version: -* SDK version: - -## Reviews - -Please identify two developers to review this change - -- [ ] @personA -- [ ] @personB - -## Checklist: - -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings -- [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] New and existing unit tests pass locally with my changes -- [ ] Any dependent changes have been merged and published in downstream modules diff --git a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index 62988b9..0000000 --- a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,42 +0,0 @@ -# Pull Request Template - -## Description - -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - -Fixes # (issue) - -## Type of change - -Please delete options that are not relevant. - -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] This change requires a documentation update - -## How Has This Been Tested? - -Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - -- [ ] Test A -- [ ] Test B - -**Test Configuration(s)**: - -* Firmware version: -* Hardware: -* Toolchain: -* SDK: - -## Checklist: - -- [ ] My code follows the style guidelines of this project -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings -- [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] New and existing unit tests pass locally with my changes -- [ ] Any dependent changes have been merged and published in downstream modules -- [ ] I have checked my code and corrected any misspellings diff --git a/Artistry/project-skeleton/tools/.gitignore b/Artistry/project-skeleton/tools/.gitignore deleted file mode 100644 index 488d4ac..0000000 --- a/Artistry/project-skeleton/tools/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# Generated Files -**/buildresults/** - -# Sublime-generated Files -*.sublime-workspace - -# Meson subprojects -**/subprojects/** -!**/subprojects/*.wrap - -######################## -# C / C++ Ignore Rules # -######################## - -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app diff --git a/Artistry/project-skeleton/tools/subprojects/catch2.wrap b/Artistry/project-skeleton/tools/subprojects/catch2.wrap deleted file mode 100644 index 2e20085..0000000 --- a/Artistry/project-skeleton/tools/subprojects/catch2.wrap +++ /dev/null @@ -1,10 +0,0 @@ -[wrap-file] -directory = Catch2-2.11.3 - -source_url = https://github.com/catchorg/Catch2/archive/v2.11.3.zip -source_filename = Catch2-2.11.3.zip -source_hash = c5a0a7510379c6f37f70b329986a335a7b8489d67ac417ce8f4262d0cae4cc5d - -patch_url = https://wrapdb.mesonbuild.com/v1/projects/catch2/2.11.3/1/get_zip -patch_filename = catch2-2.11.3-1-wrap.zip -patch_hash = 63c09cb68280435040ad304b3dd87ecfe69dbc216608991d0a82569a63119e57 diff --git a/Artistry/project-skeleton/tools/subprojects/cmocka.wrap b/Artistry/project-skeleton/tools/subprojects/cmocka.wrap deleted file mode 100644 index 21e84f9..0000000 --- a/Artistry/project-skeleton/tools/subprojects/cmocka.wrap +++ /dev/null @@ -1,10 +0,0 @@ -[wrap-file] -directory = cmocka-1.1.5 - -source_url = https://cmocka.org/files/1.1/cmocka-1.1.5.tar.xz -source_filename = cmocka-1.1.5.tar.xz -source_hash = f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6 - -patch_url = https://wrapdb.mesonbuild.com/v1/projects/cmocka/1.1.5/3/get_zip -patch_filename = cmocka-1.1.5-3-wrap.zip -patch_hash = 81ce48613680d3c3a0b396ac570c852b290adcd18202fb16aaf703a9493f4348 diff --git a/Artistry/project-skeleton/tools/subprojects/etl.wrap b/Artistry/project-skeleton/tools/subprojects/etl.wrap deleted file mode 100644 index 62ce760..0000000 --- a/Artistry/project-skeleton/tools/subprojects/etl.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -url = git@github.com:ETLCPP/etl.git -revision = master -clone-recursive = true diff --git a/Artistry/project-skeleton/tools/subprojects/libc.wrap b/Artistry/project-skeleton/tools/subprojects/libc.wrap deleted file mode 100644 index 658c0ed..0000000 --- a/Artistry/project-skeleton/tools/subprojects/libc.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -url = git@github.com:embeddedartistry/libc.git -revision = master -clone-recursive = true diff --git a/Artistry/project-skeleton/tools/subprojects/libcpp.wrap b/Artistry/project-skeleton/tools/subprojects/libcpp.wrap deleted file mode 100644 index c56285f..0000000 --- a/Artistry/project-skeleton/tools/subprojects/libcpp.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -url = git@github.com:embeddedartistry/libcpp.git -revision = master -clone-recursive = true diff --git a/Artistry/project-skeleton/tools/subprojects/libmemory.wrap b/Artistry/project-skeleton/tools/subprojects/libmemory.wrap deleted file mode 100644 index 006b657..0000000 --- a/Artistry/project-skeleton/tools/subprojects/libmemory.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -url = git@github.com:embeddedartistry/libmemory.git -revision = master -clone-recursive = true From 0996f8cc3967a98bdce31501b329b71634567b30 Mon Sep 17 00:00:00 2001 From: Adham Date: Sun, 21 Aug 2022 17:14:35 +0100 Subject: [PATCH 10/12] updates... --- tools python/deploy_skeleton.py | 43 +++++- tools python/download_and_deploy.py | 28 ++-- .../download_and_deploy_config_files.py | 35 +++-- tools python/install_deps.py | 58 +++++---- tools python/setup_env.py | 122 +++++++++++------- 5 files changed, 191 insertions(+), 95 deletions(-) diff --git a/tools python/deploy_skeleton.py b/tools python/deploy_skeleton.py index 158bf7d..a455c42 100644 --- a/tools python/deploy_skeleton.py +++ b/tools python/deploy_skeleton.py @@ -4,9 +4,11 @@ import subprocess import platform import shutil -from turtle import update +from turtle import clone, update import git from git import Repo +import adr_func + use_adr=0 @@ -131,15 +133,50 @@ def help(): index=Repo.init(submodule_dirs).index index.commit("Add submodules from project skeleton. ") else : - find = f'find {submodule_dirs} -name ".git*"' + findCMD = f'find {submodule_dirs} -name ".git*"' out = subprocess.Popen(findCMD,shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) for file in os.listdir(submodule_dirs): if file.endswith(".git*"): shutil.rmtree(submodule_dirs) if (use_git==1): repo.git.add(all=True ) + index=Repo.init(submodule_dirs).index index.commit("Initial commit of project skeleton files.") if (replace_name !=""): - p=subprocess.Popen(f"{sed}") \ No newline at end of file + subprocess.Popen(f"{sed} ",f's/PROJECT_NAME/{replace_name}/g "meson.build"') + replace_name=f"{replace_name}// /_" + subprocess.Popen(f"{sed} ",f's/PROJECT_NAME/{replace_name}/g "src/app/meson.build"') + subprocess.Popen(f"{sed} ",f's/PROJECT_NAME/{replace_name}/g "test/meson.build"') + + if(use_git==1): + index=Repo.init(submodule_dirs).index + index.commit(f"Replace placeholder values in build files with {replace_name} ") + +if(use_adr==1): + adr_func.adr_init('/docs') + if use_git==1: + repo.git.add(all=True ) + index=Repo.init(submodule_dirs).index + index.commit("Initiaize adr-tools") + +if(use_git==1): + try: + repo.git.pull("adham") + repo.git.push("adham") + except: + print("WARNING: git push failed: check repository.") + +if(replace_name ==""): + print("NOTE: Replace the placeholder project name in meson.build") + print("NOTE: Replace the placeholder application name in src/app/meson.build") + print("NOTE: Replace the placeholder test application name in test/meson.build") + +variable_1=os.path.isfile(f"{dest_dir}/LICENSE") +variable_2=os.path.isfile(f"{dest_dir}/LICENSE.md") + +if ( (copy_license==0 and variable_1==False) or variable_2==False): + print("NOTE: Your project does not have a LICENSE or LICENSE.md file in the project root.") + + diff --git a/tools python/download_and_deploy.py b/tools python/download_and_deploy.py index f97c9d5..fdf5120 100644 --- a/tools python/download_and_deploy.py +++ b/tools python/download_and_deploy.py @@ -7,21 +7,29 @@ pwd=os.getcwd() initial_dir=pwd -linux_dir="/tmp" +linux_dir="\tmp" windows_dir="C://tmp" if (platform.system() == "Darwin" or platform.system() == "Linux" ): temporary_dir=linux_dir + os.mkdir(temporary_dir) + os.chdir(temporary_dir) + git.Git().clone("https://github.com/embeddedartistry/project-skeleton","project-skeleton",depth=1,recursive=True) + os.chdir(f"{temporary_dir}\project-skeleton\tools") + exec(open('deploy_skeleton.py').read()) + os.chdir(temporary_dir) + shutil.rmtree(f"{temporary_dir}\project-skeleton") + os.chdir(f"{initial_dir}") + else: temporary_dir=windows_dir - -os.mkdir(temporary_dir) -os.chdir(temporary_dir) -git.Git().clone("https://github.com/embeddedartistry/project-skeleton","project-skeleton",depth=1,recursive=True) -os.chdir(f"{temporary_dir}\project-skeleton\tools") -exec(open('deploy_skeleton.py').read()) -os.chdir(temporary_dir) -shutil.rmtree(f"{temporary_dir}\project-skeleton") -os.chdir(f"{initial_dir}") + os.mkdir(temporary_dir) + os.chdir(temporary_dir) + git.Git().clone("https://github.com/embeddedartistry/project-skeleton","project-skeleton",depth=1,recursive=True) + os.chdir(f"{temporary_dir}/project-skeleton/tools") + exec(open('deploy_skeleton.py').read()) + os.chdir(temporary_dir) + shutil.rmtree(f"{temporary_dir}/project-skeleton") + os.chdir(f"{initial_dir}") diff --git a/tools python/download_and_deploy_config_files.py b/tools python/download_and_deploy_config_files.py index 34d4e21..135e314 100644 --- a/tools python/download_and_deploy_config_files.py +++ b/tools python/download_and_deploy_config_files.py @@ -1,19 +1,34 @@ import os import git import shutil +import platform pwd=os.getcwd() -INITIAL_DIR=pwd -os.mkdir(r"C:\tmp") -os.chdir("C:\\tmp") +initial_dir=pwd +linux_dir="\tmp" +windows_dir="C://tmp" +if (platform.system() == "Darwin" or platform.system() == "Linux" ): -git.Git().clone("https://github.com/embeddedartistry/config-files","config-files",depth=1) -os.chdir("C:\\tmp\\config-files") -exec(open('copy_config.sh').read()) -os.listdir() -os.chdir("C:\\tmp") -shutil.rmtree(r"C:\tmp\config-files") -os.chdir(f"{INITIAL_DIR}") + temporary_dir=linux_dir + os.mkdir(temporary_dir) + os.chdir(temporary_dir) + git.Git().clone("https://github.com/embeddedartistry/config-files","config-files",depth=1) + os.chdir(f"{temporary_dir}\config-files") + exec(open('copy_config.sh').read()) + os.chdir(temporary_dir) + shutil.rmtree(f"{temporary_dir}\config-files") + os.chdir(f"{initial_dir}") + +else : + temporary_dir=windows_dir + os.mkdir(temporary_dir) + os.chdir(temporary_dir) + git.Git().clone("https://github.com/embeddedartistry/config-files","config-files",depth=1) + os.chdir(f"{temporary_dir}//config-files") + exec(open('copy_config.sh').read()) + os.chdir(temporary_dir) + shutil.rmtree(f"{temporary_dir}//config-files") + os.chdir(f"{initial_dir}") diff --git a/tools python/install_deps.py b/tools python/install_deps.py index 6f9525c..56a1ceb 100644 --- a/tools python/install_deps.py +++ b/tools python/install_deps.py @@ -1,50 +1,51 @@ import os import sys import getopt +import platform pwd=os.getcwd() -STARTING_DIR=pwd -TOOLCHAIN_INSTALL_DIR="/usr/local/toolchains" -TOOL_INSTALL_DIR="/usr/local/tools" -TOOLCHAIN_DISABLE_SUDO=0 -TOOL_DISABLE_SUDO=0 +starting_dir=pwd +toolchain_install_dir="/usr/local/toolchains" +tool_install_dir="/usr/local/tools" +toolchain_disable_sudo=0 +tool_disable_sudo=0 #commands : -UPDATE=0 -UPDATE_ENV=0 -PIP_UPDATE=None -BREW_COMMAND="install" -APT_COMMAND="install" -TOOLS_SUDO="Sudo" +update=0 +update_env=0 +pip_update=None +brew_command="install" +apt_command="install" +tools_sudo="Sudo" -BREW_PACKAGE=["python3" ,"ninja" ,"wget" ,"gcc@7" ,"gcc@8" ,"gcc@9" ,"llvm" ,"adr-tools" ,"cmocka" ,"pkg-config"] -BREW_PACKAGE.append["vale","doxygen","cppcheck","clang-format","gcovr","lcov","sloccount"] -APT_PACKAGES=["python3" ,"python3-pip", "ninja-build", "wget" ,"build-essential", "clang" ,"lld" ,"llvm"] -APT_PACKAGES.append=["clang-tools", "libcmocka0" ,"libcmocka-dev" ,"pkg-config" ,"sloccount" ,"curl"] -APT_PACKAGES.append=["doxygen", "cppcheck", "gcovr" ,"lcov" ,"clang-format" ,"clang-tidy", "clang-tools"] -APT_PACKAGES.append=["gcc-7" ,"g++-7", "gcc-8" ,"g++-8", "gcc-9" ,"g++-9"] -PIP3_PACKAGES=["meson" ,"lizard" ,"thefuck"] +brew_package=["python3" ,"ninja" ,"wget" ,"gcc@7" ,"gcc@8" ,"gcc@9" ,"llvm" ,"adr-tools" ,"cmocka" ,"pkg-config"] +brew_package.append["vale","doxygen","cppcheck","clang-format","gcovr","lcov","sloccount"] +apt_package=["python3" ,"python3-pip", "ninja-build", "wget" ,"build-essential", "clang" ,"lld" ,"llvm"] +apt_package.append=["clang-tools", "libcmocka0" ,"libcmocka-dev" ,"pkg-config" ,"sloccount" ,"curl"] +apt_package.append=["doxygen", "cppcheck", "gcovr" ,"lcov" ,"clang-format" ,"clang-tidy", "clang-tools"] +apt_package.append=["gcc-7" ,"g++-7", "gcc-8" ,"g++-8", "gcc-9" ,"g++-9"] +pip3_package=["meson" ,"lizard" ,"thefuck"] try : opts, args = getopt.getopt(sys.argv[1:], "euhdst") except: print("Error in the getopts function") for o , a in opts : if o=="-d": - TOOLCHAIN_INSTALL_DIR=input("TOOLCHAIN_INSTALL_DIR : ") + toolchain_install_dir=input("TOOLCHAIN_INSTALL_DIR : ") elif o == "-s": - TOOL_INSTALL_DIR=input("TOOL_INSTALL_DIR :") + tool_install_dir=input("TOOL_INSTALL_DIR :") elif o =="-r": - TOOLCHAIN_DISABLE_SUDO=input("TOOLCHAIN_DISABLE_SUDO :") + toolchain_disable_sudo=input("TOOLCHAIN_DISABLE_SUDO :") elif o =="-z": TOOL_DISABLE_SUDO=input("TOOL_DISABLE_SUDO :") elif o == "-e": - UPDATE_ENV=1 + update_env=1 elif o == "-u": - UPDATE=1 - PIP_UPDATE="--upgrade" - BREW_COMMAND="upgrade" - APT_COMMAND="upgrade" + update=1 + pip_update="--upgrade" + brew_command="upgrade" + apt_command="upgrade" elif o =="-h": print("Usage: install_deps.sh [optional ags]") @@ -57,11 +58,12 @@ print(f"Invalid option {args[0]}") -if (platform.release() == "Darwin"): - if(UPDATE==1): +if (platform.system() == "Darwin"): + if(update==1): os.system("brew update") else: + diff --git a/tools python/setup_env.py b/tools python/setup_env.py index 1287be7..9a7e9bd 100644 --- a/tools python/setup_env.py +++ b/tools python/setup_env.py @@ -1,5 +1,4 @@ import getopt -from posixpath import basename import sys import platform import os @@ -10,10 +9,19 @@ TOOLCHAIN_INSTALL_DIR="/usr/local/toolchains" TOOL_INSTALL_DIR="/usr/local/tools" +def helpfunction(): + print("Usage: setup_env.py [optional ags] dest_dir ") + print("Optional args:") + print("-a: initialize the toolchain install directory") + print(" -p: initialize TOOL install directory ") + print("-r: give the path ") + print("-s: initialize home directory") + exit() try : opts, args = getopt.getopt(sys.argv[1:], "aprs:") except: - print("Error in the getopts function") + print("An Error has occured !") + helpfunction() for o , a in opts: if o == "-a" : TOOLCHAIN_INSTALL_DIR = input("TOOLCHAIN_INSTALL_DIR :") @@ -24,56 +32,82 @@ elif o == "-s": HOME=input("Give Home Directory :") else : - print("erreur + help function ") - + print("An Error has occured ! ") + helpfunction() + + + DEPLOY_URL="https://gist.githubusercontent.com/phillipjohnston/bb95f19d156007f99be4c10c1efdf694/raw/f2f141e31fca0a12eb391e8251efe2ce1f9e68bd/download_and_deploy.sh" -if(platform.release()=="Darwin"): - os.system(f"cat {HOME}/.bash_profile") - if (os.path.isfile("c:/.bash_profile")==True): - exec(open('c:/.bash_profile').read()) +if(platform.system()=="Darwin"): + file=open('.bash_profile','a') + file.write("if [ -f \$HOME/.bashrc ]; then") + file.write(" source \$HOME/.bashrc") + file.write("fi") + file.close() PATHMOD=f"{TOOLCHAIN_INSTALL_DIR}/gcc-arm-none-eabi/bin:{TOOL_INSTALL_DIR}/pottery/src" -if (platform.release()=="Darwin"): +if (platform.system()=="Darwin"): PATHMOD=f"{PATHMOD}:/usr/local/opt/llvm/bin" else: PATHMOD=f"{PATHMOD}:{TOOL_INSTALL_DIR}:adr-tools/src" -os.system(f"cat {HOME}/.bashrc") - - -################ -# Path Updates # -################ -PATH= f"{PATHMOD}:\{PATH}" -os.system(f"export PATH={PATH}") -if(os.path.isdir(f"{HOME}/bin")==True): - PATH=f"\{HOME}/bin:\{PATH}" - -os.system(f"cat {HOME}/.bashrc") - -######################### -# Aliases and Functions # -######################### -pwd=os.getcwd() - -def deploy_skeleton(): - INITIAL_DIR=f"\{pwd}" - os.chdir("c/tmp") - wget.download(DEPLOY_URL,'c:\\tmp') - exec(open('download_and_deploy.py').read()) - shutil.rmtree(r"C:\tmp") - os.chdir(pwd) -os.system("alias init_skeleton='deploy_skeleton -a -p `pwd`'") - -def init_repo(): - URL=args[0] - git.Git().clone(f"{URL}","URL") - A=URL.rsplit('/', 1).pop() - os.chdir(f"{A}.git") - os.system("deploy_skeleton -a -p \${@} `pwd`") - -# Skeleton Update Aliases + +file2=open(".bashrc","a") +file2.write("################") +file2.write("# Path Updates #") +file2.write("################") +file2.write("export PATH=${PATHMOD}:\$PATH") +file2.write("# set PATH so it includes user's private bin if it exists") +file2.write("if [ -d \$HOME/bin ] ; then") +file2.write(" PATH=\$HOME/bin:\$PATH") +file2.write("fi") +file2.write("") +file2.write("#########################") +file2.write("# Aliases and Functions #") +file2.write("#########################") +file2.write("function deploy_skeleton()") +file2.write("{") +file2.write(" INITIAL_DIR=\$(pwd)") +file2.write(" cd /tmp") +file2.write(" wget $DEPLOY_URL") +file2.write(" bash download_and_deploy.sh \$@") +file2.write(" rm download_and_deploy.sh") +file2.write(" cd \$INITIAL_DIR") +file2.write("}") +file2.write("alias init_skeleton='deploy_skeleton -a -p `pwd`'") +file2.write("function init_repo()") +file2.write("{") +file2.write(" URL=\$1") +file2.write(" shift") +file2.write(" git clone \$URL") +file2.write('" cd \$(basename "\$URL" .git)"') +file2.write(" deploy_skeleton -a -p \${@} `pwd`") +file2.write(" deploy_skeleton -a -p \${@} `pwd`") +file2.write("}") +file2.write("") +file2.write('alias sm_update_build="cd build; git checkout master; git pull; cd ../"') +file2.write('alias sm_update_commit_build="sm_update_build; git add build; git commit -m 'Update build submodule to use the latest changes.'"') + + + + + + + + + + + + + + + + + + + + From 8f8339464635e2c892940851ccafa9c856ca9f5d Mon Sep 17 00:00:00 2001 From: Adham Date: Mon, 22 Aug 2022 02:28:46 +0100 Subject: [PATCH 11/12] updates ... --- .../project-skeleton/tools/.gitattributes | 12 ----- .../tools/.github/ISSUE_TEMPLATE.md | 32 ------------ .../tools/.github/ISSUE_TEMPLATE/FEATURE.md | 27 ---------- .../tools/.github/ISSUE_TEMPLATE/ISSUE.md | 48 ------------------ .../tools/.github/ISSUE_TEMPLATE/QUESTION.md | 15 ------ .../tools/.github/ISSUE_TEMPLATE/config.yml | 1 - .../tools/.github/PULL_REQUEST_TEMPLATE.md | 21 -------- .../.github/PULL_REQUEST_TEMPLATE/ccc.md | 49 ------------------- .../pull_request_template.md | 42 ---------------- Artistry/project-skeleton/tools/.gitignore | 46 ----------------- .../tools/subprojects/catch2.wrap | 10 ---- .../tools/subprojects/cmocka.wrap | 10 ---- .../tools/subprojects/etl.wrap | 4 -- .../tools/subprojects/libc.wrap | 4 -- .../tools/subprojects/libcpp.wrap | 4 -- .../tools/subprojects/libmemory.wrap | 4 -- tools python/install_deps.py | 20 +++++++- tools python/setup_env.py | 2 +- 18 files changed, 20 insertions(+), 331 deletions(-) delete mode 100644 Artistry/project-skeleton/tools/.gitattributes delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md delete mode 100644 Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml delete mode 100644 Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md delete mode 100644 Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md delete mode 100644 Artistry/project-skeleton/tools/.gitignore delete mode 100644 Artistry/project-skeleton/tools/subprojects/catch2.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/cmocka.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/etl.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/libc.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/libcpp.wrap delete mode 100644 Artistry/project-skeleton/tools/subprojects/libmemory.wrap diff --git a/Artistry/project-skeleton/tools/.gitattributes b/Artistry/project-skeleton/tools/.gitattributes deleted file mode 100644 index a16f581..0000000 --- a/Artistry/project-skeleton/tools/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -*.pdf filter=lfs diff=lfs merge=lfs -text -*.jpg filter=lfs diff=lfs merge=lfs -text -*.png filter=lfs diff=lfs merge=lfs -text -*.xlsx filter=lfs diff=lfs merge=lfs -text -*.docx filter=lfs diff=lfs merge=lfs -text -*.zip filter=lfs diff=lfs merge=lfs -text -*.tar filter=lfs diff=lfs merge=lfs -text -*.tgz filter=lfs diff=lfs merge=lfs -text -*.bz2 filter=lfs diff=lfs merge=lfs -text -*.out filter=lfs diff=lfs merge=lfs -text -*.hex filter=lfs diff=lfs merge=lfs -text -*.bin filter=lfs diff=lfs merge=lfs -text diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 796ad28..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,32 +0,0 @@ -# Expected Behavior - -Please describe the behavior you are expecting - -# Current Behavior - -What is the current behavior? - -# Failure Information (for bugs) - -Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. - -## Steps to Reproduce - -Please provide detailed steps for reproducing the issue. - -1. step 1 -2. step 2 -3. you get it... - -## Context - -Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. - -* Firmware Version: -* Operating System: -* SDK version: -* Toolchain version: - -## Failure Logs - -Please include any relevant log snippets or files here. diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md deleted file mode 100644 index b2465a4..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/FEATURE.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Feature Request -about: Use this template for requesting new features -title: "[FEATURE NAME]" -labels: enhancement -assignees: phillipjohnston ---- - -## Expected Behavior - -Please describe the behavior you are expecting - -## Current Behavior - -What is the current behavior? - -## Sample Code - -If applicable, provide a sample code snippet that demonstrates the gist of feature you're proposing. This can be either from a usage standpoint, or an implementation standpoint. - -## Context - -Please provide any relevant information about your setup, which will help us ensure the requested support will work for you. - -* Project Version: -* Operating System: -* Toolchain version: diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md deleted file mode 100644 index 1826256..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/ISSUE.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -name: Issue Report -about: Use this template to report a problem -title: "[VERSION] [PROBLEM SUMMARY]" -labels: bug -assignees: phillipjohnston ---- - -## Expected Behavior - -Please describe the behavior you are expecting - -## Current Behavior - -What is the current behavior? - -## Context - -Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. - -* Project Version: -* Operating System: -* Toolchain: -* Toolchain version: - -## Failure Information (for bugs) - -Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. - -### Steps to Reproduce - -Please provide detailed steps for reproducing the issue. - -1. step 1 -2. step 2 -3. you get it... - -### Failure Logs - -Please include any relevant log snippets or files here. - -## Checklist - -- [ ] I am running the latest version -- [ ] I checked the documentation and found no answer -- [ ] I checked to make sure that this issue has not already been filed -- [ ] I'm reporting the issue to the correct repository (for multi-repository projects) -- [ ] I have provided sufficient information for the team diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md deleted file mode 100644 index 3defe42..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/QUESTION.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: Question -about: Use this template to ask a question about the project -title: "[QUESTION SUMMARY]" -labels: question -assignees: phillipjohnston ---- - -## Question - -State your question - -## Sample Code - -Please include relevant code snippets or files that provide context for your question. diff --git a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml b/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 3ba13e0..0000000 --- a/Artistry/project-skeleton/tools/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1 +0,0 @@ -blank_issues_enabled: false diff --git a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 9098e60..0000000 --- a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,21 +0,0 @@ -# Description - -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - -Fixes # (issue) - -# How Has This Been Tested? - -Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration. - -- [ ] Test A -- [ ] Test B - -# Checklist: - -- [ ] My code follows the style guidelines of this project -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings -- [ ] Any dependent changes have been merged and published in downstream modules diff --git a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md deleted file mode 100644 index 6587d3f..0000000 --- a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/ccc.md +++ /dev/null @@ -1,49 +0,0 @@ -# Pull Request Template - Code Change Control - -## Description - -Please include a summary of the change and which issue is fixed. Please provide the motivation for why this change is necessary at this stage of the product development cycle. - -Fixes # (issue) - -## Customer Impact - -Please describe any customer facing impact of this change. This can be positive or negative impact. - -## Performance Impact - -Please describe any relevant performance impact of this change. This can be positive or negative impact. How did you characterize/test the performance impact? - -## How Has This Been Tested? - -Please describe the tests that you ran to verify your changes. Provide instructions so others can reproduce. Please also list any relevant details for your test configuration. - -- [ ] Test A -- [ ] Test B - -**Hardware Configuration(s) Tested**: - -**Software Configuration(s) Tested**: - -* Operating System: -* Software version: -* Branch: -* Toolchain version: -* SDK version: - -## Reviews - -Please identify two developers to review this change - -- [ ] @personA -- [ ] @personB - -## Checklist: - -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings -- [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] New and existing unit tests pass locally with my changes -- [ ] Any dependent changes have been merged and published in downstream modules diff --git a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index 62988b9..0000000 --- a/Artistry/project-skeleton/tools/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,42 +0,0 @@ -# Pull Request Template - -## Description - -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - -Fixes # (issue) - -## Type of change - -Please delete options that are not relevant. - -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] This change requires a documentation update - -## How Has This Been Tested? - -Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - -- [ ] Test A -- [ ] Test B - -**Test Configuration(s)**: - -* Firmware version: -* Hardware: -* Toolchain: -* SDK: - -## Checklist: - -- [ ] My code follows the style guidelines of this project -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings -- [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] New and existing unit tests pass locally with my changes -- [ ] Any dependent changes have been merged and published in downstream modules -- [ ] I have checked my code and corrected any misspellings diff --git a/Artistry/project-skeleton/tools/.gitignore b/Artistry/project-skeleton/tools/.gitignore deleted file mode 100644 index 488d4ac..0000000 --- a/Artistry/project-skeleton/tools/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# Generated Files -**/buildresults/** - -# Sublime-generated Files -*.sublime-workspace - -# Meson subprojects -**/subprojects/** -!**/subprojects/*.wrap - -######################## -# C / C++ Ignore Rules # -######################## - -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app diff --git a/Artistry/project-skeleton/tools/subprojects/catch2.wrap b/Artistry/project-skeleton/tools/subprojects/catch2.wrap deleted file mode 100644 index 2e20085..0000000 --- a/Artistry/project-skeleton/tools/subprojects/catch2.wrap +++ /dev/null @@ -1,10 +0,0 @@ -[wrap-file] -directory = Catch2-2.11.3 - -source_url = https://github.com/catchorg/Catch2/archive/v2.11.3.zip -source_filename = Catch2-2.11.3.zip -source_hash = c5a0a7510379c6f37f70b329986a335a7b8489d67ac417ce8f4262d0cae4cc5d - -patch_url = https://wrapdb.mesonbuild.com/v1/projects/catch2/2.11.3/1/get_zip -patch_filename = catch2-2.11.3-1-wrap.zip -patch_hash = 63c09cb68280435040ad304b3dd87ecfe69dbc216608991d0a82569a63119e57 diff --git a/Artistry/project-skeleton/tools/subprojects/cmocka.wrap b/Artistry/project-skeleton/tools/subprojects/cmocka.wrap deleted file mode 100644 index 21e84f9..0000000 --- a/Artistry/project-skeleton/tools/subprojects/cmocka.wrap +++ /dev/null @@ -1,10 +0,0 @@ -[wrap-file] -directory = cmocka-1.1.5 - -source_url = https://cmocka.org/files/1.1/cmocka-1.1.5.tar.xz -source_filename = cmocka-1.1.5.tar.xz -source_hash = f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6 - -patch_url = https://wrapdb.mesonbuild.com/v1/projects/cmocka/1.1.5/3/get_zip -patch_filename = cmocka-1.1.5-3-wrap.zip -patch_hash = 81ce48613680d3c3a0b396ac570c852b290adcd18202fb16aaf703a9493f4348 diff --git a/Artistry/project-skeleton/tools/subprojects/etl.wrap b/Artistry/project-skeleton/tools/subprojects/etl.wrap deleted file mode 100644 index 62ce760..0000000 --- a/Artistry/project-skeleton/tools/subprojects/etl.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -url = git@github.com:ETLCPP/etl.git -revision = master -clone-recursive = true diff --git a/Artistry/project-skeleton/tools/subprojects/libc.wrap b/Artistry/project-skeleton/tools/subprojects/libc.wrap deleted file mode 100644 index 658c0ed..0000000 --- a/Artistry/project-skeleton/tools/subprojects/libc.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -url = git@github.com:embeddedartistry/libc.git -revision = master -clone-recursive = true diff --git a/Artistry/project-skeleton/tools/subprojects/libcpp.wrap b/Artistry/project-skeleton/tools/subprojects/libcpp.wrap deleted file mode 100644 index c56285f..0000000 --- a/Artistry/project-skeleton/tools/subprojects/libcpp.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -url = git@github.com:embeddedartistry/libcpp.git -revision = master -clone-recursive = true diff --git a/Artistry/project-skeleton/tools/subprojects/libmemory.wrap b/Artistry/project-skeleton/tools/subprojects/libmemory.wrap deleted file mode 100644 index 006b657..0000000 --- a/Artistry/project-skeleton/tools/subprojects/libmemory.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -url = git@github.com:embeddedartistry/libmemory.git -revision = master -clone-recursive = true diff --git a/tools python/install_deps.py b/tools python/install_deps.py index 56a1ceb..96eeb6a 100644 --- a/tools python/install_deps.py +++ b/tools python/install_deps.py @@ -2,6 +2,9 @@ import sys import getopt import platform +import subprocess +import requests + pwd=os.getcwd() starting_dir=pwd @@ -60,8 +63,23 @@ if (platform.system() == "Darwin"): if(update==1): - os.system("brew update") + os.system("brew update") else: + print("installing the Homebrew ...") + r = requests.get('https://raw.githubusercontent.com/Homebrew/install/master/install.sh') + r.status_code + os.system("brew tap homebrew/cask-versions") + + subprocess.Popen(['brew',brew_command,brew_package],shell=True) + subprocess.Popen(['pip3','install',pip3_package,pip_update],shell=True) +else: + os.system("sudo apt-get update ") + + + + + + diff --git a/tools python/setup_env.py b/tools python/setup_env.py index 9a7e9bd..95ddb1f 100644 --- a/tools python/setup_env.py +++ b/tools python/setup_env.py @@ -87,7 +87,7 @@ def helpfunction(): file2.write("}") file2.write("") file2.write('alias sm_update_build="cd build; git checkout master; git pull; cd ../"') -file2.write('alias sm_update_commit_build="sm_update_build; git add build; git commit -m 'Update build submodule to use the latest changes.'"') +file2.write('alias sm_update_commit_build="sm_update_build; git add build; git commit -m "Update build submodule to use the latest changes."') From 300dd92871228510c9d7a1a4069215dda381d44c Mon Sep 17 00:00:00 2001 From: Adham Date: Tue, 23 Aug 2022 03:26:21 +0100 Subject: [PATCH 12/12] updates... --- .../download_and_deploy_config_files.py | 8 ++-- tools python/install_deps.py | 43 +++++++++++++++++-- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/tools python/download_and_deploy_config_files.py b/tools python/download_and_deploy_config_files.py index 135e314..1b57a95 100644 --- a/tools python/download_and_deploy_config_files.py +++ b/tools python/download_and_deploy_config_files.py @@ -5,8 +5,8 @@ pwd=os.getcwd() initial_dir=pwd -linux_dir="\tmp" -windows_dir="C://tmp" +linux_dir="/tmp" +windows_dir="C:\\tmp" if (platform.system() == "Darwin" or platform.system() == "Linux" ): temporary_dir=linux_dir @@ -24,10 +24,10 @@ os.mkdir(temporary_dir) os.chdir(temporary_dir) git.Git().clone("https://github.com/embeddedartistry/config-files","config-files",depth=1) - os.chdir(f"{temporary_dir}//config-files") + os.chdir(f"{temporary_dir}\\config-files") exec(open('copy_config.sh').read()) os.chdir(temporary_dir) - shutil.rmtree(f"{temporary_dir}//config-files") + shutil.rmtree(f"{temporary_dir}\\config-files") os.chdir(f"{initial_dir}") diff --git a/tools python/install_deps.py b/tools python/install_deps.py index 96eeb6a..0ca5025 100644 --- a/tools python/install_deps.py +++ b/tools python/install_deps.py @@ -1,10 +1,14 @@ -import os + +import os +from reprlib import recursive_repr import sys import getopt import platform import subprocess import requests - +import wget +import shutil +import git pwd=os.getcwd() starting_dir=pwd @@ -41,7 +45,7 @@ elif o =="-r": toolchain_disable_sudo=input("TOOLCHAIN_DISABLE_SUDO :") elif o =="-z": - TOOL_DISABLE_SUDO=input("TOOL_DISABLE_SUDO :") + tool_disable_sudo=input("TOOL_DISABLE_SUDO :") elif o == "-e": update_env=1 elif o == "-u": @@ -73,7 +77,38 @@ subprocess.Popen(['brew',brew_command,brew_package],shell=True) subprocess.Popen(['pip3','install',pip3_package,pip_update],shell=True) else: - os.system("sudo apt-get update ") + os.system(f"{tools_sudo} apt-get update ") + subprocess.Popen([tools_sudo, "apt",apt_command,"-y",apt_package],shell=True) + subprocess.Popen([tools_sudo,"-H","pip3","install",pip3_package,pip_update]) + + # Install Vale : + + if(platform.system()=="Darwnin" or platform.system()=="Linux" ): + os.chdir("/tmp") + wget.download("https://install.goreleaser.com/github.com/ValeLint/vale.sh",'\tmp') + subprocess.Popen([tools_sudo,"sh","vale.sh","-b","/usr/local/bin"]) + os.remove("vale.sh") + if(update==1): + os.chdir(f"{tool_install_dir}/adr-tools") + repo=git.Repo("/tmp") + repo.git.pull("adham") + else : + os.mkdir(tool_install_dir) + os.chdir(tool_disable_sudo) + git.Git().clone(" https://github.com/npryce/pottery.git",recursive_repr=True) + +############################# +# Install Environment Files # +############################# + +if(update==0): + if(update_env==1): + os.chdir(starting_dir) + + + + +