changeset 21395:f9883cab4580

mx: Allow disabling of package prefix check
author Christian Wimmer <christian.wimmer@oracle.com>
date Thu, 14 May 2015 16:20:12 -0700
parents 706ffad4d773
children 331da25c2dda
files mxtool/mx.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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