# HG changeset patch # User Christian Wimmer # Date 1431645612 25200 # Node ID f9883cab45800f10e5e69071cb94d0691ab4d649 # Parent 706ffad4d773aa447f6f3482e5b5811e278e6c93 mx: Allow disabling of package prefix check diff -r 706ffad4d773 -r f9883cab4580 mxtool/mx.py --- a/mxtool/mx.py Thu May 14 16:19:40 2015 -0700 +++ b/mxtool/mx.py Thu May 14 16:20:12 2015 -0700 @@ -622,7 +622,7 @@ if not exists(cachePath) or sha1OfFile(cachePath) != sha1: if exists(cachePath): - log('SHA1 of ' + cachePath + ' does not match expected value (' + sha1 + ') - re-downloading') + log('SHA1 of ' + cachePath + ' does not match expected value (' + sha1 + ') - found ' + sha1OfFile(cachePath) + ' - re-downloading') print 'Downloading ' + ("sources " if sources else "") + name + ' from ' + str(urls) download(cachePath, urls) @@ -1019,6 +1019,7 @@ p = Project(self, name, srcDirs, deps, javaCompliance, workingSets, d) p.checkstyleProj = attrs.pop('checkstyle', name) p.native = attrs.pop('native', '') == 'true' + p.checkPackagePrefix = attrs.pop('checkPackagePrefix', 'true') == 'true' if not p.native and p.javaCompliance is None: abort('javaCompliance property required for non-native project ' + name) if len(ap) > 0: @@ -3355,9 +3356,10 @@ nonCanonical = [] for s in suites(True): for p in s.projects: - for pkg in p.defined_java_packages(): - if not pkg.startswith(p.name): - abort('package in {0} does not have prefix matching project name: {1}'.format(p, pkg)) + if p.checkPackagePrefix: + for pkg in p.defined_java_packages(): + if not pkg.startswith(p.name): + abort('package in {0} does not have prefix matching project name: {1}'.format(p, pkg)) ignoredDeps = set([name for name in p.deps if project(name, False) is not None]) for pkg in p.imported_java_packages(): @@ -3451,7 +3453,7 @@ config = join(project(p.checkstyleProj).dir, '.checkstyle_checks.xml') if not exists(config): - logv('[No Checkstyle configuration foudn for {0} - skipping]'.format(p)) + logv('[No Checkstyle configuration found for {0} - skipping]'.format(p)) continue # skip checking this Java project if its Java compliance level is "higher" than the configured JDK