diff --git a/updateReleaseInfo.sh b/updateReleaseInfo.sh index 1fc4f6166aaebcf5b13f1bb1b23430ac4740a4a0..e40100260a2657366c06026e9b6d1a132fd32445 100755 --- a/updateReleaseInfo.sh +++ b/updateReleaseInfo.sh @@ -3,14 +3,25 @@ # mise à jour de ReleaseInfo.java avec les nums. de release Praxis core+GUI # et date courante -core=$(cd ~/Projets/praxis-git/praxis-core; git rev-parse --verify HEAD | cut -c -10) -swing=$(cd ~/Projets/praxis-git/praxis-swing-gui; git rev-parse --verify HEAD | cut -c -10) -echo core:$core GUI:$swing 1>&2 +# git log --pretty=format:'%H %ai' HEAD -1 +# git log --pretty=format:'%h, %ad' --date=short -1 + +#core=$(cd ~/Projets/praxis-git/praxis-core; git rev-parse --verify HEAD | cut -c -10) +#swing=$(cd ~/Projets/praxis-git/praxis-swing-gui; git rev-parse --verify HEAD | cut -c -10) +core=$(cd ~/Projets/praxis-git/praxis-core; git log --pretty=format:'%H %ad' --date=short HEAD -1) +swing=$(cd ~/Projets/praxis-git/praxis-swing-gui; git log --pretty=format:'%H %ad --date=short' HEAD -1) + +core_htag=${core%% *} +swing_htag=${swing%% *} + +echo core:${core_htag:0:10} GUI:${swing_htag:0:10} 1>&2 + cd ~/Projets/praxis-git/praxis-core/src/eu/telecom_bretagne/praxis/common -sed -e 's|\(public *static *final *String *release *= *"\)[^"]*";|\1'"core:$core GUI:$swing\";|" ReleaseInfo.java > ReleaseInfo.java.sed +sed -i -e 's|\(public *static *final *String *release *= *"\)[^"]*";|\1'"core:${core_htag:0:10} GUI:${swing_htag:0:10}\";|" ReleaseInfo.java + +sed -i -e 's|\(public *static *final *String *release_date *= *"\)[^"]*";|\1'"${core#* }\";|" ReleaseInfo.java today=$(date +"%Y-%m-%d") -sed -e 's|\(public *static *final *String *release_date *= *"\)[^"]*";|\1'"$today\";|" ReleaseInfo.java.sed > ReleaseInfo.java +sed -i -e 's|\(public *static *final *String *package_date *= *"\)[^"]*";|\1'"$today\";|" ReleaseInfo.java -/bin/rm ReleaseInfo.java.sed