From d7f8e982bed6d5b34b560ea052db970cc2397a3c Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 27 Aug 2021 12:49:30 +1000 Subject: Write actual update and builh sledjchisl commands. --- src/sledjchisl/sledjchisl.c | 70 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 443698c..fcd8b99 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -2007,6 +2007,16 @@ static int filterARs(struct dirtree *node) return 0; } +static void copyOpenSim(char *t) +{ + if (shellMeFail("rm -fr ", t)) E("Failed to rm!"); + if ((! qfile_exist(t)) && (! qfile_mkdir(t, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", t); +// TODO - have to make sure it's all owned by opensimsc. + if (shellMeFail("cd %s; cp -lr current/* -t %s ", scRoot, t)) E("Failed to cp!"); + if (shellMeFail("cd %s; cp -lr current/.git* -t %s ", scRoot, t)) E("Failed to cp!"); + if (shellMeFail("cd %s; cp -lr current/.nant -t %s ", scRoot, t)) E("Failed to cp!"); + if (shellMeFail("cd %s; cp -lr current/.hgignore -t %s ", scRoot, t)) E("Failed to cp!"); +} static void runTests(char *tests[], char *title, char* file) { @@ -2438,7 +2448,57 @@ gitARend: case BUILD : { if (ourSims->doIt) -;// testOpenSim(simd, sim, type, count, window, panes, pane); + { + char *t = xmprintf("%s/current_NEW", scRoot); + + copyOpenSim(t); +/* +# Poor mans git sub modules / subtrees, coz otherwise it gets complex. +#if [ ! -d git-sub-modules/opensim-moneymodule-gloebit ]; then +# pushd git-sub-modules >/dev/null +# git clone https://github.com/gloebit/opensim-moneymodule-gloebit.git +# popd >/dev/null +#else +# pushd git-sub-modules/opensim-moneymodule-gloebit >/dev/null +# git pull +# popd >/dev/null +#fi +#rm -rf addon-modules/Gloebit/GloebitMoneyModule +#cp -r git-sub-modules/opensim-moneymodule-gloebit/addon-modules/Gloebit/GloebitMoneyModule addon-modules/Gloebit/ +*/ + if (shellMeFail("cd %s; ./runprebuild.sh autoclean", t)) E("Failed to autoclean!"); + // Clean the stuff autoclean forgets to clean. I feel so dirty. + if (shellMeFail("cd %s; find -name obj -type d -print | xargs /bin/rm -fr", t)) E("Failed to rm obj!"); + if (shellMeFail("cd %s; find -name *.csproj -type d -print | xargs /bin/rm -fr", t)) E("Failed to rm obj!"); + if (shellMeFail("cd %s; find -name *.csproj.* -type d -print | xargs /bin/rm -fr", t)) E("Failed to rm obj!"); + if (shellMeFail("cd %s; find -name *.pdb -type d -print | xargs /bin/rm -fr", t)) E("Failed to rm obj!"); + if (shellMeFail("cd %s; rm -fr bin/ScriptEngines", t)) E("Failed to rm ScriptEngines!"); + // Clean the stuff the tests created. + if (shellMeFail("cd %s; rm Test*.txt", t)) E("Failed to Test results!"); +/* +# Prebuild converts Microsoft.CSharp.targets to Microsoft.CSHARP.Targets, which case sensitive file systems fail to find. +#find -name *.csproj | xargs sed -i "s@Microsoft.CSHARP.Targets@Microsoft.CSharp.targets@g" + +# Debian no longer provides nant. +#./nant-color + +if [ "4" == $(mono -V | head -n 1 | cut -d ' ' -f 5 | cut -d '.' -f 1) ]; then + export XBUILD_COLORS=errors=brightred,warnings=yellow,events=blue + xbuild /target:clean + xbuild /p:TargetFrameworkVersion="v4.5"xbuild /p:TargetFrameworkVersion="v4.5" +else + # Use this for Mono 5 and later. + msbuild /p:Configuration=Release +# msbuild /p:Configuration=Debug +fi +*/ + // Use this for Mono 5 and later. + if (shellMeFail("cd %s; ./runprebuild.sh vs2015", t)) E("Failed to prebuild!"); + if (shellMeFail("cd %s; msbuild /p:Configuration=Release", t)) E("Failed to msbuild!"); +// #cp -f addon-modules/Gloebit/GloebitMoneyModule/bin/Gloebit.dll bin + if (shellMeFail("cd %s/src; time ./BuildIt.sh", t)) E("Failed to compile sledjchisl!"); + free(t); + } ourSims->doIt = 0; break; } @@ -2454,7 +2514,13 @@ gitARend: case UPDATE : { if (ourSims->doIt) -;// testOpenSim(simd, sim, type, count, window, panes, pane); + { + char *t = xmprintf("%s/current_NEW", scRoot); + + copyOpenSim(t); + if (shellMeFail("cd %s; git pull", t)) E("Failed to git pull!"); + free(t); + } ourSims->doIt = 0; break; } -- cgit v1.1