diff --git a/mx.py b/mx.py index 3eabc142c..41bd94f08 100755 --- a/mx.py +++ b/mx.py @@ -132,6 +132,8 @@ def no_suite_discovery(func): import mx_benchplot import mx_downstream import mx_subst +import mx_tar_vcs + from mx_javamodules import JavaModuleDescriptor, make_java_module, get_java_module_info, lookup_package @@ -4751,7 +4753,7 @@ def cleanForbidden(self): class VC(object): __metaclass__ = ABCMeta """ - base class for all supported Distriuted Version Constrol abstractions + base class for all supported Distributed Version Control abstractions :ivar str kind: the VC type identifier :ivar str proper_name: the long name descriptor of the VCS @@ -7667,7 +7669,7 @@ def parse_specification(import_dict, context, importer, dynamicImport=False): if version_from and version: abort("In import for '{}': 'version' and 'versionFrom' can not be both set".format(name), context=context) if version is None and version_from is None: - if not (in_subdir and (importer.vc_dir != importer.dir or isinstance(importer, BinarySuite))): + if not (in_subdir and (importer.vc_dir != importer.dir or isinstance(importer, BinarySuite) or isinstance(importer.vc, mx_tar_vcs.TarVC))): abort("In import for '{}': No version given and not a 'subdir' suite of the same repository".format(name), context=context) if importer.isSourceSuite(): suite_dir = join(importer.vc_dir, name) @@ -17863,7 +17865,7 @@ def main(): _opts.__dict__['very_verbose'] = '-V' in sys.argv _opts.__dict__['warn'] = '--no-warning' not in sys.argv global _vc_systems - _vc_systems = [HgConfig(), GitConfig(), BinaryVC()] + _vc_systems = [HgConfig(), GitConfig(), BinaryVC(), mx_tar_vcs.TarVC()] global _mx_suite _mx_suite = MXSuite() diff --git a/mx_tar_vcs.py b/mx_tar_vcs.py new file mode 100644 index 000000000..95b404fe9 --- /dev/null +++ b/mx_tar_vcs.py @@ -0,0 +1,25 @@ +import time + + +class TarVC(object): + """ Proof of concept for building from a tarball. """ + + def check(self, abortOnError=True): + return self + + def root(self, directory, abortOnError=True): + # TODO: figure out how to do this without hard coding. Some meta data? + if directory.endswith("/compiler"): + return directory[:-len("/compiler")] + if directory.endswith("/truffle"): + return directory[:-len("/truffle")] + if directory.endswith("/tools"): + return directory[:-len("/tools")] + + return directory + + def release_version_from_tags(self, vcdir, prefix, snapshotSuffix='dev', abortOnError=True): + return None + + def parent(self, vcdir, abortOnError=True): + return 'unknown-{0}'.format(time.strftime('%Y-%m-%d_%H-%M-%S_%Z'))