# Sconstruct file for P4WordDiff import string, os, re, glob def filename(p): # Return filename bit return os.path.split(p)[1] VB6 = '"C:\Program Files\Microsoft Visual Studio\VB98\VB6.exe"' MSDEV_PATH = 'c:/Program Files/Microsoft Visual Studio 9.0/Common7/IDE' INNOSETUP = '"C:\Program Files\Inno Setup 5\iscc.exe"' #--------------------------------- # Also VB scanner for dependencies like: # Module=Register; Register.bas # Form=TimerForm.frm # Form=p4vbTestForm.frm # Class=WinHelp; WinHelp.cls vbp_module_re = re.compile(r'^Module=\S+; (\S+)\s*$', re.M) vbp_form_re = re.compile(r'^Form=(\S+)\s*$', re.M) vbp_class_re = re.compile(r'^Class=\S+; (\S+)\s*$', re.M) def vbp_scan(node, env, target, arg): contents = node.get_contents() includes = vbp_module_re.findall(contents) includes += vbp_form_re.findall(contents) includes += vbp_class_re.findall(contents) # print "Node: " + node.name # print "Includes: " + string.join(includes, ' ') # print "Change no: " + p4_change_no(1) return includes vbpscan = Scanner(name = 'vbp', function = vbp_scan, argument = None, skeys = ['.vbp']) scanners = Environment().Dictionary('SCANNERS') #--------------------------------- # Scan MSDEV SLN file for dependencies vcproj_re = re.compile(r'<File\s+RelativePath="([^"]*)', re.M) vcproj_re_exclude = re.compile(r'.*_i\..*') def vcproj_scan(node, env, target, arg): # print "Node: " + node.name + ': ' + node.get_abspath() contents = node.get_contents() includes = vcproj_re.findall(contents) # print "Includes: " + ' '.join(includes) # Remove files generated by MIDL compiler (e.g. *_i.c or similar) includes = filter(lambda x:not vcproj_re_exclude.match(x), includes) # print "Filtered Includes: " + ' '.join(includes) return includes vcprojscan = Scanner(name = 'vcproj', function = vcproj_scan, argument = None, skeys = ['.vcproj']) #--------------------------------- # Builder for Setup compiler mkinstall = Builder(action = INNOSETUP + ' $SOURCES') msvb = Builder(action = VB6 + ' /make $SOURCES') msdev_rel = Builder(action = 'devenv $SOURCES /Build "Release|Win32"') files_dir = 'install/files' setup = 'install/Output/P4WordDiffSetup.exe' p4worddiff = 'src/p4worddiff.exe' update_settings = 'src/update_settings/Release/update_settings.exe' # Files to remove when appropriate # Default target to build Default(setup) env = Environment(BUILDERS = {'mkinstall' : mkinstall, 'msdev_rel' : msdev_rel, 'msvb' : msvb}, SCANNERS = scanners + [vbpscan, vcprojscan], ENV = {'PATH' : os.environ['PATH']} ) env.PrependENVPath('PATH', MSDEV_PATH) # print env.Dump() FILES = [] env.Install(dir = files_dir, source = FILES) for f in FILES: env.Depends(setup, files_dir + '/' + filename(f)) env.msvb(target = p4worddiff, source = 'src/p4worddiff.vbp') env.msdev_rel(target = update_settings, source = 'src/update_settings/update_settings.vcproj') for f in [p4worddiff, update_settings]: env.Install(dir = files_dir, source = f) env.Depends(setup, files_dir + '/' + filename(f)) env.mkinstall(target = setup, source = 'install/P4WordDiffSetup.iss')
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 11846 | Robert Cowham | Rename P4WordDiff to P4OfficeDiff - start of process | ||
#2 | 11599 | Robert Cowham |
Steps along the way. Basic project works (P4WordDiff) - removed dependency on outdated OCX. Also works better with Word 2010/13 Update_settings project updated to Visual Studio 2013 and compiles, even if it doesn't work yet! |
||
#1 | 11587 | Robert Cowham |
Initial project from internal sources. Needs updating (fgorm 2008 technology)! |