help with deleting or cleaning files

Damien <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <[email protected]>
All,

As part of our installers, we put a set of dlls (or so's) into a 
directory, to go into one of our products. Because of the way this 
product is shipped, the dlls go into a directory that's not debug or 
release, it just has the binaries. When we're doing debug builds and 
testing, the debug dlls go into that directory and when we're doing 
release testing, the release versions go in there. I'd like to automate 
removing the debug dlls if we do a release build and vice versa, right 
now we do that by hand, which is silly.

I thought we could do this with env.Clean(...) but that appears not to 
be the case. Here's a cut down example in an SConscript:

dbgfilelist  [
          'concrt140d.dll',
          'msvcp140d.dll',
          'vccorlib140d.dll',
          'vcomp140.dll',
          'vcruntime140d.dll'
       ]

relfilelist = [
          'concrt140.dll',
          'msvcp140.dll',
          'vccorlib140.dll',
          'vcomp140.dll',
          'vcruntime140.dll'
       ]

if thisenv['BUILDTYPE'] == 'DEBUG':
       thisenv['INSTALLDIR'] = thisenv['BINDIR'] + 
'/../../interfaces/binaries/x64'
       releaseclean = thisenv.Clean(thisenv['INSTALLDIR'], [x for x in 
relfilelist])
       releaseinstall1 = thisenv.Install(thisenv['INSTALLDIR'], 
[os.path.join(thisenv['BINDIR'], x) for x in dbgfilelist])
       Default(releaseclean + releaseinstall1)
else:
       thisenv['INSTALLDIR'] = thisenv['BINDIR'] + 
'/../../interfaces/binaries/x64'
       debugclean = thisenv.Clean(thisenv['INSTALLDIR'], [x for x in 
dbgfilelist])
       debuginstall1 = thisenv.Install(thisenv['INSTALLDIR'], 
[os.path.join(thisenv['BINDIR'], x) for x in relfilelist])
       Default(debugclean + debuginstall1)

When I try this, SCons says: TypeError: unsupported operand type(s) for 
+: 'NoneType' and 'list': for the Default setup. I always thought you 
could just add Actions but obviously I'm doing something wrong.

If this is the wrong way to use Clean, can someone demonstrate how to do 
this with Command and Delete? The full file list has 15 or so binaries, 
so I'd like to do it with a list rather than line by line.

Damien

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.