Mercurial > hg > graal-jvmci-8
comparison mxtool/mx.py @ 16087:64e172733061
mx clean: delete distributions
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Thu, 12 Jun 2014 11:40:33 +0200 |
parents | 6eef506c173d |
children | 1f4955abca9b |
comparison
equal
deleted
inserted
replaced
16086:6eef506c173d | 16087:64e172733061 |
---|---|
2847 suppliedParser = parser is not None | 2847 suppliedParser = parser is not None |
2848 | 2848 |
2849 parser = parser if suppliedParser else ArgumentParser(prog='mx clean') | 2849 parser = parser if suppliedParser else ArgumentParser(prog='mx clean') |
2850 parser.add_argument('--no-native', action='store_false', dest='native', help='do not clean native projects') | 2850 parser.add_argument('--no-native', action='store_false', dest='native', help='do not clean native projects') |
2851 parser.add_argument('--no-java', action='store_false', dest='java', help='do not clean Java projects') | 2851 parser.add_argument('--no-java', action='store_false', dest='java', help='do not clean Java projects') |
2852 parser.add_argument('--no-dist', action='store_false', dest='dist', help='do not delete distributions') | |
2852 | 2853 |
2853 args = parser.parse_args(args) | 2854 args = parser.parse_args(args) |
2854 | 2855 |
2855 def _rmtree(dirPath): | 2856 def _rmtree(dirPath): |
2856 path = dirPath | 2857 path = dirPath |
2857 if get_os() == 'windows': | 2858 if get_os() == 'windows': |
2858 path = unicode("\\\\?\\" + dirPath) | 2859 path = unicode("\\\\?\\" + dirPath) |
2859 shutil.rmtree(path) | 2860 shutil.rmtree(path) |
2861 | |
2862 def _rmIfExists(name): | |
2863 if os.path.isfile(name): | |
2864 os.unlink(name) | |
2860 | 2865 |
2861 for p in projects_opt_limit_to_suites(): | 2866 for p in projects_opt_limit_to_suites(): |
2862 if p.native: | 2867 if p.native: |
2863 if args.native: | 2868 if args.native: |
2864 run([gmake_cmd(), '-C', p.dir, 'clean']) | 2869 run([gmake_cmd(), '-C', p.dir, 'clean']) |
2878 | 2883 |
2879 for configName in ['netbeans-config.zip', 'eclipse-config.zip']: | 2884 for configName in ['netbeans-config.zip', 'eclipse-config.zip']: |
2880 config = TimeStampFile(join(p.suite.mxDir, configName)) | 2885 config = TimeStampFile(join(p.suite.mxDir, configName)) |
2881 if config.exists(): | 2886 if config.exists(): |
2882 os.unlink(config.path) | 2887 os.unlink(config.path) |
2888 | |
2889 if args.dist: | |
2890 for d in _dists.keys(): | |
2891 log('Removing distribution {0}...'.format(d)) | |
2892 _rmIfExists(distribution(d).path) | |
2893 _rmIfExists(distribution(d).sourcesPath) | |
2883 | 2894 |
2884 if suppliedParser: | 2895 if suppliedParser: |
2885 return args | 2896 return args |
2886 | 2897 |
2887 def about(args): | 2898 def about(args): |