Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
add (build): scons clean targets (#621)
Browse files Browse the repository at this point in the history
* now with -c distclean and -c buildclean options, it still deletes things in third_party bc of scons/khEnvironment.py though

* removed some debugging messages I missed

* missed a line from a previous experiment

* removing extra stuff

* added back the line that deletes /tmp/fusion_os_install and uncommented the original lines

* putting back some lines that i accidentally removed due to a bad local merge

* removing some whitespace i added during the last commit

* removing some whitespace i added during the last commit

* now has only one target, which is -c cleanall

* apparently neither Clean() nor Delete() can be successfully invoked from inside a non-target scons block?

* now fully deletes things after cleaning, preventing re-creation of metadata scons files
  • Loading branch information
tst-mswartz authored and tst-jcupp committed Dec 8, 2017
1 parent 4ec1a58 commit 9acd3e0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 23 additions & 2 deletions earth_enterprise/SConstruct
Expand Up @@ -180,7 +180,28 @@ env.PhonyTargets(**this_dict)

# Clean install dir (note: the current sconscripts leave stuff behind, like
# directories).
if env.GetOption('clean'):
# clean the search and getomcat install folders.

if 'cleanall' in COMMAND_LINE_TARGETS:
#clean the search and getomcat install folders.
file = installdir.get_path()
commands.getstatusoutput("rm -rf " + file)

#clean /tmp/fusion_os_install
Clean(env, installdir)

#clean build data in ./src
clean_cmd = 'cd src; scons %s -c cleanall' % (arg_vars)
env.Execute(clean_cmd)

#clean scons metadata.. can't use Clean() or Delete()
#because they are scons functions and recreate
#the files/directories they delete
for sconsfile in [
".sconsign.dblite",
".sconf_temp",
"config.log",
"src/.sconsign.dblite",
"src/.sconf_temp",
"src/config.log"]:
os.system("rm -rf " + sconsfile)

2 changes: 2 additions & 0 deletions earth_enterprise/src/SConstruct
Expand Up @@ -524,3 +524,5 @@ env['LRELEASE'] = qtdir+'/bin/lrelease'
env['KHIDL'] = File('#common/khxml/khidl.pl')

SConscript('SConscript', build_dir=builddir, duplicate=0)

env.Clean('cleanall', [[exportdir+"/"+x for x in os.listdir(exportdir) if x != "third_party"]])

0 comments on commit 9acd3e0

Please sign in to comment.