From f76f9e17fb814e7a4963d9cef91a7ac611ef535d Mon Sep 17 00:00:00 2001 From: philippe lhardy Date: Fri, 28 Jul 2023 12:04:15 +0200 Subject: [PATCH] move git url in project.gitref change init.sh - init.sh now parse project.gitref - generate project.gitref that contains git dependencies ./printclonesdep.sh >project.gitref - update fetch_dependencies --- fetch_dependencies.sh | 20 +++++++++++----- init.sh | 53 +++++++++++++++++++++++++++++++++++-------- project.gitref | 15 ++++++++++++ 3 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 project.gitref diff --git a/fetch_dependencies.sh b/fetch_dependencies.sh index 29694f7..b7cf21d 100755 --- a/fetch_dependencies.sh +++ b/fetch_dependencies.sh @@ -18,7 +18,6 @@ log_info() fetch_jackson_databind() { - libversion_jackson_databind=2.12.0 lib_jackson_databind=jackson-databind-${libversion_jackson_databind}.jar if [[ ! -e libs/$lib_jackson_databind ]] then @@ -29,11 +28,16 @@ fetch_jackson_databind() fi } + +libversion_jackson_databind=2.12.0 +sharedrawweb_git_url="ssh://philippe@www4.artisanlogiciel.net:2023/home/philippe/artisanlogiciel/code/sharedrawweb" +libversion_artgaphic=0.2.0 +lib_artgaphic=artgaphics-${libversion_artgaphic}.jar + if [[ ! -d ../sharedrawweb ]] then log_error "expected a sharedrawweb project parent ( for exports ). Please clone related project." - sharedrawweb_git_url="ssh://philippe@www4.artisanlogiciel.net:2023/home/philippe/artisanlogiciel/code/sharedrawweb" - log_info "cd ..; git clone sharedrawweb_git_url" + log_info "cd ..; git clone $sharedrawweb_git_url" fi if [[ ! -d libs ]] @@ -41,11 +45,15 @@ then mkdir libs fi -libversion_artgaphic=0.2.0 -lib_artgaphic=artgaphics-${libversion_artgaphic}.jar if [[ ! -e libs/$lib_artgaphic ]] then - ln -s ../../sharedrawweb/dist/lib/$lib_artgaphic libs/ + lib_artgaphic_source_file=../../sharedrawweb/dist/lib/$lib_artgaphic + if [[ -f $lib_artgaphic_source_file ]] + then + ln -s $lib_artgaphic_source_file libs/ + else + log_error "Missing $lib_artgaphic_source_file. It is require to build it sharedrawweb project first" + fi fi if [[ -n $use_jackson ]] diff --git a/init.sh b/init.sh index 099a116..a7fb5e2 100755 --- a/init.sh +++ b/init.sh @@ -1,11 +1,46 @@ #!/bin/bash -if [[ ! -d artlog_toolbox ]] -then - git clone https://github.com/artlog/artlog_toolbox.git artlog_toolbox -fi -pushd artlog_toolbox -git checkout master -popd -artlog_toolbox/deploy.sh -./doit.sh +setup() +{ + artlog_toolbox_path=../artlog_toolbox + if [[ ! -d $artlog_toolbox_path ]] + then + git clone $artlog_toolbox_remote_origin_url $artlog_toolbox_path + pushd $artlog_toolbox_path + git checkout + popd + fi + $artlog_toolbox_path/deploy.sh +} + +# parses project.gitref +project= +gitref=project.gitref + +while read line +do + if [[ $line =~ \[([_a-z]*)\] ]] + then + project=${BASH_REMATCH[1]} + elif [[ $line =~ remote.origin.url=(.*) ]] + then + remote_origin_url=${BASH_REMATCH[1]} + echo "$project $remote_origin_url" + case $project in + sharedrawweb) + sharedrawweb_remote_origin_url=$remote_origin_url + ;; + artloglaby) + artloglaby_remote_origin_url=$remote_origin_url + ;; + artlog_toolbox) + artlog_toolbox_remote_origin_url=$remote_origin_url + ;; + *) + echo "ERROR unrecognized project='$project' line='$line'" + ;; + esac + fi +done <$gitref + +setup diff --git a/project.gitref b/project.gitref new file mode 100644 index 0000000..3256b03 --- /dev/null +++ b/project.gitref @@ -0,0 +1,15 @@ +# +# root.absolute=/home/plhardy/artisanlogiciel/testbed/laby +# date=ven. 28 juil. 2023 11:59:40 CEST +[artloglaby] +path=. +remote.origin.url=ssh://philippe@www4.artisanlogiciel.net:2023/home/philippe/artisanlogiciel/code/laby +head=a22a2fd1b6eec74cd4a37f086ff01d46a50d8a9b +[sharedrawweb] +path=../sharedrawweb +remote.origin.url=ssh://philippe@www4.artisanlogiciel.net:2023/home/philippe/artisanlogiciel/code/sharedrawweb +head=c217d96129b5f83c26c041f766718b6bdf93a2d6 +[artlog_toolbox] +path=../artlog_toolbox +remote.origin.url=ssh://philippe@www4.artisanlogiciel.net:2023/home/philippe/artisanlogiciel/code/artlog_toolbox +head=ea7e49c578d89ec4c7f41fd5b526e3ef4a8dbb37