Changeset 1195 for trunk/SConstruct


Ignore:
Timestamp:
08/29/06 09:47:08 (18 years ago)
Author:
mar637
Message:

added module test action. fixed makedist target including install script.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r1187 r1195  
    2626                           ["release","debug"], ignorecase=1),
    2727                ("makedist",
    28                  "Make a binary distribution giving a suffix, e.g. sarge or fc5",
     28                 "Make a binary archive giving a suffix, e.g. sarge or fc5",
    2929                 "")
    3030                )
     
    9393# build library
    9494so = env.SConscript("src/SConscript", build_dir="build", duplicate=0)
     95# test module import, to see if there are unresolved symbols
     96def test_module(target,source,env):
     97    pth = str(target[0])
     98    mod = os.path.splitext(pth)[0]
     99    sys.path.insert(2, os.path.split(mod)[0])
     100    __import__(os.path.split(mod)[1])
     101    print "ok"
     102    return 0
     103def test_str(target, source, env):
     104    return "Testing module..."
     105
     106taction = Action(test_module, test_str)
     107env.AddPostAction(so, taction)
    95108
    96109# install targets
     
    108121    rootdir = "/nfs/aips++/data"
    109122elif os.path.exists("data"):
    110     rootdir = "data"
     123    rootdir = "./data"
    111124if rootdir is not None:
    112125    ofiles, ifiles = env.WalkDirTree(outdir, rootdir, sources)
     
    119132    env.Command('Staging distribution for archive in %s' % env["stagedir"],
    120133                '', env.MessageAction)
    121     env.QInstall("$stagedir/asap", [so,  env.SGlob("python/*.py")] )
     134    st0 = env.QInstall("$stagedir/asap", [so,  env.SGlob("python/*.py")] )
    122135    env.QInstall("$stagedir/bin", ["bin/asap", "bin/asap_update_data"])
    123     env.QInstall("$stagedir/install", ["bin/install"])
    124     env.QInstall("$stagedir/data", "share/ipythonrc-asap")
    125     if os.path.exists("/nfs/aips++/data"):
    126         rootdir = "/nfs/aips++/data"
    127         sources = ['ephemerides','geodetic']
     136    env.QInstall("$stagedir", ["bin/install"])
     137    env.QInstall("$stagedir/asap/data", "share/ipythonrc-asap")
     138    if rootdir is not None:
     139        env.Command("Using data tables in %s" % rootdir,
     140                    '', env.MessageAction)       
    128141        outdir =  os.path.join(env["stagedir"],'asap','data')
    129142        ofiles, ifiles = env.WalkDirTree(outdir, rootdir, sources)
    130143        env.QInstallAs(ofiles, ifiles)
     144    else:
     145        env.Command("No data tables available. Use 'asap_update_data' after install",
     146                    '', env.MessageAction)       
    131147    arch = env.Archiver(os.path.join("dist",env["stagedir"]),
    132148                        env["stagedir"])
    133149    env.AddPostAction(arch, Delete("$stagedir"))
    134    
     150
     151if env.GetOption("clean"):
     152    Execute(Delete(".sconf_temp"))
Note: See TracChangeset for help on using the changeset viewer.