Changeset 19086
- Timestamp:
- 07/22/06 08:21:12 (2 years ago)
- Files:
-
- juggler/trunk/build_windows.py (modified) (30 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/trunk/build_windows.py
r19039 r19086 28 28 29 29 import glob 30 import os 30 import os, os.path 31 31 import re 32 32 import shutil … … 35 35 import traceback 36 36 import getopt 37 pj = os.path.join 37 38 38 39 EXIT_STATUS_SUCCESS = 0 … … 829 830 mkinstalldirs(os.path.join(prefix, 'share')) 830 831 832 def smartCopy(srcfile, dst): 833 """ Only copy file if it has changed, and delete it first. 834 Drop in replacement for shutil.copy2. 835 srcfile - Full path to source file to copy. 836 dst - Destination filename or directory. 837 """ 838 if os.path.isdir(dst): 839 dst = os.path.join(dst, os.path.basename(srcfile)) 840 841 # Verify we need to copy and make sure to delete if needed 842 if os.path.isfile(dst): 843 stat_src = os.stat(srcfile) 844 stat_dst = os.stat(dst) 845 if (stat_src.st_size == stat_dst.st_size) and \ 846 (stat_src.st_mtime == stat_dst.st_mtime): 847 #print "skipping: ", dst 848 return # File doesn't need to be copied 849 #print "removing: ", dst 850 os.remove(dst) 851 852 # Copy it 853 shutil.copy2(srcfile, dst) 854 855 831 856 def installDir(startDir, destDir, allowedExts = None, disallowedExts = None, 832 857 disallowedFiles = None): 858 #print " %s ==> %s"%(startDir, destDir) 833 859 cwd = os.getcwd() 834 860 … … 866 892 disallowedFiles) 867 893 else: 868 (root, f_ext) = os.path.splitext(f) 869 if allowedExts is None: 870 if f_ext not in disallowedExts: 871 shutil.copy2(f, destDir) 872 elif f_ext in allowedExts: 873 if f not in disallowedFiles: 874 shutil.copy2(f, destDir) 894 try: 895 (root, f_ext) = os.path.splitext(f) 896 if allowedExts is None: 897 if f_ext not in disallowedExts: 898 smartCopy(f, pj(destDir,f)) 899 elif f_ext in allowedExts: 900 if f not in disallowedFiles: 901 smartCopy(f, pj(destDir,f)) 902 except (IOError, os.error), why: 903 print "Can't copy %s to %s: %s" % (f, destDir, str(why)) 875 904 876 905 os.chdir(cwd) … … 915 944 srcroot = os.path.join(gJugglerDir, 'modules', 'vapor') 916 945 917 s hutil.copy2(os.path.join(gJugglerDir, 'COPYING.txt'), destdir)946 smartCopy(os.path.join(gJugglerDir, 'COPYING.txt'), destdir) 918 947 extra_files = ['ChangeLog', 'README.txt', 'RELEASE_NOTES.txt'] 919 948 for f in extra_files: 920 s hutil.copy2(os.path.join(srcroot, f), destdir)949 smartCopy(os.path.join(srcroot, f), destdir) 921 950 922 951 def installTweek(prefix, buildDir): … … 946 975 srcroot = os.path.join(gJugglerDir, 'modules', 'tweek') 947 976 948 s hutil.copy2(os.path.join(gJugglerDir, 'COPYING.txt'), destdir)977 smartCopy(os.path.join(gJugglerDir, 'COPYING.txt'), destdir) 949 978 extra_files = ['ChangeLog', 'RELEASE_NOTES.txt'] 950 979 for f in extra_files: 951 s hutil.copy2(os.path.join(srcroot, f), destdir)980 smartCopy(os.path.join(srcroot, f), destdir) 952 981 953 982 def installTweekJava(prefix, buildDir): … … 977 1006 # Install the base JAR files that make up the Tweek Java API. 978 1007 for j in jars: 979 s hutil.copy2(os.path.join(srcdir, j), destdir)1008 smartCopy(os.path.join(srcdir, j), destdir) 980 1009 981 1010 # Install the tweek_jni DLL. … … 987 1016 destdir = os.path.join(destdir, arch) 988 1017 mkinstalldirs(destdir) 989 s hutil.copy2(dll, destdir)1018 smartCopy(dll, destdir) 990 1019 991 1020 destdir = os.path.join(prefix, 'share', 'tweek', 'beans') … … 999 1028 jar = b + '.jar' 1000 1029 xml = b + '.xml' 1001 s hutil.copy2(os.path.join(bean_srcdir, jar), destdir)1002 s hutil.copy2(os.path.join(xml_srcdir, xml), destdir)1030 smartCopy(os.path.join(bean_srcdir, jar), destdir) 1031 smartCopy(os.path.join(xml_srcdir, xml), destdir) 1003 1032 1004 1033 xml_srcdir = os.path.join(gJugglerDir, 'modules', 'tweek', 'extensions', … … 1009 1038 jar = b + '.jar' 1010 1039 xml = b + '.xml' 1011 s hutil.copy2(os.path.join(bean_srcdir, jar), destdir)1012 s hutil.copy2(os.path.join(xml_srcdir, xml), destdir)1040 smartCopy(os.path.join(bean_srcdir, jar), destdir) 1041 smartCopy(os.path.join(xml_srcdir, xml), destdir) 1013 1042 1014 1043 # Install tweek.bat. 1015 1044 srcdir = os.path.join(gJugglerDir, 'modules', 'tweek', 'java') 1016 1045 destdir = os.path.join(prefix, 'bin') 1017 s hutil.copy2(os.path.join(srcdir, 'tweek.bat'), destdir)1046 smartCopy(os.path.join(srcdir, 'tweek.bat'), destdir) 1018 1047 1019 1048 # Install JacORB IDL compiler. 1020 1049 srcdir = os.path.join(gJugglerDir, 'external', 'JacORB') 1021 1050 installDir(srcdir, destdir, ['.jar']) 1022 s hutil.copy2(os.path.join(srcdir, 'idl.bat'), destdir)1051 smartCopy(os.path.join(srcdir, 'idl.bat'), destdir) 1023 1052 1024 1053 # Destination for all remaining .jar files. … … 1040 1069 srcroot = os.path.join(gJugglerDir, 'external', 'swing-laf') 1041 1070 for j in laf_jars: 1042 s hutil.copy2(os.path.join(srcroot, j), destdir)1071 smartCopy(os.path.join(srcroot, j), destdir) 1043 1072 else: 1044 1073 printStatus("Tweek Java API not built. Skipping.") … … 1078 1107 '3.0') 1079 1108 mkinstalldirs(destdir) 1080 s hutil.copy2(os.path.join(srcdir, 'configuration.xsd'), destdir)1109 smartCopy(os.path.join(srcdir, 'configuration.xsd'), destdir) 1081 1110 1082 1111 destdir = os.path.join(schema_root, 'www.vrjuggler.org', 'jccl', 'xsd', 1083 1112 '3.1') 1084 1113 mkinstalldirs(destdir) 1085 s hutil.copy2(os.path.join(srcdir, 'definition.xsd'), destdir)1114 smartCopy(os.path.join(srcdir, 'definition.xsd'), destdir) 1086 1115 1087 1116 destdir = schema_root … … 1094 1123 srcroot = os.path.join(gJugglerDir, 'modules', 'jackal') 1095 1124 1096 s hutil.copy2(os.path.join(gJugglerDir, 'COPYING.txt'), destdir)1125 smartCopy(os.path.join(gJugglerDir, 'COPYING.txt'), destdir) 1097 1126 extra_files = ['ChangeLog', 'RELEASE_NOTES.txt'] 1098 1127 for f in extra_files: 1099 s hutil.copy2(os.path.join(srcroot, f), destdir)1128 smartCopy(os.path.join(srcroot, f), destdir) 1100 1129 1101 1130 def installJCCLPlugins(prefix, buildDir): … … 1121 1150 1122 1151 for j in jars: 1123 s hutil.copy2(os.path.join(srcdir, j), destdir)1152 smartCopy(os.path.join(srcdir, j), destdir) 1124 1153 1125 1154 srcdir = os.path.join(gJugglerDir, 'modules', 'jackal', 'config') 1126 s hutil.copy2(os.path.join(srcdir, 'jccl_config.xml'), destdir)1155 smartCopy(os.path.join(srcdir, 'jccl_config.xml'), destdir) 1127 1156 1128 1157 # Install dependencies. … … 1136 1165 mkinstalldirs(destdir) 1137 1166 for j in dep_jars: 1138 s hutil.copy2(os.path.join(srcroot, j), destdir)1167 smartCopy(os.path.join(srcroot, j), destdir) 1139 1168 else: 1140 1169 printStatus("JCCL Java API not built. Skipping.") … … 1147 1176 1148 1177 destdir = os.path.join(prefix, 'share', 'jccl', 'beans') 1149 s hutil.copy2(os.path.join(srcdir, 'jccl_rtrc.jar'), destdir)1178 smartCopy(os.path.join(srcdir, 'jccl_rtrc.jar'), destdir) 1150 1179 1151 1180 srcdir = os.path.join(gJugglerDir, 'modules', 'jackal', 'plugins', 1152 1181 'corba_rtrc') 1153 s hutil.copy2(os.path.join(srcdir, 'jccl_rtrc.xml'), destdir)1182 smartCopy(os.path.join(srcdir, 'jccl_rtrc.xml'), destdir) 1154 1183 else: 1155 1184 printStatus("JCCL Java plug-ins not built. Skipping.") … … 1181 1210 srcroot = os.path.join(gJugglerDir, 'modules', 'sonix') 1182 1211 1183 s hutil.copy2(os.path.join(gJugglerDir, 'COPYING.txt'), destdir)1212 smartCopy(os.path.join(gJugglerDir, 'COPYING.txt'), destdir) 1184 1213 extra_files = ['ChangeLog', 'README.txt'] 1185 1214 for f in extra_files: 1186 s hutil.copy2(os.path.join(srcroot, f), destdir)1215 smartCopy(os.path.join(srcroot, f), destdir) 1187 1216 1188 1217 def installSonixPlugins(prefix, buildDir): … … 1242 1271 srcroot = os.path.join(gJugglerDir, 'modules', 'gadgeteer') 1243 1272 1244 s hutil.copy2(os.path.join(gJugglerDir, 'COPYING.txt'), destdir)1273 smartCopy(os.path.join(gJugglerDir, 'COPYING.txt'), destdir) 1245 1274 extra_files = ['ChangeLog', 'RELEASE_NOTES.txt'] 1246 1275 for f in extra_files: 1247 s hutil.copy2(os.path.join(srcroot, f), destdir)1276 smartCopy(os.path.join(srcroot, f), destdir) 1248 1277 1249 1278 def installGadgeteerDrivers(prefix, buildDir): … … 1321 1350 srcroot = os.path.join(gJugglerDir, 'modules', 'vrjuggler') 1322 1351 1323 s hutil.copy2(os.path.join(gJugglerDir, 'COPYING.txt'), destdir)1352 smartCopy(os.path.join(gJugglerDir, 'COPYING.txt'), destdir) 1324 1353 extra_files = ['ChangeLog', 'RELEASE_NOTES.txt'] 1325 1354 for f in extra_files: 1326 s hutil.copy2(os.path.join(srcroot, f), destdir)1355 smartCopy(os.path.join(srcroot, f), destdir) 1327 1356 1328 1357 def installVRJConfig(prefix, buildDir): … … 1365 1394 jar_file = os.path.join(jardir, j) 1366 1395 if os.path.exists(jar_file): 1367 s hutil.copy2(jar_file, destdir)1396 smartCopy(jar_file, destdir) 1368 1397 1369 1398 # Install the base set of VRJConfig JavaBeans. … … 1373 1402 jar_file = os.path.join(jardir, j) 1374 1403 if os.path.exists(jar_file): 1375 s hutil.copy2(jar_file, destdir)1376 1377 s hutil.copy2(os.path.join(vrjconfig_src, 'VRJConfig.xml'), destdir)1404 smartCopy(jar_file, destdir) 1405 1406 smartCopy(os.path.join(vrjconfig_src, 'VRJConfig.xml'), destdir) 1378 1407 1379 1408 # Install any custom editors that were compiled. … … 1385 1414 xml_file = os.path.join(custom_editor_src, e[0], e[1] + '.xml') 1386 1415 if os.path.exists(jar_file): 1387 s hutil.copy2(xml_file, destdir)1388 s hutil.copy2(jar_file, destdir)1416 smartCopy(xml_file, destdir) 1417 smartCopy(jar_file, destdir) 1389 1418 1390 1419 # Install any wizards that were compiled. … … 1394 1423 jar_file = os.path.join(jardir, e[1] + '.jar') 1395 1424 if os.path.exists(jar_file): 1396 s hutil.copy2(jar_file, destdir)1425 smartCopy(jar_file, destdir) 1397 1426 1398 1427 # Install vrjconfig.bat. 1399 1428 destdir = os.path.join(prefix, 'bin') 1400 s hutil.copy2(os.path.join(vrjconfig_src, 'vrjconfig.bat'), destdir)1429 smartCopy(os.path.join(vrjconfig_src, 'vrjconfig.bat'), destdir) 1401 1430 1402 1431 # Install dependencies. … … 1409 1438 destdir = os.path.join(prefix, 'share', 'vrjuggler', 'java') 1410 1439 for j in dep_jars: 1411 s hutil.copy2(os.path.join(srcroot, j), destdir)1440 smartCopy(os.path.join(srcroot, j), destdir) 1412 1441 else: 1413 1442 printStatus("VRJConfig not built. Skipping.") … … 1433 1462 destdir = os.path.join(prefix, 'share', 'vrjuggler', 'beans') 1434 1463 mkinstalldirs(destdir) 1435 s hutil.copy2(os.path.join(srcdir, name + '.jar'), destdir)1464 smartCopy(os.path.join(srcdir, name + '.jar'), destdir) 1436 1465 1437 1466 srcdir = os.path.join(gJugglerDir, 'modules', 'vrjuggler', 'plugins', 1438 1467 dir) 1439 s hutil.copy2(os.path.join(srcdir, name + '.xml'), destdir)1468 smartCopy(os.path.join(srcdir, name + '.xml'), destdir) 1440 1469 else: 1441 1470 printStatus("VR Juggler %s Java plug-ins not built. Skipping." % name) … … 1459 1488 1460 1489 for d in dlls: 1461 shutil.copy2(d, destdir) 1462 1463 shutil.copy2(os.path.join(sys_dir, 'dbghelp.dll'), destdir) 1490 smartCopy(d, pj(destdir,d)) 1491 1492 #smartCopy(d, pj(destdir,d)) 1493 smartCopy(os.path.join(sys_dir, 'dbghelp.dll'), destdir) 1464 1494 except KeyError, ex: 1465 1495 printStatus("WARNING: Could not install MSVC runtime DLLs") … … 1513 1543 def installBoost(prefix): 1514 1544 printStatus("Installing Boost headers and libraries") 1545 print "Installing Boost headers and libraries" 1515 1546 1516 1547 srcroot = os.environ['BOOST_ROOT'] … … 1527 1558 1528 1559 for f in lib_list: 1529 shutil.copy2(f, destdir) 1560 #print " ==> ", f 1561 smartCopy(f, destdir) 1530 1562 1531 1563 def installGMTL(prefix): … … 1550 1582 dll = os.path.join(d, 'OpenAL32.dll') 1551 1583 if os.path.exists(dll): 1552 s hutil.copy2(dll, destdir)1584 smartCopy(dll, destdir) 1553 1585 1554 1586 srcdir = os.environ['ALUT_ROOT'] … … 1559 1591 alut_dll = os.path.join(srcdir, 'lib', 'alut.dll') 1560 1592 if os.path.exists(alut_dll): 1561 s hutil.copy2(dll, destdir)1593 smartCopy(dll, destdir) 1562 1594 1563 1595 def installOmniORB(prefix):
