diff --git a/mx.py b/mx.py index f6259421..84f8ab06 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, get_transitive_closure, get_module_name @@ -214,6 +216,7 @@ def cpu_count(): _licenses = dict() _repositories = dict() _mavenRepoBaseURLs = [ + "https://maven-central.storage.googleapis.com/repos/central/data/", "https://repo1.maven.org/maven2/", "https://search.maven.org/remotecontent?filepath=" ] @@ -5047,7 +5050,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 @@ -7978,7 +7981,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) @@ -18406,7 +18409,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 00000000..e5f43a23 --- /dev/null +++ b/mx_tar_vcs.py @@ -0,0 +1,31 @@ +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")] + if directory.endswith("/sdk"): + return directory[:-len("/sdk")] + if directory.endswith("/substratevm"): + return directory[:-len("/substratevm")] + if directory.endswith("/vm"): + return directory[:-len("/vm")] + + 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'))